package cn.iocoder.yudao.module.basic.api.workersinfo;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.basic.api.workersinfo.dto.WorkersInfoRespDTO;
import cn.iocoder.yudao.module.basic.enums.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.security.PermitAll;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Api(tags = "RPC 服务 - 员工")
public interface WorkersinfoApi {

    String PREFIX = ApiConstants.PREFIX + "/workers-info";

    @GetMapping(PREFIX + "/get")
    @ApiOperation("获得员工")
    @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
    public CommonResult<WorkersInfoRespDTO> getWorkersInfo(@RequestParam("id") Long id);

    @GetMapping(PREFIX + "/getWorkersInfoWithOutTenantId")
    @PermitAll // 无需登陆
    @ApiOperation("获得员工")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "businessInfoId", value = "商户ID", required = true, example = "1024", dataTypeClass = Long.class),
        @ApiImplicitParam(name = "openid", value = "openid", required = true, example = "1a02dr4", dataTypeClass = String.class)
    })
    CommonResult<WorkersInfoRespDTO> getWorkersInfoWithOutTenantId(@RequestParam("businessInfoId") Long businessInfoId, @RequestParam("openid") String openid);
}
