session.go 800 B

123456789101112131415161718192021222324252627282930313233
  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. "jyOrderManager/internal/model"
  9. )
  10. type (
  11. ISession interface {
  12. GetUser(ctx context.Context) *model.User
  13. //CreateSession(ctx context.Context, phone, openid, unionid, miniprogramCode string) int
  14. }
  15. )
  16. var (
  17. localSession ISession
  18. )
  19. func Session() ISession {
  20. if localSession == nil {
  21. panic("implement not found for interface ISession, forgot register?")
  22. }
  23. return localSession
  24. }
  25. func RegisterSession(i ISession) {
  26. localSession = i
  27. }