|
@@ -0,0 +1,74 @@
|
|
|
+package com.migao.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.migao.config.response.PageBean;
|
|
|
+import com.migao.config.response.ResponseBean;
|
|
|
+import com.migao.config.validation.Insert;
|
|
|
+import com.migao.config.validation.Update;
|
|
|
+
|
|
|
+import com.migao.entity.vo.req.ProjectTypeInsertReq;
|
|
|
+import com.migao.entity.vo.req.ProjectTypePageQueryReq;
|
|
|
+import com.migao.entity.vo.req.ProjectTypeQueryReq;
|
|
|
+import com.migao.entity.vo.req.ProjectTypeUpdateReq;
|
|
|
+import com.migao.entity.vo.res.ProjectTypeQueryRes;
|
|
|
+import com.migao.service.ProjectTypeService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Api(tags = "001.用户")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/permission")
|
|
|
+public class ProjectTypeController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ProjectTypeService projectTypeService;
|
|
|
+
|
|
|
+ @ApiOperation("增")
|
|
|
+ @PostMapping(value = "/insert")
|
|
|
+ public ResponseBean<?> insert(
|
|
|
+ @Validated(value = {Insert.class}) @RequestBody ProjectTypeInsertReq projectTypeInsertReq
|
|
|
+ ) {
|
|
|
+ return projectTypeService.insert(projectTypeInsertReq);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("删")
|
|
|
+ @PostMapping(value = "/deleteById")
|
|
|
+ public ResponseBean<?> deleteById(
|
|
|
+ @RequestParam Integer id
|
|
|
+ ) {
|
|
|
+ return projectTypeService.deleteById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("删")
|
|
|
+ @PostMapping(value = "/deleteBatch")
|
|
|
+ public ResponseBean<?> deleteBatch(
|
|
|
+ @RequestBody List<Integer> ids
|
|
|
+ ) {
|
|
|
+ return projectTypeService.deleteBatch(ids);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("改")
|
|
|
+ @PostMapping(value = "/update")
|
|
|
+ public ResponseBean<?> update(
|
|
|
+ @Validated(value = {Update.class}) @RequestBody ProjectTypeUpdateReq projectTypeUpdateReq
|
|
|
+ ) {
|
|
|
+ return projectTypeService.update(projectTypeUpdateReq);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("分页查")
|
|
|
+ @PostMapping(value = "/pageQuery")
|
|
|
+ public ResponseBean<PageBean<ProjectTypeQueryRes>> pageQuery(
|
|
|
+ @RequestBody ProjectTypePageQueryReq projectTypePageQueryReq
|
|
|
+ ) {
|
|
|
+ return projectTypeService.pageQuery(projectTypePageQueryReq);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|