feat: added GetUserTitle route

This commit is contained in:
nihonium 2025-11-27 11:59:49 +03:00
parent a25a912ead
commit ad1c567b42
Signed by: nihonium
GPG key ID: 0251623741027CFC
8 changed files with 733 additions and 402 deletions

View file

@ -220,6 +220,7 @@ paths:
description: Unknown server error
'/users/{user_id}/titles':
get:
operationId: getUserTitles
summary: Get user titles
parameters:
- $ref: '#/components/parameters/cursor'
@ -360,6 +361,38 @@ paths:
description: Conflict — title already assigned to user (if applicable)
'500':
description: Internal server error
'/users/{user_id}/titles/{title_id}':
get:
operationId: getUserTitle
summary: Get user title
parameters:
- name: user_id
in: path
required: true
schema:
type: integer
format: int64
- name: title_id
in: path
required: true
schema:
type: integer
format: int64
responses:
'200':
description: User titles
content:
application/json:
schema:
$ref: '#/components/schemas/UserTitleMini'
'204':
description: No user title found
'400':
description: Request params are not correct
'404':
description: User or title not found
'500':
description: Unknown server error
patch:
operationId: updateUserTitle
summary: Update a usertitle
@ -367,12 +400,16 @@ paths:
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
- name: title_id
in: path
required: true
schema:
type: integer
format: int64
requestBody:
required: true
content:
@ -380,16 +417,11 @@ paths:
schema:
type: object
properties:
title_id:
type: integer
format: int64
status:
$ref: '#/components/schemas/UserTitleStatus'
rate:
type: integer
format: int32
required:
- title_id
responses:
'200':
description: Title successfully updated
@ -414,13 +446,12 @@ paths:
parameters:
- name: user_id
in: path
description: ID of the user to assign the title to
required: true
schema:
type: integer
format: int64
- name: title_id
in: query
in: path
required: true
schema:
type: integer