TokenService.java 654 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Copyright (c) 2016-2019 人人开源 All rights reserved.
  3. *
  4. * https://www.renren.io
  5. *
  6. * 版权所有,侵权必究!
  7. */
  8. package io.renren.service;
  9. import com.baomidou.mybatisplus.extension.service.IService;
  10. import io.renren.entity.TokenEntity;
  11. /**
  12. * 用户Token
  13. *
  14. * @author Mark sunlightcs@gmail.com
  15. */
  16. public interface TokenService extends IService<TokenEntity> {
  17. TokenEntity queryByToken(String token);
  18. /**
  19. * 生成token
  20. * @param userId 用户ID
  21. * @return 返回token信息
  22. */
  23. TokenEntity createToken(long userId);
  24. /**
  25. * 设置token过期
  26. * @param userId 用户ID
  27. */
  28. void expireToken(long userId);
  29. }