UPDATE: Fix bug
All checks were successful
Build and Release / release (push) Successful in 1m8s

This commit is contained in:
2026-04-27 20:31:01 +07:00
parent eb08c16232
commit 17aafacbfd
36 changed files with 842 additions and 447 deletions

View File

@@ -2763,6 +2763,55 @@ const docTemplate = `{
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new user account with specified roles",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Create a new user (Admin only)",
"parameters": [
{
"description": "Create User request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.CreateUserDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/users/current": {
@@ -3580,6 +3629,37 @@ const docTemplate = `{
}
}
},
"history-api_internal_dtos_request.CreateUserDto": {
"type": "object",
"required": [
"display_name",
"email",
"password",
"role_ids"
],
"properties": {
"display_name": {
"type": "string",
"maxLength": 50,
"minLength": 2
},
"email": {
"type": "string"
},
"password": {
"type": "string",
"maxLength": 64,
"minLength": 8
},
"role_ids": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
}
},
"history-api_internal_dtos_request.CreateUserVerificationDto": {
"type": "object",
"required": [

View File

@@ -2756,6 +2756,55 @@
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new user account with specified roles",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Create a new user (Admin only)",
"parameters": [
{
"description": "Create User request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.CreateUserDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/users/current": {
@@ -3573,6 +3622,37 @@
}
}
},
"history-api_internal_dtos_request.CreateUserDto": {
"type": "object",
"required": [
"display_name",
"email",
"password",
"role_ids"
],
"properties": {
"display_name": {
"type": "string",
"maxLength": 50,
"minLength": 2
},
"email": {
"type": "string"
},
"password": {
"type": "string",
"maxLength": 64,
"minLength": 8
},
"role_ids": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
}
},
"history-api_internal_dtos_request.CreateUserVerificationDto": {
"type": "object",
"required": [

View File

@@ -100,6 +100,29 @@ definitions:
- email
- token_type
type: object
history-api_internal_dtos_request.CreateUserDto:
properties:
display_name:
maxLength: 50
minLength: 2
type: string
email:
type: string
password:
maxLength: 64
minLength: 8
type: string
role_ids:
items:
type: string
minItems: 1
type: array
required:
- display_name
- email
- password
- role_ids
type: object
history-api_internal_dtos_request.CreateUserVerificationDto:
properties:
content:
@@ -2129,6 +2152,37 @@ paths:
summary: Search users
tags:
- Users
post:
consumes:
- application/json
description: Create a new user account with specified roles
parameters:
- description: Create User request
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.CreateUserDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Create a new user (Admin only)
tags:
- Users
/users/{id}:
delete:
consumes: