package net.northking.cctp.platform.api.user;

import com.hzbank.testteam.autotest.dependencies.monsterDependency.dto.TestGroupDTO;
import io.swagger.annotations.ApiOperation;
import net.northking.cctp.platform.api.login.service.UserLoginService;
import net.northking.cctp.platform.api.user.service.UserApiService;
import net.northking.cctp.platform.dto.user.UserInfoFeignDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/pub")
@RestController
public class UserLoginFeignCtrl {

    @Autowired
    private UserLoginService userLoginService;
    @Autowired
    private UserApiService userApiService;

    @ApiOperation(value = "获取系统关联测试角色个数")
    @GetMapping(value = "/getUserInfo")
    public UserInfoFeignDto getUserInfo(@RequestParam("userId") String userId) {
        return userLoginService.getUserInfo(userId);
    }

    @ApiOperation(value = "获取用户关联的小组")
    @GetMapping(value = "/getPlanTeamInfo")
    public TestGroupDTO getPlanTeamInfo(@RequestParam("userId") String userId) {
        return userLoginService.getPlanTeamInfo(userId);
    }


    @ApiOperation(value = "获取用户姓名")
    @PostMapping(value = "/getName/")
    public String getUser(@RequestParam("operCode") String operCode) {
        return userApiService.queryUserInfoByCode(operCode);
    }


}
