package com.sptg.permissions.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.PageBean;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.permissions.api.dto.AccountDto;
import com.sptg.permissions.api.dto.AccountRoleDto;
import com.sptg.permissions.api.entity.Account;
import com.sptg.permissions.api.entity.AccountRole;
import com.sptg.permissions.api.feigns.fallback.AccountRoleFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * title: AccountRoleFeign
 * package: com.sptg.permissions.api.feigns
 * description: 账号角色对外服务接口
 *
 *                  
 *                 
 */
@FeignClient(value = "smart-house-permissions",fallbackFactory = AccountRoleFeignFallbackFactory.class)
public interface AccountRoleFeign {

    /**
     * 功能描述: 根据角色Id查询，分页绑定的账号列表
     * @param pageBean 查询条件{ roleId，当前登陆用户,分页条件为必填 }
     * @return ResultBean<Page>
     *                  
     *                       
     */
    @PostMapping(value = "/account/role/pagingQuery")
    ResultBean<Page> pagingQuery(PageBean<AccountRole,AccountRoleDto> pageBean);

    /**
     * 功能描述: 分页获取账号列表,账号不含有指定的角色
     * @param pageBean 查询条件，默认查询当前用户所属机构下的用户列表
     * @return ResultBean<Account>
     *                  
     *                       
     */
    @PostMapping(value = "/account/role/pagingQueryAccountListByNotHaveRole")
    ResultBean<Page> pagingQueryAccountListByNotHaveRole(PageBean<Account,AccountDto> pageBean);

    /**
     * 功能描述: 绑定用户
     * @param dto { accountId:必填,roleId:必填 }
     * @return ResultBean<Boolean>
     *                  
     *                       
     */
    @PostMapping(value = "/account/role/bind")
    ResultBean<Boolean> bindUser(AccountRoleDto dto);

    /**
     * 功能描述: 解除用户绑定
     * @param dto { accountId:必填,accountIds:必填 }
     * @return ResultBean<Boolean>
     *                  
     *                       
     */
    @PostMapping(value = "/account/role/untie")
    ResultBean<Boolean> untieUser(AccountRoleDto dto);
}
