user.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.com.
  3. package v1
  4. import (
  5. "xingjia-management-gateway/apis"
  6. "xingjia-management-gateway/param/base"
  7. )
  8. type LoginBody struct {
  9. User string `form:"user"`
  10. Password string `form:"password"`
  11. }
  12. type LoginRequest struct {
  13. base.Header
  14. LoginBody
  15. }
  16. type LoginData struct {
  17. Uid int64 `json:"uid"`
  18. Token string `json:"token"`
  19. User string `json:"user"`
  20. UserType int32 `json:"user_type"`
  21. }
  22. type LoginResponse struct {
  23. base.Result
  24. Data LoginData `json:"data"`
  25. }
  26. type TokenRequest struct {
  27. base.Header
  28. }
  29. type TokenResponse struct {
  30. base.Result
  31. Data string `json:"data"`
  32. RefreshToken string `json:"refresh_token"`
  33. }
  34. type UserAddBody struct {
  35. User string `form:"user" json:"user"`
  36. Password string `form:"password" json:"password"`
  37. RealName string `form:"real_name" json:"real_name"`
  38. UserType int32 `form:"user_type" json:"user_type"`
  39. EffectiveStart int64 `form:"effective_start" json:"effective_start"`
  40. EffectiveEnd int64 `form:"effective_end" json:"effective_end"`
  41. }
  42. type UserAddRequest struct {
  43. base.Header
  44. UserAddBody
  45. }
  46. type UserAddResponse struct {
  47. base.Result
  48. }
  49. type UserListQuery struct {
  50. Page int64 `form:"page" json:"page"`
  51. PageSize int64 `form:"page_size" json:"page_size"`
  52. User string `form:"user" json:"user"`
  53. RealName string `form:"real_name" json:"real_name"`
  54. }
  55. type UserListRequest struct {
  56. base.Header
  57. UserListQuery
  58. }
  59. type UserListResponse struct {
  60. base.Result
  61. Data apis.UserListReply `json:"data"`
  62. }
  63. type UserDelQuery struct {
  64. Id int64 `form:"id" json:"id"`
  65. }
  66. type UserDelRequest struct {
  67. base.Header
  68. UserDelQuery
  69. }
  70. type UserDelResponse struct {
  71. base.Result
  72. }
  73. type UserResetPasswordBody struct {
  74. Id int64 `form:"id" json:"id"`
  75. Password string `form:"password" json:"password"`
  76. }
  77. type UserResetPasswordRequest struct {
  78. base.Header
  79. UserResetPasswordBody
  80. }
  81. type UserResetPasswordResponse struct {
  82. base.Result
  83. }
  84. type UserUpdateBody struct {
  85. User string `form:"user" json:"user"`
  86. Password string `form:"password" json:"password"`
  87. RealName string `form:"real_name" json:"real_name"`
  88. UserType int32 `form:"user_type" json:"user_type"`
  89. EffectiveStart int64 `form:"effective_start" json:"effective_start"`
  90. EffectiveEnd int64 `form:"effective_end" json:"effective_end"`
  91. Id int64 `form:"id" json:"id"`
  92. }
  93. type UserUpdateRequest struct {
  94. base.Header
  95. UserUpdateBody
  96. }
  97. type UserUpdateResponse struct {
  98. base.Result
  99. }