feat: patch usertitle described
All checks were successful
Build and Deploy Go App / build (push) Successful in 5m48s
Build and Deploy Go App / deploy (push) Successful in 29s

This commit is contained in:
Iron_Felix 2025-11-27 03:46:40 +03:00
parent 759679990a
commit cb9fba6fbc
4 changed files with 133 additions and 214 deletions

View file

@ -110,13 +110,9 @@ post:
schema:
type: object
required:
- user_id
- title_id
- status
properties:
user_id:
type: integer
format: int64
title_id:
type: integer
format: int64
@ -125,12 +121,6 @@ post:
rate:
type: integer
format: int32
review_id:
type: integer
format: int64
ctime:
type: string
format: date-time
responses:
'200':
@ -138,20 +128,8 @@ post:
content:
application/json:
schema:
type: object
properties:
# success:
# type: boolean
# example: true
# error:
# type: string
# nullable: true
# example: null
data:
$ref: '../schemas/UserTitleMini.yaml'
# required:
# - success
# - error
$ref: '../schemas/UserTitleMini.yaml'
'400':
description: Invalid request body (missing fields, invalid types, etc.)
'401':
@ -162,5 +140,55 @@ post:
description: User or Title not found
'409':
description: Conflict — title already assigned to user (if applicable)
'500':
description: Internal server error
patch:
summary: Update a usertitle
description: User updating title list of watched
operationId: updateUserTitle
parameters:
- name: user_id
in: path
required: true
schema:
type: integer
format: int64
description: ID of the user to assign the title to
example: 123
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- title_id
properties:
title_id:
type: integer
format: int64
status:
$ref: ../schemas/enums/UserTitleStatus.yaml
rate:
type: integer
format: int32
responses:
'200':
description: Title successfully updated
content:
application/json:
schema:
$ref: '../schemas/UserTitleMini.yaml'
'400':
description: Invalid request body (missing fields, invalid types, etc.)
'401':
description: Unauthorized — missing or invalid auth token
'403':
description: Forbidden — user not allowed to update title
'404':
description: User or Title not found
'500':
description: Internal server error