|
@@ -0,0 +1,61 @@
|
|
|
+package com.aizuda.boot.flw.controller;
|
|
|
+
|
|
|
+import com.aizuda.core.api.ApiController;
|
|
|
+import com.aizuda.core.api.PageParam;
|
|
|
+import com.aizuda.core.validation.Create;
|
|
|
+import com.aizuda.core.validation.Update;
|
|
|
+import com.aizuda.boot.flw.entity.FlwCategory;
|
|
|
+import com.aizuda.boot.flw.service.IFlwCategoryService;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.validation.constraints.NotEmpty;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 流程分类 前端控制器
|
|
|
+ *
|
|
|
+ * @author 青苗
|
|
|
+ * @since 2023-07-22
|
|
|
+ */
|
|
|
+@Tag(name = "流程分类")
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/category")
|
|
|
+public class FlwCategoryController extends ApiController {
|
|
|
+ private IFlwCategoryService flwCategoryService;
|
|
|
+
|
|
|
+ @Operation(summary = "分页列表")
|
|
|
+ @PostMapping("/page")
|
|
|
+ public Page<FlwCategory> getPage(@RequestBody PageParam<FlwCategory> dto) {
|
|
|
+ return flwCategoryService.page(dto.page(), dto.getData());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "查询 id 信息")
|
|
|
+ @GetMapping("/get")
|
|
|
+ public FlwCategory get(@RequestParam Long id) {
|
|
|
+ return flwCategoryService.getById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "根据 id 修改信息")
|
|
|
+ @PostMapping("/update")
|
|
|
+ public boolean update(@Validated(Update.class) @RequestBody FlwCategory flwCategory) {
|
|
|
+ return flwCategoryService.updateById(flwCategory);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "创建添加")
|
|
|
+ @PostMapping("/create")
|
|
|
+ public boolean create(@Validated(Create.class) @RequestBody FlwCategory flwCategory) {
|
|
|
+ return flwCategoryService.save(flwCategory);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "根据 ids 删除")
|
|
|
+ @PostMapping("/delete")
|
|
|
+ public boolean delete(@NotEmpty @RequestBody List<Long> ids) {
|
|
|
+ return flwCategoryService.removeByIds(ids);
|
|
|
+ }
|
|
|
+}
|