package com.persagy.server.syn.controllers.dict

import com.persagy.server.syn.services.dict.DClassDefService
import com.persagy.service.models.responses.SBaseResponse
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController

/**
 *
 */
@Tag(name = "0004、字典-手动更新需采集信息")
@RestController
@RequestMapping("/dict/gather")
class DictGatherControllers {

    /**
     * 平台字典 详细信息点
     */
    @Operation(summary = "001、平台字典对象信息点-存入数据中心", description = "")
    @GetMapping(value = ["/dict-platform-info"])
    fun dictPlatformInfo(): SBaseResponse {
        return DClassDefService.dictPlatformInfoGather()
    }

    /**
     * 平台字典 详细信息点
     */
    @Operation(summary = "001、平台字典对象信息点-存入数据中心-制定类型更新", description = "")
    @GetMapping(value = ["/dict-platform-info-code"])
    fun dictPlatformInfoCode(@RequestParam code: String): SBaseResponse {
        return DClassDefService.dictPlatformInfoGatherCode(code)
    }

    /**
     * 同步项目字典
     */
    @Operation(summary = "同步项目字典", description = "sign开关，true 所有项目")
    @GetMapping(value = ["/dict/code/syn"])
    fun dictSynCode(@RequestParam groupCode: String,@RequestParam projectId: String,sign: Boolean = false): SBaseResponse {
        return DClassDefService.synCodeProject(groupCode,projectId,sign)
    }


}