1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-21 01:10:39 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
bookshelfplus/bookshelfplus/src/main/java/plus/bookshelf/Service/Service/UserService.java

51 lines
1.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package plus.bookshelf.Service.Service;
import org.springframework.data.redis.core.RedisTemplate;
import plus.bookshelf.Common.Error.BusinessException;
import plus.bookshelf.Service.Model.UserModel;
public interface UserService {
/**
* 用户登录
*
* @param username 用户名
* @param encryptPwd 加密后密码
*/
UserModel userLogin(String username, String encryptPwd);
/**
* 通过用户Id获取用户
*
* @param id 用户Id
* @return UserModel
*/
UserModel getUserById(Integer id);
/**
* 检查用户令牌是否有效,并返回令牌对应的用户 UserModel
* (令牌无效直接抛出异常)
*
* @param token 用户令牌
* @return UserModel
*/
UserModel getUserByToken(RedisTemplate redisTemplate, String token) throws BusinessException;
/**
* 用户注册
*
* @param username 用户名
* @param encryptPwd 加密后密码
* @return 注册成功返回true否则返回false
*/
Boolean userRegister(String username, String encryptPwd) throws BusinessException;
/**
* 账号注销
*
* @param userModel
* @return
* @throws BusinessException
*/
Boolean cancelAccount(UserModel userModel) throws BusinessException;
}