Files
sponge/docs/swagger.yaml
2024-02-08 16:35:33 +08:00

544 lines
13 KiB
YAML

definitions:
github_com_zhufuyi_sponge_internal_types.Column:
properties:
exp:
description: expressions, which default to = when the value is null, have
=, !=, >, >=, <, <=, like
type: string
logic:
description: logical type, defaults to and when value is null, only &(and),
||(or)
type: string
name:
description: column name
type: string
value:
description: column value
type: object
github_com_zhufuyi_sponge_internal_types.Conditions:
properties:
columns:
description: columns info
items:
$ref: '#/definitions/github_com_zhufuyi_sponge_internal_types.Column'
type: array
type: object
github_com_zhufuyi_sponge_internal_types.Params:
properties:
columns:
description: query conditions
items:
$ref: '#/definitions/github_com_zhufuyi_sponge_internal_types.Column'
type: array
page:
description: page number, starting from page 0
type: integer
size:
description: lines per page
type: integer
sort:
description: sorted fields, multi-column sorting separated by commas
type: string
type: object
handlerfunc.checkHealthResponse:
properties:
hostname:
type: string
status:
type: string
type: object
types.CreateUserExampleRequest:
properties:
age:
description: age
type: integer
avatar:
description: avatar
minLength: 5
type: string
email:
description: email
type: string
gender:
description: gender, 1:Male, 2:Female, other values:unknown
maximum: 2
minimum: 0
type: integer
name:
description: username
minLength: 2
type: string
password:
description: password
type: string
phone:
description: phone number, e164 rules, e.g. +8612345678901
type: string
type: object
types.CreateUserExampleRespond:
properties:
code:
description: return code
type: integer
data:
description: return data
properties:
id:
description: id
type: integer
type: object
msg:
description: return information description
type: string
type: object
types.DeleteUserExampleByIDRespond:
properties:
code:
description: return code
type: integer
data:
description: return data
msg:
description: return information description
type: string
type: object
types.DeleteUserExamplesByIDsRequest:
properties:
ids:
description: id list
items:
type: integer
minItems: 1
type: array
type: object
types.DeleteUserExamplesByIDsRespond:
properties:
code:
description: return code
type: integer
data:
description: return data
msg:
description: return information description
type: string
type: object
types.GetUserExampleByConditionRespond:
properties:
code:
description: return code
type: integer
data:
description: return data
properties:
userExample:
$ref: '#/definitions/types.UserExampleObjDetail'
type: object
msg:
description: return information description
type: string
type: object
types.GetUserExampleByIDRespond:
properties:
code:
description: return code
type: integer
data:
description: return data
properties:
userExample:
$ref: '#/definitions/types.UserExampleObjDetail'
type: object
msg:
description: return information description
type: string
type: object
types.ListUserExamplesByIDsRequest:
properties:
ids:
description: id list
items:
type: integer
minItems: 1
type: array
type: object
types.ListUserExamplesByIDsRespond:
properties:
code:
description: return code
type: integer
data:
description: return data
properties:
userExamples:
items:
$ref: '#/definitions/types.UserExampleObjDetail'
type: array
type: object
msg:
description: return information description
type: string
type: object
types.ListUserExamplesRespond:
properties:
code:
description: return code
type: integer
data:
description: return data
properties:
userExamples:
items:
$ref: '#/definitions/types.UserExampleObjDetail'
type: array
type: object
msg:
description: return information description
type: string
type: object
types.UpdateUserExampleByIDRequest:
properties:
age:
description: age
type: integer
avatar:
description: avatar
type: string
email:
description: email
type: string
gender:
description: gender, 1:Male, 2:Female, other values:unknown
type: integer
id:
description: id
type: integer
name:
description: username
type: string
password:
description: password
type: string
phone:
description: phone number
type: string
type: object
types.UpdateUserExampleByIDRespond:
properties:
code:
description: return code
type: integer
data:
description: return data
msg:
description: return information description
type: string
type: object
types.UserExampleObjDetail:
properties:
age:
description: age
type: integer
avatar:
description: avatar
type: string
createdAt:
description: create time
type: string
email:
description: email
type: string
gender:
description: gender, 1:Male, 2:Female, other values:unknown
type: integer
id:
description: id
type: string
loginAt:
description: login timestamp
type: integer
name:
description: username
type: string
phone:
description: phone number
type: string
status:
description: account status, 1:inactive, 2:activated, 3:blocked
type: integer
updatedAt:
description: update time
type: string
type: object
host: localhost:8080
info:
contact: {}
description: http server api docs
title: serverNameExample api docs
version: "2.0"
paths:
/api/v1/userExample:
post:
consumes:
- application/json
description: submit information to create userExample
parameters:
- description: userExample information
in: body
name: data
required: true
schema:
$ref: '#/definitions/types.CreateUserExampleRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.CreateUserExampleRespond'
summary: create userExample
tags:
- userExample
/api/v1/userExample/{id}:
delete:
consumes:
- application/json
description: delete userExample by id
parameters:
- description: id
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.DeleteUserExampleByIDRespond'
summary: delete userExample
tags:
- userExample
get:
consumes:
- application/json
description: get userExample detail by id
parameters:
- description: id
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.GetUserExampleByIDRespond'
summary: get userExample detail
tags:
- userExample
put:
consumes:
- application/json
description: update userExample information by id
parameters:
- description: id
in: path
name: id
required: true
type: string
- description: userExample information
in: body
name: data
required: true
schema:
$ref: '#/definitions/types.UpdateUserExampleByIDRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.UpdateUserExampleByIDRespond'
summary: update userExample
tags:
- userExample
/api/v1/userExample/condition:
post:
consumes:
- application/json
description: get userExample by condition
parameters:
- description: query condition
in: body
name: data
required: true
schema:
$ref: '#/definitions/github_com_zhufuyi_sponge_internal_types.Conditions'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.GetUserExampleByConditionRespond'
summary: get userExample by condition
tags:
- userExample
/api/v1/userExample/delete/ids:
post:
consumes:
- application/json
description: delete userExamples by batch id
parameters:
- description: id array
in: body
name: data
required: true
schema:
$ref: '#/definitions/types.DeleteUserExamplesByIDsRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.DeleteUserExamplesByIDsRespond'
summary: delete userExamples
tags:
- userExample
/api/v1/userExample/list:
get:
consumes:
- application/json
description: list of userExamples by last id and limit
parameters:
- description: last id, default is MaxInt32
in: query
name: lastID
required: true
type: integer
- default: 10
description: size in each page
in: query
name: limit
type: integer
- default: -id
description: 'sort by column name of table, and the '
in: query
name: sort
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.ListUserExamplesRespond'
summary: list of userExamples by last id and limit
tags:
- userExample
post:
consumes:
- application/json
description: list of userExamples by paging and conditions
parameters:
- description: query parameters
in: body
name: data
required: true
schema:
$ref: '#/definitions/github_com_zhufuyi_sponge_internal_types.Params'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.ListUserExamplesRespond'
summary: list of userExamples by query parameters
tags:
- userExample
/api/v1/userExample/list/ids:
post:
consumes:
- application/json
description: list of userExamples by batch id
parameters:
- description: id array
in: body
name: data
required: true
schema:
$ref: '#/definitions/types.ListUserExamplesByIDsRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.ListUserExamplesByIDsRespond'
summary: list of userExamples by batch id
tags:
- userExample
/codes:
get:
consumes:
- application/json
description: list error codes info
produces:
- application/json
responses: {}
summary: list error codes info
tags:
- system
/config:
get:
consumes:
- application/json
description: show config info
produces:
- application/json
responses: {}
summary: show config info
tags:
- system
/health:
get:
consumes:
- application/json
description: check health
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handlerfunc.checkHealthResponse'
summary: check health
tags:
- system
/ping:
get:
consumes:
- application/json
description: ping
produces:
- application/json
responses: {}
summary: ping
tags:
- system
schemes:
- http
- https
securityDefinitions:
BearerAuth:
description: Type "Bearer your-jwt-token" to Value
in: header
name: Authorization
type: apiKey
swagger: "2.0"