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.

34 lines
912 B

5 months ago
5 months ago
5 months ago
  1. // ================================================================================
  2. // Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
  3. // You can delete these comments if you wish manually maintain this interface file.
  4. // ================================================================================
  5. package service
  6. import (
  7. "context"
  8. )
  9. type (
  10. ILoginLogic interface {
  11. // Login 方法实现用户登录并生成 Token
  12. Login(ctx context.Context, username string, password string) (string, error)
  13. // ValidateToken 验证 Token 是否有效
  14. ValidateToken(ctx context.Context, tokenString string) (bool, error)
  15. }
  16. )
  17. var (
  18. localLoginLogic ILoginLogic
  19. )
  20. func LoginLogic() ILoginLogic {
  21. if localLoginLogic == nil {
  22. panic("implement not found for interface ILoginLogic, forgot register?")
  23. }
  24. return localLoginLogic
  25. }
  26. func RegisterLoginLogic(i ILoginLogic) {
  27. localLoginLogic = i
  28. }