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


import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest;
import org.springframework.web.bind.annotation.RequestParam;

public interface AuthService {
    String login(JwtAuthenticationRequest authenticationRequest) throws Exception;
    String refresh(String oldToken) throws Exception;
    void validate(String token) throws Exception;
    JSONObject sendsms(String username, Integer type) throws Exception;
    JSONObject register(String username, String mobilecode, String  password) throws Exception;
    JSONObject wxregister( String  username, String mobilecode, String  password, String  nickname, String  headimgurl, String  openid, String  unionid, Integer  type,Integer  isQQ) throws Exception;
    JSONObject checkBindWechat(String username) throws Exception;
    JSONObject wxlogin(String openid,Integer isQQ) throws Exception;
    JSONObject tlogin(String username, String  password,String mobilecode,Integer  type) 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);
}
