|
@@ -4,8 +4,11 @@ import javax.validation.Valid;
|
|
|
import javax.validation.constraints.NotBlank;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -51,16 +54,21 @@ public class ProjectController extends ControllerSupport {
|
|
|
User user=getAccessUser();
|
|
|
projectService.updateProject(req,user.getRootOrgId());
|
|
|
}
|
|
|
- @PostMapping("/enable")
|
|
|
- @ApiOperation(value = "启用禁用")
|
|
|
- public void updateEnable(@RequestParam(required = true)@NotBlank(message = "请选择项目") @ApiParam(value = "项目Id集合") String ids,
|
|
|
- @RequestParam(required = true) @ApiParam(value = "启用/禁用") Boolean enable) {
|
|
|
+ @PutMapping("/enable")
|
|
|
+ @ApiOperation(value = "启用")
|
|
|
+ public void enable(@RequestParam(required = true)@NotBlank(message = "请选择项目") @ApiParam(value = "项目Id集合") String ids) {
|
|
|
User user=getAccessUser();
|
|
|
- projectService.updateEnable(ids, enable, user.getRootOrgId());
|
|
|
+ projectService.updateEnable(ids, true, user.getRootOrgId());
|
|
|
}
|
|
|
- @PostMapping("page/{pageNo}/{pageSize}")
|
|
|
+ @PutMapping("/disable")
|
|
|
+ @ApiOperation(value = "禁用")
|
|
|
+ public void disable(@RequestParam(required = true)@NotBlank(message = "请选择项目") @ApiParam(value = "项目Id集合") String ids) {
|
|
|
+ User user=getAccessUser();
|
|
|
+ projectService.updateEnable(ids, false, user.getRootOrgId());
|
|
|
+ }
|
|
|
+ @GetMapping("page/{pageNo}/{pageSize}")
|
|
|
@ApiOperation(value = "项目列表分页查询")
|
|
|
- public PageInfo<ProjectBean> queryPage(@RequestBody QueryProjectPageReq req,
|
|
|
+ public PageInfo<ProjectBean> queryPage(@ModelAttribute QueryProjectPageReq req,
|
|
|
@PathVariable @ApiParam(value = "pageNo = 1,2,3...") Integer pageNo, @PathVariable Integer pageSize) {
|
|
|
User user=getAccessUser();
|
|
|
return projectService.queryPage(req, pageNo, pageSize,user.getRootOrgId());
|