user.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. "cp-organization-management-gateway/param/base"
  6. "cp-organization-management-gateway/pb/v1"
  7. )
  8. type LoginBody struct {
  9. Key string `form:"key"`
  10. User string `form:"user"`
  11. Password string `form:"password"`
  12. }
  13. type LoginRequest struct {
  14. base.Header
  15. LoginBody
  16. }
  17. type LoginData struct {
  18. Uid int64 `json:"uid"`
  19. Token string `json:"token"`
  20. User string `json:"user"`
  21. RefreshToken string `json:"refresh_token"`
  22. Organization string `json:"organization"`
  23. }
  24. type LoginResponse struct {
  25. base.Result
  26. Data LoginData `json:"data"`
  27. }
  28. type TokenRequest struct {
  29. base.Header
  30. }
  31. type TokenResponse struct {
  32. base.Result
  33. Data string `json:"data"`
  34. RefreshToken string `json:"refresh_token"`
  35. }
  36. type UserCreateBody struct {
  37. // 账户名
  38. Username string `form:"username" json:"username"`
  39. Password string `form:"password" json:"password"`
  40. Phone string `form:"phone" json:"phone"`
  41. Email string `form:"email" json:"email"`
  42. GroupId int64 `form:"group_id" json:"group_id"`
  43. Zones string `form:"zones" json:"zones"`
  44. // 姓名
  45. Name string `form:"name" json:"name"`
  46. }
  47. type UserCreateRequest struct {
  48. base.Header
  49. UserCreateBody
  50. }
  51. type UserCreateResponse struct {
  52. base.Result
  53. Data v1.CreateManagementUserReply `json:"data"`
  54. }
  55. type UserUpdateBody struct {
  56. // 账户名
  57. Username string `form:"username" json:"username"`
  58. Password string `form:"password" json:"password"`
  59. Phone string `form:"phone" json:"phone"`
  60. Email string `form:"email" json:"email"`
  61. GroupId int64 `form:"group_id" json:"group_id"`
  62. Zones string `form:"zones" json:"zones"`
  63. // 姓名
  64. Name string `form:"name" json:"name"`
  65. Id int64 `form:"id" json:"id"`
  66. }
  67. type UserUpdateRequest struct {
  68. base.Header
  69. UserUpdateBody
  70. }
  71. type UserUpdateResponse struct {
  72. base.Result
  73. }
  74. type UserDelPath struct {
  75. Id int64 `uri:"id"`
  76. }
  77. type UserDelRequest struct {
  78. base.Header
  79. UserDelPath
  80. }
  81. type UserDelResponse struct {
  82. base.Result
  83. }
  84. type UserListQuery struct {
  85. Page int64 `form:"page" json:"page"`
  86. PageSize int64 `form:"page_size" json:"page_size"`
  87. Name string `form:"name"`
  88. Zone string `form:"zone"`
  89. }
  90. type UserListRequest struct {
  91. base.Header
  92. UserListQuery
  93. }
  94. type UserListResponse struct {
  95. base.Result
  96. Data v1.UserListReply `json:"data"`
  97. }
  98. type UserInfoPath struct {
  99. Id int64 `uri:"id"`
  100. }
  101. type UserInfoRequest struct {
  102. base.Header
  103. UserInfoPath
  104. }
  105. type UserInfoResponse struct {
  106. base.Result
  107. Data v1.UserInfoReply `json:"data"`
  108. }