v3-users.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-users.yaml
  2. post:
  3. summary: 注册账号
  4. tags:
  5. - users
  6. operationId: post_api_v3_users
  7. description: |-
  8. 凭 invite(邀请邮件里的,或 `POST /v3/invites` 换来的)建账号,同时建一个
  9. 私有的 draft 译文 channel,invite 标为已用。邮箱取自 invite。
  10. 注册不等于登录:返回 201 与新账号,之后用用户名/邮箱 + 密码走登录。
  11. 实现:`V3\UserController@store`
  12. security:
  13. - { }
  14. -
  15. bearerAuth: []
  16. requestBody:
  17. required: true
  18. content:
  19. application/json:
  20. schema:
  21. type: object
  22. properties:
  23. invite:
  24. type: string
  25. description: '注册邀请的 uuid'
  26. username:
  27. type: string
  28. description: '用户名,6–32 位字母、数字、下划线'
  29. nickname:
  30. type: string
  31. description: '昵称,不传或空白时用 username'
  32. password:
  33. type: string
  34. description: '密码,6–32 位'
  35. password_confirmation:
  36. type: string
  37. description: 再输一次密码
  38. lang:
  39. type: string
  40. description: '常用译文语言,用作 draft channel 的语言'
  41. example: zh-Hans
  42. required:
  43. - invite
  44. - username
  45. - password
  46. - password_confirmation
  47. - lang
  48. responses:
  49. 200:
  50. description: 成功
  51. content:
  52. application/json:
  53. schema:
  54. type: object
  55. properties:
  56. data:
  57. type: object
  58. properties:
  59. id:
  60. type: string
  61. username:
  62. type: string
  63. nickname:
  64. type: string
  65. email:
  66. type: string
  67. created_at:
  68. type: string
  69. nullable: true
  70. 201:
  71. description: 已创建
  72. content:
  73. application/json:
  74. schema:
  75. type: object
  76. properties:
  77. data:
  78. type: object
  79. properties:
  80. id:
  81. type: string
  82. username:
  83. type: string
  84. nickname:
  85. type: string
  86. email:
  87. type: string
  88. created_at:
  89. type: string
  90. nullable: true
  91. 422:
  92. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  93. 429:
  94. description: 请求过于频繁
  95. content:
  96. application/problem+json:
  97. schema:
  98. $ref: '../../main.yaml#/components/schemas/ProblemDetails'