|
@@ -5,6 +5,7 @@ import com.persagy.labsl.Opts
|
|
|
import com.persagy.labsl.models.entities.tpt.Graph
|
|
|
import com.persagy.labsl.models.entities.tpt.pub.GraphPub
|
|
|
import com.persagy.labsl.models.response.SCommonResponse
|
|
|
+import com.persagy.labsl.services.GraphLogicService
|
|
|
import com.persagy.labsl.services.GraphService
|
|
|
import com.persagy.labsl.services.pub.GraphPubService
|
|
|
import com.persagy.service.models.requests.SCreateRequest
|
|
@@ -15,7 +16,10 @@ 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.*
|
|
|
+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
|
|
|
|
|
|
/**
|
|
|
* 图形
|
|
@@ -27,16 +31,18 @@ import org.springframework.web.bind.annotation.*
|
|
|
@RequestMapping("/graph")
|
|
|
class GraphController {
|
|
|
|
|
|
+ lateinit var graphLogicService: GraphLogicService
|
|
|
+
|
|
|
/**
|
|
|
* 创建图
|
|
|
*
|
|
|
* @param request 待图对象列表
|
|
|
* @return 创建完成图对象列表
|
|
|
*/
|
|
|
- @Operation(summary ="草稿箱-创建图", description = "id和graphId为必填,图中会包含多个节点,详细节点结构见示例")
|
|
|
+ @Operation(summary ="草稿箱-创建图", description = "id和graphId为必填,图中会包含多个节点,详细节点结构见示例")
|
|
|
@PostMapping("/drafts/create")
|
|
|
fun create(@RequestBody request: SCreateRequest<Graph>): SCreateResponse<Graph> {
|
|
|
- return GraphService.draftsCreate(request)
|
|
|
+ return graphLogicService.draftsCreate(request)
|
|
|
} // Function create()
|
|
|
|
|
|
/**
|
|
@@ -45,10 +51,10 @@ class GraphController {
|
|
|
* @param graph 待图对象
|
|
|
* @return 图对象列表
|
|
|
*/
|
|
|
- @Operation(summary = "草稿箱-保存图形", description = "")
|
|
|
+ @Operation(summary = "草稿箱-保存图形", description = "")
|
|
|
@PostMapping("/drafts/save")
|
|
|
fun save(@RequestBody graph: Graph): SCreateResponse<Graph> {
|
|
|
- return GraphService.save(graph)
|
|
|
+ return graphLogicService.save(graph)
|
|
|
} // Function save()
|
|
|
|
|
|
/**
|
|
@@ -60,7 +66,7 @@ class GraphController {
|
|
|
@Operation(summary="草稿箱-发布图形", description =" Id 和 GraphId 必须填写")
|
|
|
@PostMapping("/drafts/publish")
|
|
|
fun pubDrawings(@RequestBody graph: GraphPub): SCreateResponse<GraphPub>{
|
|
|
- return GraphService.pubDrawings(graph)
|
|
|
+ return graphLogicService.pubDrawings(graph)
|
|
|
} // Function pubDrawings()
|
|
|
|
|
|
|
|
@@ -73,7 +79,7 @@ class GraphController {
|
|
|
@Operation(summary = "草稿箱-移至回收站", description = " Id 和 GraphId 必填")
|
|
|
@PostMapping(value = ["/drafts/recycle"])
|
|
|
fun recycle(@RequestBody idList: ArrayList<Graph>): SBaseResponse {
|
|
|
- return GraphService.recycle(idList)
|
|
|
+ return graphLogicService.recycle(idList)
|
|
|
} // Function recycle()
|
|
|
|
|
|
/**
|
|
@@ -85,7 +91,7 @@ class GraphController {
|
|
|
@Operation(summary = "已发布-图形移至回收站", description = "Id 和 GraphId 必填")
|
|
|
@PostMapping(value = ["/pub/recycle"])
|
|
|
fun recyclePub(@RequestBody idList: ArrayList<Graph>): SBaseResponse{
|
|
|
- return GraphService.recyclePub(idList)
|
|
|
+ return graphLogicService.recyclePub(idList)
|
|
|
} // Function recyclePub()
|
|
|
|
|
|
/**
|
|
@@ -97,7 +103,7 @@ class GraphController {
|
|
|
@Operation(summary = "草稿箱-更新图形信息", description = "Id 和 GraphId 必填")
|
|
|
@PostMapping(value = ["/drafts/update"])
|
|
|
fun update(@RequestBody request: SUpdateRequest<Graph>): SBaseResponse {
|
|
|
- return GraphService.draftsUpdate(request)
|
|
|
+ return graphLogicService.draftsUpdate(request)
|
|
|
} // Function update()
|
|
|
|
|
|
/**
|
|
@@ -157,7 +163,7 @@ class GraphController {
|
|
|
@Operation(summary = "已发布-更新图形信息", description = "")
|
|
|
@PostMapping(value = ["/pub/update"])
|
|
|
fun updatePub(@RequestBody request: SUpdateRequest<GraphPub>): SBaseResponse {
|
|
|
- return GraphService.pubUpdate(request)
|
|
|
+ return graphLogicService.pubUpdate(request)
|
|
|
} // Function update()
|
|
|
|
|
|
/**
|
|
@@ -166,10 +172,10 @@ class GraphController {
|
|
|
* @param graph 图对象
|
|
|
* @return 恢复结果
|
|
|
*/
|
|
|
- @Operation(summary = "回收站- 恢复图形", description = "Id 和 GraphId 必填 ")
|
|
|
+ @Operation(summary = "回收站- 恢复图形", description = "Id 和 GraphId 必填 ")
|
|
|
@PostMapping(value = ["recycle/recovery"])
|
|
|
fun recovery(@RequestBody graph: Graph): SBaseResponse{
|
|
|
- return GraphService.recovery(graph)
|
|
|
+ return graphLogicService.recovery(graph)
|
|
|
} // Fun recovery()
|
|
|
|
|
|
/**
|
|
@@ -181,7 +187,7 @@ class GraphController {
|
|
|
@Operation(summary = "回收站-根据id删除图形信息,删除草稿箱图形", description = "Id 和 GraphId 必填 ")
|
|
|
@PostMapping(value = ["recycle/delete"])
|
|
|
fun delete(@RequestBody idList: ArrayList<Graph>): SBaseResponse {
|
|
|
- return GraphService.deleteByKeysList(idList)
|
|
|
+ return graphLogicService.deleteByKeysList(idList)
|
|
|
} // Function delete()
|
|
|
|
|
|
|