You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.entity.TokenEntity;
import com.utils.PageUtils;
/**
* token
*/
public interface TokenService extends IService<TokenEntity> {
PageUtils queryPage(Map<String, Object> params);
//这是一个分页查询方法。它接收一个参数Map用于传递分页参数如当前页码、每页记录数和可能的查询条件。
//返回PageUtils对象这是一个自定义的分页工具类通常包含分页数据如记录列表、总记录数、总页数等
List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper);
//这个方法使用MyBatis-Plus的条件构造器Wrapper来查询符合条件的TokenEntity列表。
//与普通的查询列表不同,这个方法可能是为了支持一些特定的视图展示,或者是对查询结果进行某种处理(但具体实现需要看实现类)。
PageUtils queryPage(Map<String, Object> params,Wrapper<TokenEntity> wrapper);
//这也是一个分页查询方法但比第一个方法多了一个条件构造器参数。这样可以在分页的同时根据Wrapper中的条件进行筛选。
//同样返回PageUtils对象。
String generateToken(Long userid,String username,String tableName, String role);
//这个方法用于生成一个Token字符串。参数包括
//userid用户ID
//username用户名
//tableName表名可能表示该用户所属的表比如用户类型对应的表
//role用户角色
//通常Token的生成会结合这些用户信息以及一些加密算法和过期时间等。
TokenEntity getTokenEntity(String token);
//根据Token字符串获取对应的TokenEntity对象。
//这个方法可以用于验证Token的有效性并获取Token中存储的信息如用户ID、过期时间等
}