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

import com.alibaba.fastjson.JSONObject;
import com.hzbank.testteam.autotest.dependencies.monsterDependency.dto.ProjectDTO;
import com.hzbank.testteam.autotest.dependencies.monsterDependency.dto.SystemDTO;
import com.hzbank.testteam.autotest.dependencies.monsterDependency.dto.UserDTO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.northking.cctp.common.feign.FeignCctpConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

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

@FeignClient(name = "monster-common", configuration = {FeignCctpConfig.class})
public interface HzBankFeign {

    @ApiOperation(value = "获取雪狼项目信息", notes = "获取雪狼项目信息")
    @GetMapping(value = "/monster-common/api/project/optionList",
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
            consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    List<ProjectDTO> getProjectOptionList();


    @ApiOperation(value = "获取系统信息通过系统ID", notes = "获取系统信息通过系统ID")
    @GetMapping(value = "/monster-common/api/system-user-role/getProjectIdsByUserId/{userId}")
    List<Long> getProjectIdsByUserId(@ApiParam("用户ID") @PathVariable("userId") Long userId);

    @ApiOperation(value = "获取系统信息通过系统ID", notes = "获取系统信息通过系统ID")
    @PostMapping(value = "/monster-common/api/system/getActiveProjectByIds")
    List<SystemDTO> getActiveProjectByIds(@RequestBody List<Long> projectIds);


    @ApiOperation(value = "根据id获取系统信息", notes = "根据id获取系统信息")
    @PostMapping(value = "/monster-common/api/system/selectOneByMap")
    SystemDTO selectOneByMap(@RequestBody JSONObject jsonObject);

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