package net.northking.cctp.dw.feign;

import io.swagger.annotations.ApiOperation;
import net.northking.cctp.common.feign.FeignCctpConfig;
import net.northking.cctp.common.http.ResultWrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
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;
import java.util.Map;

/**
 * @author: puchao.ma
 * @date: 2021/10/25 15:17
 */
@FeignClient(contextId = "projectsFeignClient",value = "cctp-projects",name = "cctp-projects", path = "/cctp-projects", configuration = {FeignCctpConfig.class})
public interface ProjectsFeignClient {

    /**
     * 查询系统配置的缺陷终态
     *
     * @param dto 查询参数
     * @return 数据列表
     */
    @ApiOperation(value = "查询系统配置的缺陷终态")
    @PostMapping(value = "/v1/process/status/special",
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
            consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResultWrapper<List<String>> queryBugEndStatus(@RequestBody StatusRoleDto dto);

    @ApiOperation(value = "获取开始结束状态")
    @PostMapping(value = "/pub/process/status/special")
    public List<String> querySpecialState(@RequestBody StatusRoleDto statusRole);

    @ApiOperation(value = "获取系统关联的角色列表")
    @PostMapping(value = "/pub/getRoles/")
    public Map<String,Integer> getRoles(@RequestParam("projectIds") List<String> projectIds,@RequestParam("testRoleId") String testRoleId);

    @ApiOperation(value = "获取需求池中类型为缺陷修复率需求数量")
    @PostMapping(value = "/pub/CpDemandPlanAmount/")
    public Integer cpDemandPlanAmount(@RequestBody String tenantId);

    @ApiOperation(value = "获取系统id集合")
    @PostMapping(value = "/pub/queryProjectIds/")
    public List<String> queryProjectIds(@RequestBody String tenantId);

    @ApiOperation(value = "筛选掉已经删除的系统")
    @PostMapping(value = "/pub/filtersProjectIds/")
    public List<String> filtersProjectIds(@RequestParam("projectIds") List<String> projectIds);
}
