package com.persagy.labsl.controller

import com.persagy.labsl.models.entities.tpt.GraphCategory
import com.persagy.labsl.models.request.GraphCategoryRequest
import com.persagy.labsl.services.GraphCategoryService
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/9/15 11:40
 */
@Tag(name = "005、系统图类型")
@RestController
@RequestMapping("/graph-category")
class GraphCategoryController {

    /**
     * 查询系统图类型信息
     *
     * @param request   查询条件
     * @return 查询结果
     */
   @Operation(summary = "查询系统图类型信息", description = "类型开关 true  获取所有 false 获取已有图形的类型")
    @PostMapping(value = ["/query"])
    fun graphCategoryQuery(@RequestBody request: GraphCategoryRequest): SQueryResponse<GraphCategory> {
        return GraphCategoryService.graphCategoryQuery(request)
    }

}