package ink.wgink.interfaces.manager;

import ink.wgink.exceptions.TokenException;
import ink.wgink.pojo.app.AppToken;
import ink.wgink.pojo.app.AppTokenUser;

import java.util.List;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IAppManager
 * @Description: app管理
 * @Author: wanggeng
 * @Date: 2021/3/1 4:33 下午
 * @Version: 1.0
 */
public interface IAppManager {

    /**
     * 获取AppToken对象
     *
     * @param token token 字符串
     * @return
     */
    AppToken getToken(String token);

    /**
     * 解析 token 串为 AppTokenUser 对象
     *
     * @param token token 字符串
     * @return
     * @throws TokenException
     */
    AppTokenUser parseToAppTokenUser(String token) throws TokenException;

    /**
     * 当前用户列表
     *
     * @return
     */
    List<AppTokenUser> listCurrentUsers();

    /**
     * 设置redis token 管理器
     *
     * @param appTokenService
     */
    void setAppTokenService(IAppTokenService appTokenService);
}
