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.

47 lines
1.1 KiB

8 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(ctx context.Context, username string, password string) (string, error)
  12. }
  13. ITokenLogic interface {
  14. // ValidateToken 验证 JWT Token 的方法
  15. ValidateToken(ctx context.Context, tokenString string) (bool, error)
  16. }
  17. )
  18. var (
  19. localLoginLogic ILoginLogic
  20. localTokenLogic ITokenLogic
  21. )
  22. func LoginLogic() ILoginLogic {
  23. if localLoginLogic == nil {
  24. panic("implement not found for interface ILoginLogic, forgot register?")
  25. }
  26. return localLoginLogic
  27. }
  28. func RegisterLoginLogic(i ILoginLogic) {
  29. localLoginLogic = i
  30. }
  31. func TokenLogic() ITokenLogic {
  32. if localTokenLogic == nil {
  33. panic("implement not found for interface ITokenLogic, forgot register?")
  34. }
  35. return localTokenLogic
  36. }
  37. func RegisterTokenLogic(i ITokenLogic) {
  38. localTokenLogic = i
  39. }