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

This commit is contained in:
2026-04-17 15:44:34 +07:00
parent 903f2d709a
commit 324a91489c
4 changed files with 309 additions and 316 deletions

View File

@@ -1503,6 +1503,62 @@ const docTemplate = `{
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the profile details of the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Update user profile",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update Profile request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.UpdateProfileDto"
}
}
],
"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/application": {
@@ -1573,6 +1629,64 @@ const docTemplate = `{
}
}
},
"/users/current/password": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the password for the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Change user password",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Change Password request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.ChangePasswordDto"
}
}
],
"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/{id}": {
"get": {
"security": [
@@ -1615,62 +1729,6 @@ const docTemplate = `{
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the profile details of the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Update user profile",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update Profile request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.UpdateProfileDto"
}
}
],
"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"
}
}
}
},
"delete": {
"security": [
{
@@ -1789,64 +1847,6 @@ const docTemplate = `{
}
}
},
"/users/{id}/password": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the password for the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Change user password",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Change Password request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.ChangePasswordDto"
}
}
],
"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/{id}/restore": {
"patch": {
"security": [
@@ -1972,8 +1972,7 @@ const docTemplate = `{
"history-api_internal_dtos_request.ChangeRoleDto": {
"type": "object",
"required": [
"role_ids",
"user_id"
"role_ids"
],
"properties": {
"role_ids": {
@@ -1982,9 +1981,6 @@ const docTemplate = `{
"items": {
"type": "string"
}
},
"user_id": {
"type": "string"
}
}
},

View File

@@ -1496,6 +1496,62 @@
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the profile details of the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Update user profile",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update Profile request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.UpdateProfileDto"
}
}
],
"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/application": {
@@ -1566,6 +1622,64 @@
}
}
},
"/users/current/password": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the password for the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Change user password",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Change Password request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.ChangePasswordDto"
}
}
],
"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/{id}": {
"get": {
"security": [
@@ -1608,62 +1722,6 @@
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the profile details of the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Update user profile",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update Profile request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.UpdateProfileDto"
}
}
],
"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"
}
}
}
},
"delete": {
"security": [
{
@@ -1782,64 +1840,6 @@
}
}
},
"/users/{id}/password": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the password for the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Change user password",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Change Password request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.ChangePasswordDto"
}
}
],
"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/{id}/restore": {
"patch": {
"security": [
@@ -1965,8 +1965,7 @@
"history-api_internal_dtos_request.ChangeRoleDto": {
"type": "object",
"required": [
"role_ids",
"user_id"
"role_ids"
],
"properties": {
"role_ids": {
@@ -1975,9 +1974,6 @@
"items": {
"type": "string"
}
},
"user_id": {
"type": "string"
}
}
},

View File

@@ -21,11 +21,8 @@ definitions:
type: string
minItems: 1
type: array
user_id:
type: string
required:
- role_ids
- user_id
type: object
history-api_internal_dtos_request.CreateTokenDto:
properties:
@@ -1242,42 +1239,6 @@ paths:
summary: Get user by ID
tags:
- Users
put:
consumes:
- application/json
description: Update the profile details of the currently authenticated user
parameters:
- description: User ID
in: path
name: id
required: true
type: string
- description: Update Profile request
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.UpdateProfileDto'
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: Update user profile
tags:
- Users
/users/{id}/application:
get:
consumes:
@@ -1328,43 +1289,6 @@ paths:
summary: Get user's media by user ID
tags:
- Users
/users/{id}/password:
patch:
consumes:
- application/json
description: Update the password for the currently authenticated user
parameters:
- description: User ID
in: path
name: id
required: true
type: string
- description: Change Password request
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.ChangePasswordDto'
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: Change user password
tags:
- Users
/users/{id}/restore:
patch:
consumes:
@@ -1451,6 +1375,42 @@ paths:
summary: Get current user profile
tags:
- Users
put:
consumes:
- application/json
description: Update the profile details of the currently authenticated user
parameters:
- description: User ID
in: path
name: id
required: true
type: string
- description: Update Profile request
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.UpdateProfileDto'
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: Update user profile
tags:
- Users
/users/current/application:
get:
consumes:
@@ -1493,6 +1453,43 @@ paths:
summary: Get current user's media
tags:
- Users
/users/current/password:
patch:
consumes:
- application/json
description: Update the password for the currently authenticated user
parameters:
- description: User ID
in: path
name: id
required: true
type: string
- description: Change Password request
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.ChangePasswordDto'
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: Change user password
tags:
- Users
securityDefinitions:
BearerAuth:
description: Type "Bearer " followed by a space and JWT token.