package cn.ey.biz.module.system.api.contract;

import cn.ey.biz.common.pojo.PageParam;
import cn.ey.biz.common.pojo.PageResult;
import cn.ey.biz.common.pojo.R;
import cn.ey.biz.module.system.api.contract.dto.ContractArchivedDTO;
import cn.ey.biz.module.system.api.contract.dto.ContractFieldDTO;
import cn.ey.biz.module.system.api.contract.dto.ContractSaveDTO;
import cn.ey.biz.module.system.api.contract.dto.ContractTypeDTO;
import cn.ey.biz.module.system.enums.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = ApiConstants.NAME)
@Api(tags = "RPC 服务 - 合同配置信息获取接口")
public interface ContractApi {
    String PREFIX = ApiConstants.PREFIX + "/contract";

    @GetMapping(PREFIX + "/types")
    @ApiOperation("获得启用的项目类型")
    R<List<ContractTypeDTO>> getTypes(@RequestParam("sl") String sl);

    @PostMapping(PREFIX + "/archived/fields")
    @ApiOperation("获得项目归档字段")
    R<List<ContractFieldDTO>> getContractArchivedFields(@RequestBody ContractFieldDTO info);

    @PostMapping(PREFIX + "/archived/ep")
    @ApiOperation("获得项目归档复核信息")
    R<ContractArchivedDTO> getContractArchivedEp(@RequestBody ContractArchivedDTO info);

    @GetMapping(PREFIX + "/get/sl")
    @ApiOperation("根据name获取sl")
    R<List<String>> getSl(@RequestParam("name") String name);

    @GetMapping(PREFIX + "/page")
    @ApiOperation("根据类型获得分页内容")
    R<PageResult<?>> getContractPage(@RequestBody ContractSaveDTO<PageParam> page);

}
