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.AccountOauthDto;
import com.sptg.permissions.api.entity.Account;
import com.sptg.permissions.api.entity.AccountOauth;
import com.sptg.permissions.api.feigns.fallback.AccountOauthFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

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

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

    /**
     * 功能描述: 获取单个授权用户
     * @param dto { accountId:必填,roleId:必填 }
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/account/oauth/getByUuIdAndSource")
    ResultBean<AccountOauth> getByUuIdAndSource(AccountOauthDto dto);


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

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