package com.crunii.micro.service.sysmgr.api.worker;

import com.crunii.micro.common.dto.Result;
import com.crunii.micro.service.sysmgr.api.domain.dto.OrgNode;
import com.crunii.micro.service.sysmgr.api.domain.dto.worker.WorkerRoleVo;
import com.crunii.micro.service.sysmgr.api.factory.OrgTreeAuthorityFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
/**
 * @author gongsongtao
 * @date 2023/9/27 15:01
 */
@FeignClient(value = "service-sysmgr", fallbackFactory = OrgTreeAuthorityFallbackFactory.class)
public interface TsmWorkerClient {

    @ApiOperation(value = "查询用户所属角色")
    @RequestMapping(path = "/auth/WorkerController/getRoleListByWorkerId", method = RequestMethod.GET)
    Result<List<WorkerRoleVo>> getRoleListByWorkerId(@RequestParam("workerId") Long workerId);

    @ApiOperation("查询用户所属组织")
    @RequestMapping(path = "/auth/WorkerController/getOrgListByWorkerId", method = RequestMethod.GET)
    Result<List<OrgNode>> getOrgListByWorkerId(@RequestParam("workerId") Long workerId);

}
