package com.persagy.labsl.controller.planar

import com.persagy.labsl.models.entities.pbs.PlanarQbsRule
import com.persagy.labsl.services.planar.PlanarQbsRuleService
import com.persagy.service.models.requests.SCreateRequest
import com.persagy.service.models.responses.SCreateResponse
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/12/13 9:30
 */
@Tag(name = "003、平面图 - 规则")
@RestController
@RequestMapping("/planar/rule")
class PlanarQbsRuleController {

    /**
     * 创建规则
     *
     * @param request     待创建对象列表
     * @return 创建完成规则对象列表
     */
    @Operation(summary ="创建规则", description = "id和graphId为必填，图中会包含多个节点，详细节点结构见示例")
    @PostMapping("/create")
    fun create(@RequestBody request: SCreateRequest<PlanarQbsRule>): SCreateResponse<PlanarQbsRule> {
        return PlanarQbsRuleService.createList(request)
    }


}