package net.northking.cctp.platform.bus.feign;

import com.hzbank.testteam.autotest.dependencies.monsterDependency.dto.TestGroupDTO;
import com.hzbank.testteam.autotest.dependencies.monsterDependency.dto.UserDTO;
import com.hzbank.testteam.autotest.dependencies.monsterDependency.vo.ResponseVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.northking.cctp.common.feign.FeignCctpConfig;
import net.northking.cctp.platform.dto.bus.DictItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "monster-common", configuration = {FeignCctpConfig.class})
public interface HzBankFeign {
    /**
     * 根据用户id获取测试小组信息
     *
     * @return 测试小组信息
     */
    @ApiOperation(value = "根据用户id获取测试小组信息",notes = "根据用户id获取测试小组信息")
    @RequestMapping(value = "/monster-common/api/test-group/getInfoByUserId/{userId}")
    TestGroupDTO getInfoByUserId(@ApiParam("用户ID") @PathVariable("userId") Long userId);

    /**
     * 根据雪狼账号获取用户名称
     * @param operCode 雪狼账号
     * @return 用户名称
     */
    @ApiOperation(value = "根据名称获取编码简称",notes = "根据名称获取编码简称")
    @RequestMapping(value = "/monster-common/api/user/getNameByOperCode/{operCode}", method = RequestMethod.GET)
    String getNameByOperCode(@ApiParam("雪狼账号") @PathVariable("operCode") String operCode);

    /**
     * 根据条件获取用户
     *
     * @param params
     * @return
     */
    @ApiOperation(value = "根据条件获取用户", notes = "根据条件获取用户详情")
    @PostMapping(value = "/monster-common/api/user/selectOneByMap")
    UserDTO selectOneByMap(@RequestBody Map<String, Object> params);

    /**
     * 根据条件获取用户列表
     *
     * @param params
     * @return
     */
    @ApiOperation("根据条件获取用户列表")
    @PostMapping(value = "/monster-common/api/user/selectByMap")
    List<UserDTO> selectByMap(@RequestBody Map<String, Object> params);

    /**
     * 根据用户id获取用户基础信息
     *
     * @param id
     * @return
     */
    @ApiOperation("根据用户id获取用户基础信息")
    @GetMapping(value = "/monster-common/api/user/getUserById/{id}")
    UserDTO getUserById(@ApiParam("用户id")@PathVariable("id") Long id);

    @ApiOperation("根据字段编码获取字典项")
    @GetMapping(value = "/monster-common/api/dic-item/findItemListByCatalogCode/{catalogCode}")
    ResponseVO<List<DictItem>> getDictItemByCode(@ApiParam("字典编码catalogCode")@PathVariable("catalogCode") String catalogCode);
}
