asd
This commit is contained in:
@@ -177,6 +177,155 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
|
||||
/api/users:
|
||||
get:
|
||||
tags:
|
||||
- Social Rating
|
||||
summary: List users with current social rating
|
||||
operationId: listUsersWithRatings
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 200
|
||||
default: 50
|
||||
responses:
|
||||
'200':
|
||||
description: Users with current rating values
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UsersResponse'
|
||||
'401':
|
||||
description: Missing or invalid token
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
|
||||
/api/users/{userId}:
|
||||
get:
|
||||
tags:
|
||||
- Social Rating
|
||||
summary: Get user with current social rating
|
||||
operationId: getUserWithRating
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: uint64
|
||||
responses:
|
||||
'200':
|
||||
description: User with current rating value
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserRatingResponse'
|
||||
'400':
|
||||
description: Invalid user id
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Missing or invalid token
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'404':
|
||||
description: User not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
|
||||
/api/users/{userId}/social-rating/history:
|
||||
get:
|
||||
tags:
|
||||
- Social Rating
|
||||
summary: Get social rating history for user
|
||||
operationId: getUserRatingHistory
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: uint64
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 200
|
||||
default: 50
|
||||
responses:
|
||||
'200':
|
||||
description: Rating history for user
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/HistoryResponse'
|
||||
'400':
|
||||
description: Invalid user id
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'401':
|
||||
description: Missing or invalid token
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
'404':
|
||||
description: User not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
|
||||
/api/social-rating/operations:
|
||||
get:
|
||||
tags:
|
||||
- Social Rating
|
||||
summary: Get recent social rating operations
|
||||
operationId: getRecentSocialRatingOperations
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 200
|
||||
default: 50
|
||||
responses:
|
||||
'200':
|
||||
description: Recent rating operations across all users
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/HistoryResponse'
|
||||
'401':
|
||||
description: Missing or invalid token
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
|
||||
/api/social-rating/decrease:
|
||||
post:
|
||||
tags:
|
||||
@@ -321,6 +470,34 @@ components:
|
||||
required:
|
||||
- user
|
||||
|
||||
UsersResponse:
|
||||
type: object
|
||||
properties:
|
||||
users:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/UserWithRating'
|
||||
required:
|
||||
- users
|
||||
|
||||
UserRatingResponse:
|
||||
type: object
|
||||
properties:
|
||||
user:
|
||||
$ref: '#/components/schemas/UserWithRating'
|
||||
required:
|
||||
- user
|
||||
|
||||
HistoryResponse:
|
||||
type: object
|
||||
properties:
|
||||
operations:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/SocialRatingOperation'
|
||||
required:
|
||||
- operations
|
||||
|
||||
User:
|
||||
type: object
|
||||
properties:
|
||||
@@ -350,6 +527,42 @@ components:
|
||||
- createdAt
|
||||
- updatedAt
|
||||
|
||||
UserWithRating:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: uint64
|
||||
example: 2
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
example: user@example.com
|
||||
isAdmin:
|
||||
type: boolean
|
||||
example: false
|
||||
score:
|
||||
type: integer
|
||||
example: -4
|
||||
lastOperationId:
|
||||
type: integer
|
||||
format: uint64
|
||||
nullable: true
|
||||
example: 15
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
updatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
required:
|
||||
- id
|
||||
- email
|
||||
- isAdmin
|
||||
- score
|
||||
- createdAt
|
||||
- updatedAt
|
||||
|
||||
UserSocialRating:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user