package cn.iocoder.yudao.module.smartfactory.api.staff;


import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.smartfactory.api.staff.dto.StaffDTO;
import cn.iocoder.yudao.module.smartfactory.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 厂区员工")
public interface StaffApi {

    String PREFIX = ApiConstants.PREFIX + "/staff";

    @GetMapping(PREFIX + "/get")
    @Operation(summary = "获得员工信息")
    CommonResult<StaffDTO> getStaff(@RequestParam("staffId") Long staffId);

    @GetMapping(PREFIX + "/get-list")
    @Operation(summary = "获得员工信息")
    @Parameter(name = "staffIds", description = "员工编号数组", required = true, example = "1,2,3")
    CommonResult<List<StaffDTO>> getStaffList(@RequestParam("staffIds") Collection<Long> staffId);

    @GetMapping(PREFIX + "/getByUserId")
    @Operation(summary = "根据系统用户编号获得员工信息")
    @Parameter(name = "userId", description = "系统用户编号", required = true, example = "1")
    CommonResult<StaffDTO> getStaffByUserId(@RequestParam("userId") Long userId);
}
