1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/sangtian152-vue-ts-admin

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Это зеркальный репозиторий, синхронизируется ежедневно с исходного репозитория.
Клонировать/Скачать
swagger.yml 24 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
sangtian152 Отправлено 4 лет назад 00021a4
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925
openapi: 3.0.0
info:
description: Mock API for vue-typescript-admin-template.
version: 1.0.0
title: Mock API
contact:
email: armourcy@email.com
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: /mock-api/v1
tags:
- name: articles
description: Articles data related api.
- name: roles
description: Roles related api.
- name: transactions
description: Transactions data related api.
- name: users
description: Users related api.
paths:
/articles:
get:
tags:
- articles
summary: Get Article List
description: Return a list of articles.
operationId: getArticles
parameters:
- name: importance
in: query
description: Used to filter articles by importance.
schema:
$ref: '#/components/schemas/Article/properties/importance'
- name: title
in: query
description: Used to filter articles by matched title substring.
schema:
$ref: '#/components/schemas/Article/properties/title'
- name: type
in: query
description: Used to filter articles by type.
schema:
$ref: '#/components/schemas/Article/properties/type'
- name: page
in: query
description: The wanted page number (one page).
schema:
type: integer
format: int32
minimum: 1
- name: limit
in: query
description: The maximum number of articles returned for one page.
schema:
type: integer
format: int32
minimum: 0
maximum: 50
- name: sort
in: query
description: Optional sorting order for articles.
schema:
type: string
enum:
- +id
- -id
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
total:
type: integer
format: int32
items:
type: array
items:
$ref: '#/components/schemas/Article'
post:
tags:
- articles
summary: Create New Article
description: Create a new article.
operationId: createArticle
security:
- AccessTokenAuth: []
parameters:
- name: article
in: query
required: true
description: The data for new article.
schema:
$ref: '#/components/schemas/Article'
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
article:
$ref: '#/components/schemas/Article'
401:
$ref: '#/components/responses/Unauthorized'
/articles/{id}:
get:
tags:
- articles
summary: Get Article Detail
description: Get article detail by ID.
operationId: getArticle
security:
- AccessTokenAuth: []
parameters:
- name: id
in: path
required: true
description: Article id.
schema:
type: integer
format: int64
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
article:
$ref: '#/components/schemas/Article'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
put:
tags:
- articles
summary: Update Article Detail
description: Update article deatail by ID.
operationId: updateArticle
security:
- AccessTokenAuth: []
parameters:
- name: id
in: path
required: true
description: Article id.
schema:
type: integer
format: int64
- name: article
in: query
required: true
description: data for the updated article.
schema:
$ref: '#/components/schemas/Article'
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
article:
$ref: '#/components/schemas/Article'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
delete:
tags:
- articles
summary: Delete Article
description: Delete article by ID.
operationId: deleteArticle
security:
- AccessTokenAuth: []
parameters:
- name: id
in: path
required: true
description: Article id.
schema:
type: integer
format: int64
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/pageviews:
get:
tags:
- articles
summary: Get Pageviews Data
description: Return a list of pageviews for each platforms.
operationId: getPageviews
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
pageviews:
type: array
items:
$ref: '#/components/schemas/Pageviews'
/transactions:
get:
tags:
- transactions
summary: Get Transaction List
description: Return a list of transaction.
operationId: getTransactions
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
total:
type: integer
format: int32
items:
type: array
items:
$ref: '#/components/schemas/Transaction'
/roles:
get:
tags:
- roles
summary: Get Role List
description: Return a list of roles.
operationId: getRoles
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
total:
type: integer
format: int32
items:
type: array
items:
$ref: '#/components/schemas/Role'
post:
tags:
- roles
summary: Create New Role
description: Create a new role.
operationId: createRole
security:
- AccessTokenAuth: []
parameters:
- name: role
in: query
required: true
description: The data for new role.
schema:
$ref: '#/components/schemas/Role'
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
key:
type: integer
format: int64
401:
$ref: '#/components/responses/Unauthorized'
/roles/{id}:
put:
tags:
- roles
summary: Update Role Detail
description: Update role deatail by ID.
operationId: updateRole
security:
- AccessTokenAuth: []
parameters:
- name: id
in: path
required: true
description: Role id (key).
schema:
type: integer
format: int64
- name: role
in: query
required: true
description: The data for updated role.
schema:
$ref: '#/components/schemas/Role'
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
role:
$ref: '#/components/schemas/Role'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
delete:
tags:
- roles
summary: Delete Role
description: Delete role by ID.
operationId: deleteRole
security:
- AccessTokenAuth: []
parameters:
- name: id
in: path
required: true
description: Role id (key).
schema:
type: integer
format: int64
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/routes:
get:
tags:
- roles
summary: Get Routes Data
description: Return routes object.
operationId: getRoutes
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
routes:
$ref: '#/components/schemas/Role/properties/routes'
/users:
get:
tags:
- users
summary: Get users list
description: Return a list of users
operationId: getUsers
security:
- AccessTokenAuth: []
parameters:
- name: name
in: query
description: Used to filter users by matched username substring
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/User'
401:
$ref: '#/components/responses/Unauthorized'
/users/register:
post:
tags:
- users
summary: Create user
description: This can only be done by the logged in user.
operationId: register
parameters:
- name: user
in: query
required: true
description: The data for created user.
schema:
$ref: '#/components/schemas/User'
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
/users/login:
post:
tags:
- users
summary: Logs user into the system
description: Use username and password to login.
operationId: login
parameters:
- name: username
in: query
required: true
description: The user name for login.
schema:
$ref: '#/components/schemas/User/properties/username'
- name: password
in: query
required: true
description: The password for login in clear text.
schema:
$ref: '#/components/schemas/User/properties/password'
responses:
200:
description: OK
headers:
X-Rate-Limit:
schema:
type: integer
format: int32
description: calls per hour allowed by the user.
X-Expires-After:
schema:
type: string
format: date-time
description: date in UTC when token expires.
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
accessToken:
type: string
example: admin-token
400:
$ref: '#/components/responses/InvalidUser'
/users/logout:
post:
tags:
- users
summary: Logs out current logged in user session
description: Log out current session.
operationId: logout
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
/users/{username}:
get:
tags:
- users
summary: Get user by user name
description: Get user by user name.
operationId: getUserByName
security:
- AccessTokenAuth: []
parameters:
- name: username
in: path
required: true
description: The name that needs to be fetched.
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
user:
$ref: '#/components/schemas/User'
400:
$ref: '#/components/responses/InvalidUser'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
put:
tags:
- users
summary: Updated user
description: This can only be done by the logged in user.
operationId: updateUser
security:
- AccessTokenAuth: []
parameters:
- name: username
in: path
required: true
description: Name that need to be updated.
schema:
type: string
- name: user
in: query
required: true
description: The data for updated user.
schema:
$ref: "#/components/schemas/User"
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
user:
$ref: '#/components/schemas/User'
400:
$ref: '#/components/responses/InvalidUser'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
delete:
tags:
- users
summary: Delete user
description: This can only be done by the logged in user.
operationId: deleteUser
security:
- AccessTokenAuth: []
parameters:
- name: username
in: path
required: true
description: The name that needs to be deleted.
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
400:
$ref: '#/components/responses/InvalidUser'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/users/info:
post:
tags:
- users
summary: Get current user info
description: This can only be done by the logged in user.
operationId: getUserInfo
security:
- AccessTokenAuth: []
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
data:
type: object
properties:
user:
$ref: '#/components/schemas/User'
401:
$ref: '#/components/responses/Unauthorized'
components:
securitySchemes:
AccessTokenAuth:
type: apiKey
in: header
name: X-Access-Token
responses:
NotFound:
description: The specified resource was not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
InvalidUser:
description: Invalid username supplied
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
Error:
type: object
properties:
code:
type: string
message:
type: string
required:
- code
- message
Article:
type: object
properties:
id:
type: integer
format: int64
status:
type: string
enum:
- draft
- published
- deleted
title:
type: string
example: IG Won World Championship
abstractContent:
type: string
example: Invictus Gaming sweeps Fnatic 3-0 to win League of Legends World Championship
fullContent:
type: string
example: Article details goes here...
sourceURL:
type: string
format: url
example: http://www.espn.com/esports/story/_/id/25164094/invictus-gaming-sweeps-fnatic-3-0-win-league-legends-world-championship
imageURL:
type: string
format: url
example: https://a1.espncdn.com/combiner/i?img=%2Fphoto%2F2018%2F1103%2Fr458060_1296x729_16%2D9.jpg&w=920&h=518&scale=crop&cquality=80&location=origin&format=jpg
timestamp:
$ref: '#/components/schemas/Timestamp'
platforms:
type: array
items:
type: string
enum:
- a-platform
- b-platform
- c-platform
uniqueItems: true
disableComment:
type: boolean
example: false
importance:
type: integer
format: int32
enum:
- 1
- 2
- 3
author:
type: string
example: Chong Guo
reviewer:
type: string
example: Chong Guo
type:
type: string
enum:
- CN
- US
- JP
- EU
pageviews:
$ref: '#/components/schemas/Pageviews/properties/pageviews'
required:
- id
- status
- title
- timestamp
- importance
- author
Pageviews:
type: object
properties:
key:
type: string
enum:
- PC
- Mobile
- iOS
- Android
pageviews:
type: integer
format: int32
example: 1024
required:
- key
- pageviews
Transaction:
type: object
properties:
orderId:
type: string
format: uuid
timestamp:
$ref: '#/components/schemas/Timestamp'
username:
type: string
example: Chong Guo
price:
type: number
format: double
status:
type: string
enum:
- success
- pending
required:
- orderId
- timestamp
- username
- price
- status
Role:
type: object
properties:
key:
type: string
example: admin
name:
type: string
example: admin
description:
type: string
example: Super Administrator. Have access to view all pages.
routes:
$ref: '#/components/schemas/AnyValue'
required:
- key
- name
- routes
User:
type: object
properties:
id:
type: integer
format: int64
username:
type: string
example: Armour
password:
type: string
example: 12345678
name:
type: string
example: Chong Guo
email:
type: string
example: armourcy@gmail.com
phone:
type: string
example: 18888888888
avatar:
type: string
format: url
introduction:
type: string
example: Always Sunshine
roles:
type: array
items:
$ref: '#/components/schemas/Role/properties/key'
required:
- id
- username
- password
- roles
Timestamp:
oneOf:
- type: integer
format: int32
example: 1559605283
- type: string
format: date-time
example: 2017-07-21T17:32:28Z
AnyValue: {}

Комментарий ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/sangtian152-vue-ts-admin.git
git@gitlife.ru:oschina-mirror/sangtian152-vue-ts-admin.git
oschina-mirror
sangtian152-vue-ts-admin
sangtian152-vue-ts-admin
master