Merge branch 'dev' into dev-karas
Need to get a fresh openapi description for auth
This commit is contained in:
commit
3bbd2c2818
30 changed files with 1247 additions and 370 deletions
|
|
@ -122,6 +122,53 @@ paths:
|
|||
description: Unknown server error
|
||||
security:
|
||||
- JwtAuthCookies: []
|
||||
/users/:
|
||||
get:
|
||||
summary: 'Search user by nickname or dispname (both in one param), response is always sorted by id'
|
||||
parameters:
|
||||
- name: word
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: limit
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 10
|
||||
- name: cursor_id
|
||||
in: query
|
||||
description: pass cursor naked
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 1
|
||||
responses:
|
||||
'200':
|
||||
description: List of users with cursor
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
description: List of users
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/User'
|
||||
cursor:
|
||||
type: integer
|
||||
format: int64
|
||||
default: 1
|
||||
required:
|
||||
- data
|
||||
- cursor
|
||||
'204':
|
||||
description: No users found
|
||||
'400':
|
||||
description: Request params are not correct
|
||||
'500':
|
||||
description: Unknown server error
|
||||
'/users/{user_id}':
|
||||
get:
|
||||
operationId: getUsersId
|
||||
|
|
@ -348,6 +395,9 @@ paths:
|
|||
rate:
|
||||
type: integer
|
||||
format: int32
|
||||
ftime:
|
||||
type: string
|
||||
format: date-time
|
||||
required:
|
||||
- title_id
|
||||
- status
|
||||
|
|
@ -431,6 +481,9 @@ paths:
|
|||
rate:
|
||||
type: integer
|
||||
format: int32
|
||||
ftime:
|
||||
type: string
|
||||
format: date-time
|
||||
responses:
|
||||
'200':
|
||||
description: Title successfully updated
|
||||
|
|
@ -480,6 +533,42 @@ paths:
|
|||
description: Internal server error
|
||||
security:
|
||||
- XsrfAuthHeader: []
|
||||
/media/upload:
|
||||
post:
|
||||
summary: 'Upload an image (PNG, JPEG, or WebP)'
|
||||
description: |
|
||||
Uploads a single image file. Supported formats: **PNG**, **JPEG/JPG**, **WebP**.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
encoding:
|
||||
image:
|
||||
contentType: 'image/png, image/jpeg, image/webp'
|
||||
multipart/form-data:
|
||||
schema:
|
||||
image:
|
||||
type: string
|
||||
format: binary
|
||||
description: 'Image file (PNG, JPEG, or WebP)'
|
||||
responses:
|
||||
'200':
|
||||
description: Image uploaded successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Image'
|
||||
'400':
|
||||
description: 'Bad request — e.g., invalid/malformed image, empty file'
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
'415':
|
||||
description: |
|
||||
Unsupported Media Type — e.g., request `Content-Type` is not `multipart/form-data`,
|
||||
or the `image` part has an unsupported `Content-Type` (not image/png, image/jpeg, or image/webp)
|
||||
'500':
|
||||
description: Internal server error
|
||||
components:
|
||||
parameters:
|
||||
cursor:
|
||||
|
|
@ -593,6 +682,11 @@ components:
|
|||
example:
|
||||
- Attack on Titan
|
||||
- AoT
|
||||
title_desc:
|
||||
description: 'Localized description. Key = language (ISO 639-1), value = description.'
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
studio:
|
||||
$ref: '#/components/schemas/Studio'
|
||||
tags:
|
||||
|
|
|
|||
249
api/api.gen.go
249
api/api.gen.go
|
|
@ -7,7 +7,10 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
|
@ -113,6 +116,9 @@ type Title struct {
|
|||
// Tags Array of localized tags
|
||||
Tags Tags `json:"tags"`
|
||||
|
||||
// TitleDesc Localized description. Key = language (ISO 639-1), value = description.
|
||||
TitleDesc *map[string]string `json:"title_desc,omitempty"`
|
||||
|
||||
// TitleNames Localized titles. Key = language (ISO 639-1), value = list of names
|
||||
TitleNames map[string][]string `json:"title_names"`
|
||||
|
||||
|
|
@ -178,6 +184,9 @@ type UserTitleStatus string
|
|||
// Cursor defines model for cursor.
|
||||
type Cursor = string
|
||||
|
||||
// PostMediaUploadMultipartBody defines parameters for PostMediaUpload.
|
||||
type PostMediaUploadMultipartBody = interface{}
|
||||
|
||||
// GetTitlesParams defines parameters for GetTitles.
|
||||
type GetTitlesParams struct {
|
||||
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
||||
|
|
@ -201,6 +210,15 @@ type GetTitleParams struct {
|
|||
Fields *string `form:"fields,omitempty" json:"fields,omitempty"`
|
||||
}
|
||||
|
||||
// GetUsersParams defines parameters for GetUsers.
|
||||
type GetUsersParams struct {
|
||||
Word *string `form:"word,omitempty" json:"word,omitempty"`
|
||||
Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`
|
||||
|
||||
// CursorId pass cursor naked
|
||||
CursorId *int32 `form:"cursor_id,omitempty" json:"cursor_id,omitempty"`
|
||||
}
|
||||
|
||||
// GetUsersIdParams defines parameters for GetUsersId.
|
||||
type GetUsersIdParams struct {
|
||||
Fields *string `form:"fields,omitempty" json:"fields,omitempty"`
|
||||
|
|
@ -244,7 +262,8 @@ type GetUserTitlesParams struct {
|
|||
|
||||
// AddUserTitleJSONBody defines parameters for AddUserTitle.
|
||||
type AddUserTitleJSONBody struct {
|
||||
Rate *int32 `json:"rate,omitempty"`
|
||||
Ftime *time.Time `json:"ftime,omitempty"`
|
||||
Rate *int32 `json:"rate,omitempty"`
|
||||
|
||||
// Status User's title status
|
||||
Status UserTitleStatus `json:"status"`
|
||||
|
|
@ -253,12 +272,16 @@ type AddUserTitleJSONBody struct {
|
|||
|
||||
// UpdateUserTitleJSONBody defines parameters for UpdateUserTitle.
|
||||
type UpdateUserTitleJSONBody struct {
|
||||
Rate *int32 `json:"rate,omitempty"`
|
||||
Ftime *time.Time `json:"ftime,omitempty"`
|
||||
Rate *int32 `json:"rate,omitempty"`
|
||||
|
||||
// Status User's title status
|
||||
Status *UserTitleStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// PostMediaUploadMultipartRequestBody defines body for PostMediaUpload for multipart/form-data ContentType.
|
||||
type PostMediaUploadMultipartRequestBody = PostMediaUploadMultipartBody
|
||||
|
||||
// UpdateUserJSONRequestBody defines body for UpdateUser for application/json ContentType.
|
||||
type UpdateUserJSONRequestBody UpdateUserJSONBody
|
||||
|
||||
|
|
@ -270,12 +293,18 @@ type UpdateUserTitleJSONRequestBody UpdateUserTitleJSONBody
|
|||
|
||||
// ServerInterface represents all server handlers.
|
||||
type ServerInterface interface {
|
||||
// Upload an image (PNG, JPEG, or WebP)
|
||||
// (POST /media/upload)
|
||||
PostMediaUpload(c *gin.Context)
|
||||
// Get titles
|
||||
// (GET /titles)
|
||||
GetTitles(c *gin.Context, params GetTitlesParams)
|
||||
// Get title description
|
||||
// (GET /titles/{title_id})
|
||||
GetTitle(c *gin.Context, titleId int64, params GetTitleParams)
|
||||
// Search user by nickname or dispname (both in one param), response is always sorted by id
|
||||
// (GET /users/)
|
||||
GetUsers(c *gin.Context, params GetUsersParams)
|
||||
// Get user info
|
||||
// (GET /users/{user_id})
|
||||
GetUsersId(c *gin.Context, userId string, params GetUsersIdParams)
|
||||
|
|
@ -308,6 +337,19 @@ type ServerInterfaceWrapper struct {
|
|||
|
||||
type MiddlewareFunc func(c *gin.Context)
|
||||
|
||||
// PostMediaUpload operation middleware
|
||||
func (siw *ServerInterfaceWrapper) PostMediaUpload(c *gin.Context) {
|
||||
|
||||
for _, middleware := range siw.HandlerMiddlewares {
|
||||
middleware(c)
|
||||
if c.IsAborted() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
siw.Handler.PostMediaUpload(c)
|
||||
}
|
||||
|
||||
// GetTitles operation middleware
|
||||
func (siw *ServerInterfaceWrapper) GetTitles(c *gin.Context) {
|
||||
|
||||
|
|
@ -459,6 +501,48 @@ func (siw *ServerInterfaceWrapper) GetTitle(c *gin.Context) {
|
|||
siw.Handler.GetTitle(c, titleId, params)
|
||||
}
|
||||
|
||||
// GetUsers operation middleware
|
||||
func (siw *ServerInterfaceWrapper) GetUsers(c *gin.Context) {
|
||||
|
||||
var err error
|
||||
|
||||
// Parameter object where we will unmarshal all parameters from the context
|
||||
var params GetUsersParams
|
||||
|
||||
// ------------- Optional query parameter "word" -------------
|
||||
|
||||
err = runtime.BindQueryParameter("form", true, false, "word", c.Request.URL.Query(), ¶ms.Word)
|
||||
if err != nil {
|
||||
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter word: %w", err), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
// ------------- Optional query parameter "limit" -------------
|
||||
|
||||
err = runtime.BindQueryParameter("form", true, false, "limit", c.Request.URL.Query(), ¶ms.Limit)
|
||||
if err != nil {
|
||||
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter limit: %w", err), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
// ------------- Optional query parameter "cursor_id" -------------
|
||||
|
||||
err = runtime.BindQueryParameter("form", true, false, "cursor_id", c.Request.URL.Query(), ¶ms.CursorId)
|
||||
if err != nil {
|
||||
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter cursor_id: %w", err), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
for _, middleware := range siw.HandlerMiddlewares {
|
||||
middleware(c)
|
||||
if c.IsAborted() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
siw.Handler.GetUsers(c, params)
|
||||
}
|
||||
|
||||
// GetUsersId operation middleware
|
||||
func (siw *ServerInterfaceWrapper) GetUsersId(c *gin.Context) {
|
||||
|
||||
|
|
@ -797,8 +881,10 @@ func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options
|
|||
ErrorHandler: errorHandler,
|
||||
}
|
||||
|
||||
router.POST(options.BaseURL+"/media/upload", wrapper.PostMediaUpload)
|
||||
router.GET(options.BaseURL+"/titles", wrapper.GetTitles)
|
||||
router.GET(options.BaseURL+"/titles/:title_id", wrapper.GetTitle)
|
||||
router.GET(options.BaseURL+"/users/", wrapper.GetUsers)
|
||||
router.GET(options.BaseURL+"/users/:user_id", wrapper.GetUsersId)
|
||||
router.PATCH(options.BaseURL+"/users/:user_id", wrapper.UpdateUser)
|
||||
router.GET(options.BaseURL+"/users/:user_id/titles", wrapper.GetUserTitles)
|
||||
|
|
@ -808,6 +894,49 @@ func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options
|
|||
router.PATCH(options.BaseURL+"/users/:user_id/titles/:title_id", wrapper.UpdateUserTitle)
|
||||
}
|
||||
|
||||
type PostMediaUploadRequestObject struct {
|
||||
Body io.Reader
|
||||
MultipartBody *multipart.Reader
|
||||
}
|
||||
|
||||
type PostMediaUploadResponseObject interface {
|
||||
VisitPostMediaUploadResponse(w http.ResponseWriter) error
|
||||
}
|
||||
|
||||
type PostMediaUpload200JSONResponse Image
|
||||
|
||||
func (response PostMediaUpload200JSONResponse) VisitPostMediaUploadResponse(w http.ResponseWriter) error {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(200)
|
||||
|
||||
return json.NewEncoder(w).Encode(response)
|
||||
}
|
||||
|
||||
type PostMediaUpload400JSONResponse string
|
||||
|
||||
func (response PostMediaUpload400JSONResponse) VisitPostMediaUploadResponse(w http.ResponseWriter) error {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(400)
|
||||
|
||||
return json.NewEncoder(w).Encode(response)
|
||||
}
|
||||
|
||||
type PostMediaUpload415Response struct {
|
||||
}
|
||||
|
||||
func (response PostMediaUpload415Response) VisitPostMediaUploadResponse(w http.ResponseWriter) error {
|
||||
w.WriteHeader(415)
|
||||
return nil
|
||||
}
|
||||
|
||||
type PostMediaUpload500Response struct {
|
||||
}
|
||||
|
||||
func (response PostMediaUpload500Response) VisitPostMediaUploadResponse(w http.ResponseWriter) error {
|
||||
w.WriteHeader(500)
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetTitlesRequestObject struct {
|
||||
Params GetTitlesParams
|
||||
}
|
||||
|
|
@ -904,6 +1033,52 @@ func (response GetTitle500Response) VisitGetTitleResponse(w http.ResponseWriter)
|
|||
return nil
|
||||
}
|
||||
|
||||
type GetUsersRequestObject struct {
|
||||
Params GetUsersParams
|
||||
}
|
||||
|
||||
type GetUsersResponseObject interface {
|
||||
VisitGetUsersResponse(w http.ResponseWriter) error
|
||||
}
|
||||
|
||||
type GetUsers200JSONResponse struct {
|
||||
Cursor int64 `json:"cursor"`
|
||||
|
||||
// Data List of users
|
||||
Data []User `json:"data"`
|
||||
}
|
||||
|
||||
func (response GetUsers200JSONResponse) VisitGetUsersResponse(w http.ResponseWriter) error {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(200)
|
||||
|
||||
return json.NewEncoder(w).Encode(response)
|
||||
}
|
||||
|
||||
type GetUsers204Response struct {
|
||||
}
|
||||
|
||||
func (response GetUsers204Response) VisitGetUsersResponse(w http.ResponseWriter) error {
|
||||
w.WriteHeader(204)
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetUsers400Response struct {
|
||||
}
|
||||
|
||||
func (response GetUsers400Response) VisitGetUsersResponse(w http.ResponseWriter) error {
|
||||
w.WriteHeader(400)
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetUsers500Response struct {
|
||||
}
|
||||
|
||||
func (response GetUsers500Response) VisitGetUsersResponse(w http.ResponseWriter) error {
|
||||
w.WriteHeader(500)
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetUsersIdRequestObject struct {
|
||||
UserId string `json:"user_id"`
|
||||
Params GetUsersIdParams
|
||||
|
|
@ -1299,12 +1474,18 @@ func (response UpdateUserTitle500Response) VisitUpdateUserTitleResponse(w http.R
|
|||
|
||||
// StrictServerInterface represents all server handlers.
|
||||
type StrictServerInterface interface {
|
||||
// Upload an image (PNG, JPEG, or WebP)
|
||||
// (POST /media/upload)
|
||||
PostMediaUpload(ctx context.Context, request PostMediaUploadRequestObject) (PostMediaUploadResponseObject, error)
|
||||
// Get titles
|
||||
// (GET /titles)
|
||||
GetTitles(ctx context.Context, request GetTitlesRequestObject) (GetTitlesResponseObject, error)
|
||||
// Get title description
|
||||
// (GET /titles/{title_id})
|
||||
GetTitle(ctx context.Context, request GetTitleRequestObject) (GetTitleResponseObject, error)
|
||||
// Search user by nickname or dispname (both in one param), response is always sorted by id
|
||||
// (GET /users/)
|
||||
GetUsers(ctx context.Context, request GetUsersRequestObject) (GetUsersResponseObject, error)
|
||||
// Get user info
|
||||
// (GET /users/{user_id})
|
||||
GetUsersId(ctx context.Context, request GetUsersIdRequestObject) (GetUsersIdResponseObject, error)
|
||||
|
|
@ -1340,6 +1521,43 @@ type strictHandler struct {
|
|||
middlewares []StrictMiddlewareFunc
|
||||
}
|
||||
|
||||
// PostMediaUpload operation middleware
|
||||
func (sh *strictHandler) PostMediaUpload(ctx *gin.Context) {
|
||||
var request PostMediaUploadRequestObject
|
||||
|
||||
if strings.HasPrefix(ctx.GetHeader("Content-Type"), "encoding") {
|
||||
request.Body = ctx.Request.Body
|
||||
}
|
||||
if strings.HasPrefix(ctx.GetHeader("Content-Type"), "multipart/form-data") {
|
||||
if reader, err := ctx.Request.MultipartReader(); err == nil {
|
||||
request.MultipartBody = reader
|
||||
} else {
|
||||
ctx.Error(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
||||
return sh.ssi.PostMediaUpload(ctx, request.(PostMediaUploadRequestObject))
|
||||
}
|
||||
for _, middleware := range sh.middlewares {
|
||||
handler = middleware(handler, "PostMediaUpload")
|
||||
}
|
||||
|
||||
response, err := handler(ctx, request)
|
||||
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
ctx.Status(http.StatusInternalServerError)
|
||||
} else if validResponse, ok := response.(PostMediaUploadResponseObject); ok {
|
||||
if err := validResponse.VisitPostMediaUploadResponse(ctx.Writer); err != nil {
|
||||
ctx.Error(err)
|
||||
}
|
||||
} else if response != nil {
|
||||
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
||||
}
|
||||
}
|
||||
|
||||
// GetTitles operation middleware
|
||||
func (sh *strictHandler) GetTitles(ctx *gin.Context, params GetTitlesParams) {
|
||||
var request GetTitlesRequestObject
|
||||
|
|
@ -1395,6 +1613,33 @@ func (sh *strictHandler) GetTitle(ctx *gin.Context, titleId int64, params GetTit
|
|||
}
|
||||
}
|
||||
|
||||
// GetUsers operation middleware
|
||||
func (sh *strictHandler) GetUsers(ctx *gin.Context, params GetUsersParams) {
|
||||
var request GetUsersRequestObject
|
||||
|
||||
request.Params = params
|
||||
|
||||
handler := func(ctx *gin.Context, request interface{}) (interface{}, error) {
|
||||
return sh.ssi.GetUsers(ctx, request.(GetUsersRequestObject))
|
||||
}
|
||||
for _, middleware := range sh.middlewares {
|
||||
handler = middleware(handler, "GetUsers")
|
||||
}
|
||||
|
||||
response, err := handler(ctx, request)
|
||||
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
ctx.Status(http.StatusInternalServerError)
|
||||
} else if validResponse, ok := response.(GetUsersResponseObject); ok {
|
||||
if err := validResponse.VisitGetUsersResponse(ctx.Writer); err != nil {
|
||||
ctx.Error(err)
|
||||
}
|
||||
} else if response != nil {
|
||||
ctx.Error(fmt.Errorf("unexpected response type: %T", response))
|
||||
}
|
||||
}
|
||||
|
||||
// GetUsersId operation middleware
|
||||
func (sh *strictHandler) GetUsersId(ctx *gin.Context, userId string, params GetUsersIdParams) {
|
||||
var request GetUsersIdRequestObject
|
||||
|
|
|
|||
|
|
@ -11,13 +11,17 @@ paths:
|
|||
$ref: "./paths/titles.yaml"
|
||||
/titles/{title_id}:
|
||||
$ref: "./paths/titles-id.yaml"
|
||||
/users/:
|
||||
$ref: "./paths/users.yaml"
|
||||
/users/{user_id}:
|
||||
$ref: "./paths/users-id.yaml"
|
||||
/users/{user_id}/titles:
|
||||
$ref: "./paths/users-id-titles.yaml"
|
||||
/users/{user_id}/titles/{title_id}:
|
||||
$ref: "./paths/users-id-titles-id.yaml"
|
||||
|
||||
/media/upload:
|
||||
$ref: "./paths/media_upload.yaml"
|
||||
|
||||
components:
|
||||
parameters:
|
||||
$ref: "./parameters/_index.yaml"
|
||||
|
|
|
|||
37
api/paths/media_upload.yaml
Normal file
37
api/paths/media_upload.yaml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
post:
|
||||
summary: Upload an image (PNG, JPEG, or WebP)
|
||||
description: |
|
||||
Uploads a single image file. Supported formats: **PNG**, **JPEG/JPG**, **WebP**.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
image:
|
||||
type: string
|
||||
format: binary
|
||||
description: Image file (PNG, JPEG, or WebP)
|
||||
encoding:
|
||||
image:
|
||||
contentType: image/png, image/jpeg, image/webp
|
||||
|
||||
responses:
|
||||
'200':
|
||||
description: Image uploaded successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../schemas/Image.yaml"
|
||||
'400':
|
||||
description: Bad request — e.g., invalid/malformed image, empty file
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
'415':
|
||||
description: |
|
||||
Unsupported Media Type — e.g., request `Content-Type` is not `multipart/form-data`,
|
||||
or the `image` part has an unsupported `Content-Type` (not image/png, image/jpeg, or image/webp)
|
||||
|
||||
'500':
|
||||
description: Internal server error
|
||||
|
|
@ -61,6 +61,9 @@ patch:
|
|||
rate:
|
||||
type: integer
|
||||
format: int32
|
||||
ftime:
|
||||
type: string
|
||||
format: date-time
|
||||
responses:
|
||||
'200':
|
||||
description: Title successfully updated
|
||||
|
|
|
|||
|
|
@ -122,6 +122,9 @@ post:
|
|||
rate:
|
||||
type: integer
|
||||
format: int32
|
||||
ftime:
|
||||
type: string
|
||||
format: date-time
|
||||
responses:
|
||||
'200':
|
||||
description: Title successfully added to user
|
||||
|
|
|
|||
46
api/paths/users.yaml
Normal file
46
api/paths/users.yaml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
get:
|
||||
summary: Search user by nickname or dispname (both in one param), response is always sorted by id
|
||||
parameters:
|
||||
- in: query
|
||||
name: word
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 10
|
||||
- in: query
|
||||
name: cursor_id
|
||||
description: pass cursor naked
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 1
|
||||
responses:
|
||||
'200':
|
||||
description: List of users with cursor
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '../schemas/User.yaml'
|
||||
description: List of users
|
||||
cursor:
|
||||
type: integer
|
||||
format: int64
|
||||
default: 1
|
||||
required:
|
||||
- data
|
||||
- cursor
|
||||
'204':
|
||||
description: No users found
|
||||
'400':
|
||||
description: Request params are not correct
|
||||
'500':
|
||||
description: Unknown server error
|
||||
|
|
@ -30,6 +30,11 @@ properties:
|
|||
- Титаны
|
||||
ja:
|
||||
- 進撃の巨人
|
||||
title_desc:
|
||||
type: object
|
||||
description: Localized description. Key = language (ISO 639-1), value = description.
|
||||
additionalProperties:
|
||||
type: string
|
||||
studio:
|
||||
$ref: ./Studio.yaml
|
||||
tags:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue