feat: 添加用户注册功能,包括表单验证和路由注册
This commit is contained in:
@@ -3885,6 +3885,39 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/auth/register": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Web"
|
||||
],
|
||||
"summary": "用户注册",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "form",
|
||||
"name": "form",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.RegisterForm"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "成功",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/auth/token": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
@@ -4906,6 +4939,27 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.RegisterForm": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"confirmPassword": {
|
||||
"description": "ConfirmPassword 确认密码;必须与 Password 一致,避免误输入导致无法登录。",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"description": "Password 明文密码;后端会在创建用户时自动加密(bcrypt)。",
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"description": "Username 用户名;需全局唯一(users.username);建议仅允许字母/数字/下划线,且长度在合理范围内。",
|
||||
"type": "string"
|
||||
},
|
||||
"verifyCode": {
|
||||
"description": "VerifyCode 验证码(预留字段);当前版本仅透传/占位,不做后端校验。",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.SuperContentItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -3879,6 +3879,39 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/auth/register": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Web"
|
||||
],
|
||||
"summary": "用户注册",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "form",
|
||||
"name": "form",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.RegisterForm"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "成功",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/auth/token": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
@@ -4900,6 +4933,27 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.RegisterForm": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"confirmPassword": {
|
||||
"description": "ConfirmPassword 确认密码;必须与 Password 一致,避免误输入导致无法登录。",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"description": "Password 明文密码;后端会在创建用户时自动加密(bcrypt)。",
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"description": "Username 用户名;需全局唯一(users.username);建议仅允许字母/数字/下划线,且长度在合理范围内。",
|
||||
"type": "string"
|
||||
},
|
||||
"verifyCode": {
|
||||
"description": "VerifyCode 验证码(预留字段);当前版本仅透传/占位,不做后端校验。",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.SuperContentItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -685,6 +685,21 @@ definitions:
|
||||
description: Order is the created or existing order record (may be nil for
|
||||
owner/free-path without order).
|
||||
type: object
|
||||
dto.RegisterForm:
|
||||
properties:
|
||||
confirmPassword:
|
||||
description: ConfirmPassword 确认密码;必须与 Password 一致,避免误输入导致无法登录。
|
||||
type: string
|
||||
password:
|
||||
description: Password 明文密码;后端会在创建用户时自动加密(bcrypt)。
|
||||
type: string
|
||||
username:
|
||||
description: Username 用户名;需全局唯一(users.username);建议仅允许字母/数字/下划线,且长度在合理范围内。
|
||||
type: string
|
||||
verifyCode:
|
||||
description: VerifyCode 验证码(预留字段);当前版本仅透传/占位,不做后端校验。
|
||||
type: string
|
||||
type: object
|
||||
dto.SuperContentItem:
|
||||
properties:
|
||||
content:
|
||||
@@ -4208,6 +4223,27 @@ paths:
|
||||
summary: 用户登录
|
||||
tags:
|
||||
- Web
|
||||
/v1/auth/register:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: form
|
||||
in: body
|
||||
name: form
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.RegisterForm'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: 成功
|
||||
schema:
|
||||
$ref: '#/definitions/quyun_v2_app_http_web_dto.LoginResponse'
|
||||
summary: 用户注册
|
||||
tags:
|
||||
- Web
|
||||
/v1/auth/token:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user