package com.fjhx.feign;

import com.fjhx.constants.ClientConstant;
import org.springblade.core.tool.api.R;
import org.springblade.system.user.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 用户 Feign接口类
 */
@FeignClient(value = "blade-ex")
public interface IUserClient {

    String GET_USER_LIST_BY_ROLE_ID_LIST = ClientConstant.API_PREFIX + "/getUserListByRoleIdList";
    String GET_USER_LIST_BY_DEPT_ID_LIST = ClientConstant.API_PREFIX + "/getUserListByDeptIdList";

    /**
     * 根据角色id列表获取用户列表
     *
     * @param roleIdList 角色id List
     */
    @PostMapping(GET_USER_LIST_BY_ROLE_ID_LIST)
    R<List<User>> getUserListByRoleIdList(@RequestBody List<Long> roleIdList);

    /**
     * 根据部门id列表获取用户列表
     *
     * @param deptIdList 部门id List
     */
    @PostMapping(GET_USER_LIST_BY_DEPT_ID_LIST)
    R<List<User>> getUserListByDeptIdList(@RequestBody List<Long> deptIdList);

}
