package net.northking.cctp.dw.feign;

import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.entity.Environment;
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.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;
import java.util.Map;

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

    @ApiOperation(value = "获取系统关联测试角色个数")
    @PostMapping(value = "/pub/getRoleAmount/")
    public List<String> getRoleAmount(@RequestParam("tenantId") String tenantId);

    @ApiOperation(value = "获取用户信息")
    @GetMapping(value = "/pub/getUserInfo")
    public UserInfoRsp getUserInfo(@RequestParam("userId") String userId);

    @ApiOperation(value = "根据id查询环境名称")
    @PostMapping(value = "/pub/findEnvName")
    public ResultWrapper<Map<String, Environment>> findEnvName(@RequestBody List<String> ids);


    @ApiOperation(value = "获取用户关联的小组")
    @GetMapping(value = "/pub/getPlanTeamInfo")
    public CltTestTeamDto getPlanTeamInfo(@RequestParam("userId") String userId);


}
