user_auth.go 988 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package models
  2. type UserAuth struct {
  3. Id int64
  4. UserId int64
  5. AuthModule string
  6. AuthId string
  7. }
  8. type ExternalUserInfo struct {
  9. AuthModule string
  10. AuthId string
  11. UserId int64
  12. Email string
  13. Login string
  14. Name string
  15. OrgRoles map[int64]RoleType
  16. }
  17. // ---------------------
  18. // COMMANDS
  19. type UpsertUserCommand struct {
  20. ExternalUser *ExternalUserInfo
  21. SignupAllowed bool
  22. User *User
  23. }
  24. type SetAuthInfoCommand struct {
  25. AuthModule string
  26. AuthId string
  27. UserId int64
  28. }
  29. type DeleteAuthInfoCommand struct {
  30. UserAuth *UserAuth
  31. }
  32. // ----------------------
  33. // QUERIES
  34. type LoginUserQuery struct {
  35. Username string
  36. Password string
  37. User *User
  38. IpAddress string
  39. }
  40. type GetUserByAuthInfoQuery struct {
  41. AuthModule string
  42. AuthId string
  43. UserId int64
  44. Email string
  45. Login string
  46. User *User
  47. UserAuth *UserAuth
  48. }
  49. type GetAuthInfoQuery struct {
  50. AuthModule string
  51. AuthId string
  52. UserAuth *UserAuth
  53. }