Add phone registration with SMS verification and regenerate Swagger docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-13 14:43:33 +05:00
parent 704606b3f5
commit 5e3c46da83
17 changed files with 1008 additions and 20 deletions

View File

@@ -4658,6 +4658,98 @@ const docTemplate = `{
}
}
},
"/register": {
"post": {
"description": "Starts registration and sends an SMS verification code. Replace sms.LogSender with your SMS client.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Register",
"parameters": [
{
"description": "Registration payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.RegisterDTO"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/appresult.AppSuccess"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
}
}
}
},
"/register/verify": {
"post": {
"description": "Confirms the SMS code and creates the user account",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Verify phone",
"parameters": [
{
"description": "Verification payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.VerifyDTO"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/appresult.AppSuccess"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/appresult.AppError"
}
}
}
}
},
"/role-users": {
"get": {
"security": [
@@ -5523,6 +5615,35 @@ const docTemplate = `{
}
}
},
"auth.RegisterDTO": {
"type": "object",
"required": [
"name",
"password",
"passwordConfirm",
"phone",
"username"
],
"properties": {
"name": {
"type": "string"
},
"password": {
"type": "string",
"minLength": 6
},
"passwordConfirm": {
"type": "string"
},
"phone": {
"type": "string"
},
"username": {
"type": "string",
"minLength": 3
}
}
},
"auth.UpdateProfileDTO": {
"type": "object",
"required": [
@@ -5546,6 +5667,21 @@ const docTemplate = `{
}
}
},
"auth.VerifyDTO": {
"type": "object",
"required": [
"code",
"phone"
],
"properties": {
"code": {
"type": "string"
},
"phone": {
"type": "string"
}
}
},
"branches.CreateBranchDTO": {
"type": "object",
"required": [