package ink.wgink.login.oauth2.client.remote.role;

import ink.wgink.annotation.rpc.rest.RemoteService;
import ink.wgink.annotation.rpc.rest.method.RemoteGetMethod;
import ink.wgink.annotation.rpc.rest.method.RemotePostMethod;
import ink.wgink.annotation.rpc.rest.params.*;
import ink.wgink.pojo.dtos.role.RoleUserDTO;
import ink.wgink.pojo.pos.RolePO;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.pojo.vos.IdsVO;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: IRoleUserRemoteService
 * @Description: 角色用户调用
 * @Author: wanggeng
 * @Date: 2021/9/22 10:45 下午
 * @Version: 1.0
 */
@RemoteService("/resource/role/user")
public interface IRoleUserRemoteService {

    @RemoteGetMethod("/list-userid/role-id/{roleId}")
    List<String> listUserIdByRoleId(@RemoteServerParams String userCenter, @RemotePathParams("roleId") String roleId, @RemoteQueryParams("access_token") String accessToken);

    @RemotePostMethod("/list-userid/role-ids")
    List<String> listUserIdByRoleIds(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);

    @RemoteGetMethod("/listpage/{roleId}")
    SuccessResultList<List<RoleUserDTO>> listPage(@RemoteServerParams String userCenter, @RemotePathParams("roleId") String roleId, @RemoteQueryParams("access_token") String accessToken, @RemoteQueryParams("page") int page, @RemoteQueryParams("rows") int rows, @RemoteQueryParamsMap Map<String, Object> params);

    @RemoteGetMethod("/list-role-po/userid/{userId}")
    List<RolePO> listRolePOByUserId(@RemoteServerParams String userCenter, @RemotePathParams("userId") String userId, @RemoteQueryParams("access_token") String accessToken);

    @RemotePostMethod("/list-user-id/role-id/{roleId}/user-ids")
    List<String> listUserIdByRoleIdAndUserIds(@RemoteServerParams String userCenter, @RemotePathParams("roleId") String roleId, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);
}
