package com.github.wxiaoqi.security.auth.service;


import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;

public interface AuthService {
    String login(JwtAuthenticationRequest authenticationRequest) throws Exception;
    ObjectRestResponse loginSmall(JwtAuthenticationRequest authenticationRequest) throws Exception;
    String refresh(String oldToken) throws Exception;
    void validate(String token) throws Exception;
    JSONObject sendsms(String username, Integer type, String pointList) throws Exception;
    JSONObject register(String username, String mobilecode, String  password,String code,Integer channel) throws Exception;
    JSONObject wxregister( String  username, String mobilecode, String  password, String  nickname, String  headimgurl, String  openid, String  unionid, Integer  type,Integer  isQQ,String code,Integer channel) throws Exception;
    JSONObject checkBindWechat(String username) throws Exception;
    JSONObject wxlogin(String openid,Integer isQQ,String code) throws Exception;
    JSONObject tlogin(String username, String  password,String mobilecode,Integer  type,String code) throws Exception;
    String getToken(String username,Integer id) throws Exception;
    JSONObject reset(String username, String mobilecode, String  password) throws Exception;

    /**
     * 使用用户id登录 Unbelievable ! ! !
     * @param userid
     * @return
     */
    JSONObject appletLoginByUserId(Integer userid);

    /**
     * 通过小程序注册
     * @param username
     * @param headimgurl
     * @param nickname
     * @return
     */
    JSONObject appletRegistry(String username,String headimgurl,String nickname,Integer  userid);

    String loginImiWithToken();

    ObjectRestResponse checkToken(String token);

    ObjectRestResponse updUsername(String username, String mobilecode, String token);
}
