|
@@ -0,0 +1,75 @@
|
|
|
+package com.persagy.meiku.controller
|
|
|
+
|
|
|
+import com.persagy.meiku.models.entities.PipelineCategory
|
|
|
+import com.persagy.meiku.services.PipelineCategoryService
|
|
|
+import com.persagy.service.models.requests.SCreateRequest
|
|
|
+import com.persagy.service.models.requests.SQueryRequest
|
|
|
+import com.persagy.service.models.requests.SUpdateRequest
|
|
|
+import com.persagy.service.models.responses.SBaseResponse
|
|
|
+import com.persagy.service.models.responses.SCreateResponse
|
|
|
+import com.persagy.service.models.responses.SQueryResponse
|
|
|
+import io.swagger.v3.oas.annotations.Operation
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag
|
|
|
+import org.springframework.web.bind.annotation.PostMapping
|
|
|
+import org.springframework.web.bind.annotation.RequestBody
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping
|
|
|
+import org.springframework.web.bind.annotation.RestController
|
|
|
+
|
|
|
+/**
|
|
|
+ * 管线接口
|
|
|
+ * @author wx <zhangweixin@sagacloud.com>
|
|
|
+ * @date 2020/11/5 10:12
|
|
|
+ */
|
|
|
+@Tag(name = "005、管线类型")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/pipeline")
|
|
|
+class PipelineController {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 管线
|
|
|
+ *
|
|
|
+ * @param request 待创建管线
|
|
|
+ * @return 创建完成管线
|
|
|
+ */
|
|
|
+ @Operation(summary="创建管线", description ="id 为 32 位 uuid")
|
|
|
+ @PostMapping("/create")
|
|
|
+ fun create(@RequestBody request: SCreateRequest<PipelineCategory>): SCreateResponse<PipelineCategory> {
|
|
|
+ return PipelineCategoryService.createList(request)
|
|
|
+ } // Function create()
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据id删除管线
|
|
|
+ *
|
|
|
+ * @param idList id数组
|
|
|
+ * @return 删除的结果信息
|
|
|
+ */
|
|
|
+ @Operation(summary = "根据id删除管线", description = "")
|
|
|
+ @PostMapping(value = ["/delete"])
|
|
|
+ fun delete(@RequestBody idList: ArrayList<PipelineCategory>): SBaseResponse {
|
|
|
+ return PipelineCategoryService.deleteByKeysList(idList)
|
|
|
+ } // Function delete()
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新管线
|
|
|
+ *
|
|
|
+ * @param request 更新的内容对象
|
|
|
+ * @return 更新的结果
|
|
|
+ */
|
|
|
+ @Operation(summary = "更新管线", description = "")
|
|
|
+ @PostMapping(value = ["/update"])
|
|
|
+ fun update(@RequestBody request: SUpdateRequest<PipelineCategory>): SBaseResponse {
|
|
|
+ return PipelineCategoryService.updateList(request)
|
|
|
+ } // Function update()
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询管线
|
|
|
+ *
|
|
|
+ * @return 查询结果
|
|
|
+ */
|
|
|
+ @Operation(summary = "查询管线", description = "")
|
|
|
+ @PostMapping(value = ["/query"])
|
|
|
+ fun query(): SQueryResponse<PipelineCategory> {
|
|
|
+ return PipelineCategoryService.categoryQuery()
|
|
|
+ } // Function query()
|
|
|
+
|
|
|
+}
|