feat: delete usertitle described
This commit is contained in:
parent
cb9fba6fbc
commit
e0a68d7d0f
6 changed files with 526 additions and 228 deletions
|
|
@ -11,52 +11,52 @@ paths:
|
|||
parameters:
|
||||
- $ref: '#/components/parameters/cursor'
|
||||
- $ref: '#/components/parameters/title_sort'
|
||||
- in: query
|
||||
name: sort_forward
|
||||
- name: sort_forward
|
||||
in: query
|
||||
schema:
|
||||
type: boolean
|
||||
default: true
|
||||
- in: query
|
||||
name: word
|
||||
- name: word
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: status
|
||||
- name: status
|
||||
in: query
|
||||
description: List of title statuses to filter
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TitleStatus'
|
||||
description: List of title statuses to filter
|
||||
style: form
|
||||
explode: false
|
||||
- in: query
|
||||
name: rating
|
||||
style: form
|
||||
- name: rating
|
||||
in: query
|
||||
schema:
|
||||
type: number
|
||||
format: double
|
||||
- in: query
|
||||
name: release_year
|
||||
- name: release_year
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
- in: query
|
||||
name: release_season
|
||||
- name: release_season
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/ReleaseSeason'
|
||||
- in: query
|
||||
name: limit
|
||||
- name: limit
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 10
|
||||
- in: query
|
||||
name: offset
|
||||
- name: offset
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 0
|
||||
- in: query
|
||||
name: fields
|
||||
- name: fields
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
default: all
|
||||
|
|
@ -69,10 +69,10 @@ paths:
|
|||
type: object
|
||||
properties:
|
||||
data:
|
||||
description: List of titles
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Title'
|
||||
description: List of titles
|
||||
cursor:
|
||||
$ref: '#/components/schemas/CursorObj'
|
||||
required:
|
||||
|
|
@ -88,14 +88,14 @@ paths:
|
|||
get:
|
||||
summary: Get title description
|
||||
parameters:
|
||||
- in: path
|
||||
name: title_id
|
||||
- name: title_id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
- in: query
|
||||
name: fields
|
||||
- name: fields
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
default: all
|
||||
|
|
@ -118,13 +118,13 @@ paths:
|
|||
get:
|
||||
summary: Get user info
|
||||
parameters:
|
||||
- in: path
|
||||
name: user_id
|
||||
- name: user_id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: fields
|
||||
- name: fields
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
default: all
|
||||
|
|
@ -142,59 +142,59 @@ paths:
|
|||
'500':
|
||||
description: Unknown server error
|
||||
patch:
|
||||
operationId: updateUser
|
||||
summary: Partially update a user account
|
||||
description: |
|
||||
Update selected user profile fields (excluding password).
|
||||
Password updates must be done via the dedicated auth-service (`/auth/`).
|
||||
Fields not provided in the request body remain unchanged.
|
||||
operationId: updateUser
|
||||
parameters:
|
||||
- name: user_id
|
||||
in: path
|
||||
description: User ID (primary key)
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
description: User ID (primary key)
|
||||
example: 123
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
description: Only provided fields are updated. Omitted fields remain unchanged.
|
||||
type: object
|
||||
properties:
|
||||
avatar_id:
|
||||
description: ID of the user avatar (references `images.id`); set to `null` to remove avatar
|
||||
type: integer
|
||||
format: int64
|
||||
nullable: true
|
||||
description: ID of the user avatar (references `images.id`); set to `null` to remove avatar
|
||||
example: 42
|
||||
nullable: true
|
||||
mail:
|
||||
description: User email (must be unique and valid)
|
||||
type: string
|
||||
format: email
|
||||
pattern: '^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+$'
|
||||
description: User email (must be unique and valid)
|
||||
example: john.doe.updated@example.com
|
||||
pattern: '^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+$'
|
||||
nickname:
|
||||
type: string
|
||||
pattern: '^[a-zA-Z0-9_-]{3,16}$'
|
||||
description: 'Username (alphanumeric + `_` or `-`, 3–16 chars)'
|
||||
type: string
|
||||
example: john_doe_43
|
||||
maxLength: 16
|
||||
minLength: 3
|
||||
example: john_doe_43
|
||||
pattern: '^[a-zA-Z0-9_-]{3,16}$'
|
||||
disp_name:
|
||||
type: string
|
||||
description: Display name
|
||||
maxLength: 32
|
||||
example: John Smith
|
||||
user_desc:
|
||||
type: string
|
||||
example: John Smith
|
||||
maxLength: 32
|
||||
user_desc:
|
||||
description: User description / bio
|
||||
maxLength: 512
|
||||
type: string
|
||||
example: Just a curious developer.
|
||||
maxLength: 512
|
||||
additionalProperties: false
|
||||
description: Only provided fields are updated. Omitted fields remain unchanged.
|
||||
responses:
|
||||
'200':
|
||||
description: User updated successfully. Returns updated user representation (excluding sensitive fields).
|
||||
|
|
@ -222,64 +222,64 @@ paths:
|
|||
parameters:
|
||||
- $ref: '#/components/parameters/cursor'
|
||||
- $ref: '#/components/parameters/title_sort'
|
||||
- in: path
|
||||
name: user_id
|
||||
- name: user_id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: sort_forward
|
||||
- name: sort_forward
|
||||
in: query
|
||||
schema:
|
||||
type: boolean
|
||||
default: true
|
||||
- in: query
|
||||
name: word
|
||||
- name: word
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: status
|
||||
- name: status
|
||||
in: query
|
||||
description: List of title statuses to filter
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TitleStatus'
|
||||
description: List of title statuses to filter
|
||||
style: form
|
||||
explode: false
|
||||
- in: query
|
||||
name: watch_status
|
||||
style: form
|
||||
- name: watch_status
|
||||
in: query
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/UserTitleStatus'
|
||||
style: form
|
||||
explode: false
|
||||
- in: query
|
||||
name: rating
|
||||
style: form
|
||||
- name: rating
|
||||
in: query
|
||||
schema:
|
||||
type: number
|
||||
format: double
|
||||
- in: query
|
||||
name: my_rate
|
||||
- name: my_rate
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
- in: query
|
||||
name: release_year
|
||||
- name: release_year
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
- in: query
|
||||
name: release_season
|
||||
- name: release_season
|
||||
in: query
|
||||
schema:
|
||||
$ref: '#/components/schemas/ReleaseSeason'
|
||||
- in: query
|
||||
name: limit
|
||||
- name: limit
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 10
|
||||
- in: query
|
||||
name: fields
|
||||
- name: fields
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
default: all
|
||||
|
|
@ -309,17 +309,17 @@ paths:
|
|||
'500':
|
||||
description: Unknown server error
|
||||
post:
|
||||
operationId: addUserTitle
|
||||
summary: Add a title to a user
|
||||
description: 'User adding title to list af watched, status required'
|
||||
operationId: addUserTitle
|
||||
parameters:
|
||||
- name: user_id
|
||||
in: path
|
||||
description: ID of the user to assign the title to
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
description: ID of the user to assign the title to
|
||||
example: 123
|
||||
requestBody:
|
||||
required: true
|
||||
|
|
@ -327,9 +327,6 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- title_id
|
||||
- status
|
||||
properties:
|
||||
title_id:
|
||||
type: integer
|
||||
|
|
@ -339,36 +336,16 @@ paths:
|
|||
rate:
|
||||
type: integer
|
||||
format: int32
|
||||
required:
|
||||
- title_id
|
||||
- status
|
||||
responses:
|
||||
'200':
|
||||
description: Title successfully added to user
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
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
|
||||
$ref: '#/components/schemas/UserTitleMini'
|
||||
'400':
|
||||
description: 'Invalid request body (missing fields, invalid types, etc.)'
|
||||
'401':
|
||||
|
|
@ -382,17 +359,17 @@ paths:
|
|||
'500':
|
||||
description: Internal server error
|
||||
patch:
|
||||
operationId: updateUserTitle
|
||||
summary: Update a usertitle
|
||||
description: User updating title list of watched
|
||||
operationId: updateUserTitle
|
||||
parameters:
|
||||
- name: user_id
|
||||
in: path
|
||||
description: ID of the user to assign the title to
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
description: ID of the user to assign the title to
|
||||
example: 123
|
||||
requestBody:
|
||||
required: true
|
||||
|
|
@ -400,8 +377,6 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- title_id
|
||||
properties:
|
||||
title_id:
|
||||
type: integer
|
||||
|
|
@ -411,13 +386,15 @@ paths:
|
|||
rate:
|
||||
type: integer
|
||||
format: int32
|
||||
required:
|
||||
- title_id
|
||||
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'
|
||||
$ref: '#/components/schemas/UserTitleMini'
|
||||
'400':
|
||||
description: 'Invalid request body (missing fields, invalid types, etc.)'
|
||||
'401':
|
||||
|
|
@ -428,6 +405,30 @@ paths:
|
|||
description: User or Title not found
|
||||
'500':
|
||||
description: Internal server error
|
||||
delete:
|
||||
operationId: deleteUserTitle
|
||||
summary: Delete a usertitle
|
||||
description: User deleting title from list of watched
|
||||
parameters:
|
||||
- name: user_id
|
||||
in: path
|
||||
description: ID of the user to assign the title to
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
example: 123
|
||||
responses:
|
||||
'200':
|
||||
description: Title successfully deleted
|
||||
'401':
|
||||
description: Unauthorized — missing or invalid auth token
|
||||
'403':
|
||||
description: Forbidden — user not allowed to delete title
|
||||
'404':
|
||||
description: User or Title not found
|
||||
'500':
|
||||
description: Internal server error
|
||||
components:
|
||||
parameters:
|
||||
cursor:
|
||||
|
|
@ -443,25 +444,36 @@ components:
|
|||
schema:
|
||||
$ref: '#/components/schemas/TitleSort'
|
||||
schemas:
|
||||
CursorObj:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
param:
|
||||
type: string
|
||||
TitleSort:
|
||||
type: string
|
||||
description: Title sort order
|
||||
type: string
|
||||
default: id
|
||||
enum:
|
||||
- id
|
||||
- year
|
||||
- rating
|
||||
- views
|
||||
TitleStatus:
|
||||
description: Title status
|
||||
type: string
|
||||
enum:
|
||||
- finished
|
||||
- ongoing
|
||||
- planned
|
||||
ReleaseSeason:
|
||||
description: Title release season
|
||||
type: string
|
||||
enum:
|
||||
- winter
|
||||
- spring
|
||||
- summer
|
||||
- fall
|
||||
StorageType:
|
||||
description: Image storage type
|
||||
type: string
|
||||
enum:
|
||||
- s3
|
||||
- local
|
||||
Image:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -469,65 +481,11 @@ components:
|
|||
type: integer
|
||||
format: int64
|
||||
storage_type:
|
||||
type: string
|
||||
description: Image storage type
|
||||
enum:
|
||||
- s3
|
||||
- local
|
||||
$ref: '#/components/schemas/StorageType'
|
||||
image_path:
|
||||
type: string
|
||||
TitleStatus:
|
||||
type: string
|
||||
description: Title status
|
||||
enum:
|
||||
- finished
|
||||
- ongoing
|
||||
- planned
|
||||
ReleaseSeason:
|
||||
type: string
|
||||
description: Title release season
|
||||
enum:
|
||||
- winter
|
||||
- spring
|
||||
- summer
|
||||
- fall
|
||||
UserTitleStatus:
|
||||
type: string
|
||||
description: User's title status
|
||||
enum:
|
||||
- finished
|
||||
- planned
|
||||
- dropped
|
||||
- in-progress
|
||||
Review:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
Tag:
|
||||
type: object
|
||||
description: 'A localized tag: keys are language codes (ISO 639-1), values are tag names'
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
en: Shojo
|
||||
ru: Сёдзё
|
||||
ja: 少女
|
||||
Tags:
|
||||
type: array
|
||||
description: Array of localized tags
|
||||
items:
|
||||
$ref: '#/components/schemas/Tag'
|
||||
example:
|
||||
- en: Shojo
|
||||
ru: Сёдзё
|
||||
ja: 少女
|
||||
- en: Shounen
|
||||
ru: Сёнен
|
||||
ja: 少年
|
||||
Studio:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
|
|
@ -538,30 +496,41 @@ components:
|
|||
$ref: '#/components/schemas/Image'
|
||||
description:
|
||||
type: string
|
||||
Title:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- title_names
|
||||
- tags
|
||||
- name
|
||||
Tag:
|
||||
description: 'A localized tag: keys are language codes (ISO 639-1), values are tag names'
|
||||
type: object
|
||||
example:
|
||||
en: Shojo
|
||||
ru: Сёдзё
|
||||
ja: 少女
|
||||
additionalProperties:
|
||||
type: string
|
||||
Tags:
|
||||
description: Array of localized tags
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Tag'
|
||||
example:
|
||||
- en: Shojo
|
||||
ru: Сёдзё
|
||||
ja: 少女
|
||||
- en: Shounen
|
||||
ru: Сёнен
|
||||
ja: 少年
|
||||
Title:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
description: Unique title ID (primary key)
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unique title ID (primary key)
|
||||
example: 1
|
||||
title_names:
|
||||
type: object
|
||||
description: 'Localized titles. Key = language (ISO 639-1), value = list of names'
|
||||
additionalProperties:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: Attack on Titan
|
||||
minItems: 1
|
||||
example:
|
||||
- Attack on Titan
|
||||
- AoT
|
||||
type: object
|
||||
example:
|
||||
en:
|
||||
- Attack on Titan
|
||||
|
|
@ -571,6 +540,15 @@ components:
|
|||
- Титаны
|
||||
ja:
|
||||
- 進撃の巨人
|
||||
additionalProperties:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: Attack on Titan
|
||||
minItems: 1
|
||||
example:
|
||||
- Attack on Titan
|
||||
- AoT
|
||||
studio:
|
||||
$ref: '#/components/schemas/Studio'
|
||||
tags:
|
||||
|
|
@ -602,50 +580,68 @@ components:
|
|||
type: number
|
||||
format: double
|
||||
additionalProperties: true
|
||||
User:
|
||||
required:
|
||||
- id
|
||||
- title_names
|
||||
- tags
|
||||
CursorObj:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
param:
|
||||
type: string
|
||||
required:
|
||||
- id
|
||||
User:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
description: Unique user ID (primary key)
|
||||
type: integer
|
||||
format: int64
|
||||
example: 1
|
||||
image:
|
||||
$ref: '#/components/schemas/Image'
|
||||
mail:
|
||||
description: User email
|
||||
type: string
|
||||
format: email
|
||||
description: User email
|
||||
example: john.doe@example.com
|
||||
nickname:
|
||||
type: string
|
||||
description: Username (alphanumeric + _ or -)
|
||||
maxLength: 16
|
||||
type: string
|
||||
example: john_doe_42
|
||||
maxLength: 16
|
||||
disp_name:
|
||||
type: string
|
||||
description: Display name
|
||||
maxLength: 32
|
||||
example: John Doe
|
||||
user_desc:
|
||||
type: string
|
||||
example: John Doe
|
||||
maxLength: 32
|
||||
user_desc:
|
||||
description: User description
|
||||
maxLength: 512
|
||||
type: string
|
||||
example: Just a regular user.
|
||||
maxLength: 512
|
||||
creation_date:
|
||||
description: Timestamp when the user was created
|
||||
type: string
|
||||
format: date-time
|
||||
description: Timestamp when the user was created
|
||||
example: '2025-10-10T23:45:47.908073Z'
|
||||
required:
|
||||
- user_id
|
||||
- nickname
|
||||
UserTitleStatus:
|
||||
description: User's title status
|
||||
type: string
|
||||
enum:
|
||||
- finished
|
||||
- planned
|
||||
- dropped
|
||||
- in-progress
|
||||
UserTitle:
|
||||
type: object
|
||||
required:
|
||||
- user_id
|
||||
- title_id
|
||||
- status
|
||||
properties:
|
||||
user_id:
|
||||
type: integer
|
||||
|
|
@ -663,3 +659,34 @@ components:
|
|||
ctime:
|
||||
type: string
|
||||
format: date-time
|
||||
required:
|
||||
- user_id
|
||||
- title_id
|
||||
- status
|
||||
UserTitleMini:
|
||||
type: object
|
||||
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
|
||||
required:
|
||||
- user_id
|
||||
- title_id
|
||||
- status
|
||||
Review:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue