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

@ -328,13 +328,9 @@ paths:
schema:
type: object
required:
- user_id
- title_id
- status
properties:
user_id:
type: integer
format: int64
title_id:
type: integer
format: int64
@ -343,12 +339,6 @@ paths:
rate:
type: integer
format: int32
review_id:
type: integer
format: int64
ctime:
type: string
format: date-time
responses:
'200':
description: Title successfully added to user
@ -356,32 +346,29 @@ paths:
application/json:
schema:
type: object
required:
- user_id
- title_id
- status
properties:
data:
type: object
required:
- user_id
- title_id
- status
properties:
user_id:
type: integer
format: int64
title_id:
type: integer
format: int64
status:
$ref: '#/components/schemas/UserTitleStatus'
rate:
type: integer
format: int32
review_id:
type: integer
format: int64
ctime:
type: string
format: date-time
additionalProperties: false
user_id:
type: integer
format: int64
title_id:
type: integer
format: int64
status:
$ref: '#/components/schemas/UserTitleStatus'
rate:
type: integer
format: int32
review_id:
type: integer
format: int64
ctime:
type: string
format: date-time
additionalProperties: false
'400':
description: 'Invalid request body (missing fields, invalid types, etc.)'
'401':
@ -394,6 +381,53 @@ paths:
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: '#/components/schemas/UserTitleStatus'
rate:
type: integer
format: int32
responses:
'200':
description: Title successfully updated
content:
application/json:
schema:
$ref: '#/paths/~1users~1%7Buser_id%7D~1titles/post/responses/200/content/application~1json/schema'
'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
components:
parameters:
cursor:
@ -629,4 +663,3 @@ components:
ctime:
type: string
format: date-time
additionalProperties: true