Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: register with invitation codes #165

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 77 additions & 2 deletions design/API.yml
Original file line number Diff line number Diff line change
Expand Up @@ -720,20 +720,28 @@ components:
properties:
username:
type: string
description: 用户名
nickname:
type: string
description: 昵称
password:
type: string
description: 密码
email:
type: string
emailCode:
description: 邮箱
email_code:
type: string
description: 邮箱验证码
invitation_code:
type: string
description: 邀请码
required:
- username
- nickname
- password
- email
- emailCode
- email_code
RegisterResponse:
allOf:
- $ref: "#/components/schemas/CommonResponse"
Expand Down Expand Up @@ -3186,3 +3194,70 @@ paths:
responses:
"204":
description: No Content
/invitation-codes:
get:
summary: 获取邀请码
operationId: getInvitationCode
security:
- bearerAuth: []
responses:
"200":
description: OK
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/CommonResponse"
- type: object
properties:
data:
type: object
properties:
codes:
type: array
items:
type: object
properties:
code:
type: string
description: 邀请码
created_at:
type: integer
format: int64
description: 创建时间
used:
type: boolean
description: 是否已使用
used_at:
type: integer
format: int64
description: 使用时间
required:
- code
- created_at
- used
required:
- data
post:
summary: 创建邀请码
operationId: createInvitationCode
security:
- bearerAuth: []
responses:
"201":
description: Invitation code created successfully
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/CommonResponse"
- type: object
properties:
data:
type: object
properties:
code:
type: string
description: 邀请码
required:
- data