carbon_emission/server/src/main/java/net/carbon/controller/ProjectController.java

26 lines
849 B
Java
Raw Normal View History

package net.carbon.controller;
import net.carbon.model.vo.ProjectVO;
import net.carbon.service.ProjectService;
import net.carbon.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/api/project/v1")
public class ProjectController {
@Autowired
private ProjectService projectService;
@GetMapping("/info")
public JsonData getUserProject(@RequestParam("id") Integer id){
List<ProjectVO> projectVOList = projectService.userProject(id);
return JsonData.buildSuccess(projectVOList);
}
}