Skip to content

API Docs

xaxys edited this page Apr 3, 2022 · 5 revisions

For better visualization, please visit Maintainman Doc

/v1/announce/

GET

Summary

获取最新公告

Description

获取最新公告 分页 强制逆序 开始时间 结束时间 之内

Parameters
Name Located in Description Required Schema
offset query 偏移量 No integer
limit query 每页数据量 No integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

POST

Summary

创建公告

Description

创建公告

Parameters
Name Located in Description Required Schema
body body 创建公告请求 Yes model.CreateAnnounceRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/announce/all

GET

Summary

获取公告列表

Description

获取公告列表 分页 可按标题 开始时间 结束时间 (时间之内|之外 两种模式)过滤

Parameters
Name Located in Description Required Schema
title query 标题 No string
start_time query 开始时间; unix timestamp in seconds (UTC); -1代表不限; 含本数 No string
end_time query 结束时间; unix timestamp in seconds (UTC); -1代表不限; 含本数 No string
inclusive query true: 查询开始时间晚于start,且结束时间早于end的(在某段时间内开始并结束的); false: 查询开始时间早于start,且结束时间晚于end的(在某段时间内都能看到的) No boolean
order_by query 排序字段 (默认为ID正序) 只接受 No string
offset query 偏移量 (默认为0) No integer
limit query 每页数据量 (默认为50) No integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/announce/{id}

GET

Summary

获取公告

Description

获取公告

Parameters
Name Located in Description Required Schema
id path 公告ID Yes integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

PUT

Summary

更新公告

Description

更新公告

Parameters
Name Located in Description Required Schema
id path 公告ID Yes integer
body body 更新公告请求 Yes model.UpdateAnnounceRequest
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

DELETE

Summary

删除公告

Description

删除公告

Parameters
Name Located in Description Required Schema
id path 公告ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/announce/{id}/hit

PUT

Summary

点击公告

Description

点击公告 增加点击量 默认单个用户单篇文章12h只能点击一次

Parameters
Name Located in Description Required Schema
id path 公告ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/comment/{id}

DELETE

Summary

删除评论

Description

删除评论 删除者必须是评论的创建者

Parameters
Name Located in Description Required Schema
id path 评论id Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/comment/{id}/force

DELETE

Summary

删除评论(管理员)

Description

删除评论

Parameters
Name Located in Description Required Schema
id path 评论id Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/division

POST

Summary

创建分组

Description

创建分组

Parameters
Name Located in Description Required Schema
body body 创建分组请求 Yes model.CreateDivisionRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/division/{id}

GET

Summary

获取某分组信息

Description

通过ID获取某分组信息

Parameters
Name Located in Description Required Schema
id path 分组ID Yes integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

PUT

Summary

更新分组

Description

更新分组

Parameters
Name Located in Description Required Schema
body body 更新分组请求 Yes model.UpdateDivisionRequest
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

DELETE

Summary

删除分组

Description

删除分组

Parameters
Name Located in Description Required Schema
id path 分组ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/item

GET

Summary

获取所有物品信息

Description

获取所有物品信息 分页

Parameters
Name Located in Description Required Schema
order_by query 排序字段 No string
offset query 偏移量 No integer
limit query 每页数据量 No integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

POST

Summary

创建物品

Description

创建物品

Parameters
Name Located in Description Required Schema
item body 物品信息 Yes model.CreateItemRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/item/{id}

GET

Summary

获取某ID物品信息

Description

通过ID获取某物品信息

Parameters
Name Located in Description Required Schema
id path 物品ID Yes integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

POST

Summary

添加物品数量(进货)

Description

添加物品数量(进货)

Parameters
Name Located in Description Required Schema
id path 物品ID Yes integer
body body 物品数量 Yes model.AddItemRequest
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

DELETE

Summary

删除物品

Description

删除物品

Parameters
Name Located in Description Required Schema
id path 物品ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/item/{name}

GET

Summary

获取某名称物品信息

Description

通过名称获取某物品信息

Parameters
Name Located in Description Required Schema
name path 物品名称 Yes string
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/item/{name}/fuzzy

GET

Summary

获取大概是某些名称的物品们的信息

Description

通过名称获取大概是某些名称的物品们的信息

Parameters
Name Located in Description Required Schema
name path 物品名称 Yes string
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/login

POST

Summary

用户登录

Description

用户登录

Parameters
Name Located in Description Required Schema
body body 登录信息 Yes model.LoginRequest
Responses
Code Description Schema
200 JWT Token model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order

POST

Summary

创建订单

Description

创建订单

Parameters
Name Located in Description Required Schema
body body 请求参数 Yes model.CreateOrderRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/all

GET

Summary

获取所有订单

Description

获取所有订单 分页 默认正序 可按照 标题 用户 订单状态 多个Tag(与|或 两种模式)过滤 状态 0:非法 1:待处理 2:已接单 3:已完成 4:上报中 5:挂单 6:已取消 7:已拒绝 8:已评价

Parameters
Name Located in Description Required Schema
title query 标题 No string
user_id query 用户ID No integer
status query 订单状态 0:非法 1:待处理 2:已接单 3:已完成 4:上报中 5:挂单 6:已取消 7:已拒绝 8:已评价 No string
tags query 若干 Tag 的 ID No [ string ]
conjunctve query true: 查询包含所有Tag的订单, false: 查询包含任一Tag的订单 No boolean
order_by query 排序字段 (默认为ID正序) 只接受 No string
offset query 偏移量 (默认为0) No integer
limit query 每页数据量 (默认为50) No integer
Responses
Code Description Schema
200 返回结果 带Tag model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/repairer

GET

Summary

获取当前维修工的订单

Description

获取当前维修工的订单 分页 默认逆序 可按照是否本人正在维修过滤

Parameters
Name Located in Description Required Schema
current query 是否本人正在维修 Yes boolean
order_by query 排序字段 (默认为ID正序) 只接受 No string
offset query 偏移量 (默认为0) No integer
limit query 每页数据量 (默认为50) No integer
Responses
Code Description Schema
200 返回结果 带Tag model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/repairer/{id}

GET

Summary

获取某维修工的订单

Description

通过维修工ID获取某维修工的订单 分页 默认逆序 可按照是否该人正在维修过滤

Parameters
Name Located in Description Required Schema
id path 维修工ID Yes integer
current query 是否本人正在维修 Yes boolean
order_by query 排序字段 (默认为ID正序) 只接受 No string
offset query 偏移量 (默认为0) No integer
limit query 每页数据量 (默认为50) No integer
Responses
Code Description Schema
200 返回结果 带Tag model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/user

GET

Summary

获取当前用户的订单

Description

获取当前用户的订单 分页 默认逆序 可按照订单状态过滤 状态 0:非法 1:待处理 2:已接单 3:已完成 4:上报中 5:挂单 6:已取消 7:已拒绝 8:已评价

Parameters
Name Located in Description Required Schema
status query 订单状态 0:非法 1:待处理 2:已接单 3:已完成 4:上报中 5:挂单 6:已取消 7:已拒绝 8:已评价 No integer
order_by query 排序字段 (默认为ID正序) 只接受 No string
offset query 偏移量 (默认为0) No integer
limit query 每页数据量 (默认为50) No integer
Responses
Code Description Schema
200 返回结果 带Tag model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}

GET

Summary

获取某个订单

Description

通过ID获取某个订单

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
Responses
Code Description Schema
200 返回结果 带Tag 带Comment model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

PUT

Summary

更新订单

Description

更新订单 操作者需为订单创建者

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
body body 请求参数 Yes model.UpdateOrderRequest
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/appraise

POST

Summary

评价订单

Description

评价订单 从 已完成 到 已评价

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
appraisal query 评价分数 Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/assign

POST

Summary

指派订单

Description

指派订单 从 待处理 到 已接单

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
repairer query 维修工ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/cancel

POST

Summary

取消订单

Description

取消订单 从 除已完成 已评价外的状态 到 已取消 操作者只能是订单创建者

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/comment

GET

Summary

获取订单的评论信息

Description

获取订单的评论信息 分页 操作者必须是订单的创建者 或 曾经被分配给该订单的维修工

Parameters
Name Located in Description Required Schema
id path 订单id Yes integer
order_by query 排序字段 No string
offset query 偏移量 No integer
limit query 每页数据量 No integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

POST

Summary

创建评论

Description

创建评论 创建者必须是订单的创建者 或 曾经被分配给该订单的维修工

Parameters
Name Located in Description Required Schema
id path 订单id Yes integer
body body 评论信息 Yes model.CreateCommentRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/comment/force

GET

Summary

获取订单的评论信息(管理员)

Description

获取任意订单的评论信息 分页

Parameters
Name Located in Description Required Schema
id path 订单id Yes integer
order_by query 排序字段 No string
offset query 偏移量 No integer
limit query 每页数据量 No integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

POST

Summary

创建评论(管理员)

Description

创建评论

Parameters
Name Located in Description Required Schema
id path 订单id Yes integer
body body 评论信息 Yes model.CreateCommentRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/complete

POST

Summary

完成订单

Description

完成订单 从 已接单 到 已完成 操作者只能是当前维修工

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/consume

POST

Summary

消耗物品数量(订单消耗)

Description

消耗物品数量(订单消耗)

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
body body 物品数量 Yes model.ConsumeItemRequest
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/force

PUT

Summary

更新订单(管理员)

Description

更新订单(管理员)

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
body body 请求参数 Yes model.UpdateOrderRequest
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/hold

POST

Summary

挂起订单

Description

挂起订单 从 待处理 到 挂单

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/reject

POST

Summary

拒绝订单

Description

拒绝订单 从 待处理 到 已拒绝

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/release

POST

Summary

释放订单

Description

释放订单 从 已接单 已完成 上报中 挂单 已拒绝 到 待处理

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/report

POST

Summary

上报订单

Description

上报订单 从 已接单 到 上报中 操作者只能是当前维修工

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/order/{id}/selfassign

POST

Summary

自指派订单

Description

自指派订单 从 待处理 到 已接单

Parameters
Name Located in Description Required Schema
id path 订单ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/permission/all

GET

Summary

获取所有权限信息

Description

获取所有权限信息 不分页

Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/permission/{name}

GET

Summary

获取当前用户权限信息

Description

获取当前用户权限信息

Parameters
Name Located in Description Required Schema
name path 权限名 Yes string
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/register

POST

Summary

用户注册

Description

用户注册

Parameters
Name Located in Description Required Schema
body body 注册信息 Yes model.RegisterUserRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/renew

GET

Summary

用户登录续期

Description

用户登录续期

Responses
Code Description Schema
200 JWT Token model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/role

GET

Summary

获取当前用户角色信息

Description

获取当前用户角色信息

Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

PUT

Summary

更新角色

Description

更新角色

Parameters
Name Located in Description Required Schema
body body 更新角色请求 Yes model.UpdateRoleRequest
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

POST

Summary

创建角色

Description

创建角色

Parameters
Name Located in Description Required Schema
body body 创建角色请求 Yes model.CreateRoleRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/role/all

GET

Summary

获取所有角色

Description

获取所有角色 不分页

Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/role/{name}

GET

Summary

获取某角色信息

Description

通过角色名获取某角色信息

Parameters
Name Located in Description Required Schema
name path 角色名 Yes string
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

DELETE

Summary

删除角色

Description

删除角色

Parameters
Name Located in Description Required Schema
name path 角色名 Yes string
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/role/{name}/default

PUT

Summary

设置默认角色

Description

设置默认角色(用户注册时的默认角色)

Parameters
Name Located in Description Required Schema
name path 角色名 Yes string
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/role/{name}/guest

PUT

Summary

设置游客角色

Description

设置游客角色(用户未登录时的默认角色)

Parameters
Name Located in Description Required Schema
name path 角色名 Yes string
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/tag

POST

Summary

创建标签

Description

创建标签

Parameters
Name Located in Description Required Schema
body body 创建标签请求 Yes model.CreateTagRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/tag/sort

GET

Summary

获取所有标签分类

Description

获取所有标签分类

Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/tag/sort/{name}

GET

Summary

获取某分类下的所有标签

Description

通过分类名获取某分类下的所有标签

Parameters
Name Located in Description Required Schema
name path 分类名 Yes string
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/tag/{id}

GET

Summary

获取某标签信息

Description

通过ID获取某标签信息

Parameters
Name Located in Description Required Schema
id path 标签ID Yes integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

DELETE

Summary

删除标签

Description

通过ID删除标签

Parameters
Name Located in Description Required Schema
id path 标签ID Yes integer
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/user

GET

Summary

获取当前登录用户信息

Description

获取当前登录用户信息 附带角色和权限信息

Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

PUT

Summary

更新当前用户

Description

更新当前用户 除角色和分组外其他字段可更新

Parameters
Name Located in Description Required Schema
body body 更新信息 Yes model.UpdateUserRequest
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

POST

Summary

创建用户(管理员)

Description

创建用户 所有字段都可设置 普通用户应使用注册,而不是这个创建

Parameters
Name Located in Description Required Schema
body body 创建信息 Yes model.CreateUserRequest
Responses
Code Description Schema
201 Created model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/user/all

GET

Summary

获取所有用户信息

Description

获取所有用户信息 用户名 昵称查找 分页

Parameters
Name Located in Description Required Schema
name query 用户名 No string
display_name query 昵称 No string
order_by query 排序字段 (默认为ID正序) 只接受 No string
offset query 偏移量 (默认为0) No integer
limit query 每页数据量 (默认为50) No integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/user/division/{id}

GET

Summary

获取某分组下的所有用户信息

Description

获取某分组下的所有用户信息 分页

Parameters
Name Located in Description Required Schema
id path 分组ID Yes integer
order_by query 排序字段 (默认为ID正序) 只接受 No string
offset query 偏移量 (默认为0) No integer
limit query 每页数据量 (默认为50) No integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/user/{id}

GET

Summary

获取某用户信息

Description

通过ID获取某用户信息

Parameters
Name Located in Description Required Schema
id path 用户ID Yes integer
Responses
Code Description Schema
200 OK model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

PUT

Summary

更新用户(管理员)

Description

通过ID更新用户 所有字段都可更新

Parameters
Name Located in Description Required Schema
id path 用户ID Yes string
body body 更新信息 Yes model.UpdateUserRequest
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

DELETE

Summary

删除用户(管理员)

Description

通过ID删除用户

Parameters
Name Located in Description Required Schema
id path 用户ID Yes string
Responses
Code Description Schema
204 No Content model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/wxlogin

POST

Summary

微信登录

Description

微信登录

Parameters
Name Located in Description Required Schema
body body 登录信息 Yes model.WxLoginRequest
Responses
Code Description Schema
200 JWT Token model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

/v1/wxregister

POST

Summary

微信注册并登陆

Description

微信注册并登陆

Parameters
Name Located in Description Required Schema
body body 登录信息 Yes model.WxRegisterRequest
Responses
Code Description Schema
200 JWT Token model.ApiJson & object
400 Bad Request model.ApiJson & object
401 Unauthorized model.ApiJson & object
403 Forbidden model.ApiJson & object
404 Not Found model.ApiJson & object
422 Unprocessable Entity model.ApiJson & object
500 Internal Server Error model.ApiJson & object

Models

model.AddItemRequest

Name Type Description Required
item_id integer No
num integer No
price number No

model.AnnounceJson

Name Type Description Required
content string No
created_at integer unix timestamp in seconds (UTC) No
end_time integer unix timestamp in seconds (UTC) No
hits integer 点击数 No
id integer No
start_time integer unix timestamp in seconds (UTC) No
title string No
updated_at integer unix timestamp in seconds (UTC) No

model.ApiJson

Name Type Description Required
code integer No
data No
msg string No
status boolean No

model.CommentJson

Name Type Description Required
content string No
created_at integer unix timestamp in seconds (UTC) No
id integer No
order_id integer No
sequence_num integer 发言在该订单内的序号 No
user_id integer No
user_name string No

model.ConsumeItemRequest

Name Type Description Required
item_id integer No
num integer No
order_id integer No
price number No

model.CreateAnnounceRequest

Name Type Description Required
content string Yes
end_time integer unix timestamp in seconds (UTC); -1代表不限; 含本数; 必须大于start Yes
start_time integer unix timestamp in seconds (UTC); -1代表不限; 含本数 Yes
title string Yes

model.CreateCommentRequest

Name Type Description Required
content string Yes

model.CreateDivisionRequest

Name Type Description Required
name string Yes
parent_id integer No

model.CreateItemRequest

Name Type Description Required
discription string No
name string Yes

model.CreateOrderRequest

Name Type Description Required
address string Yes
contact_name string Yes
contact_phone string Yes
content string No
tags [ integer ] 若干 Tag 的 ID No
title string Yes

model.CreateRoleRequest

Name Type Description Required
display_name string Yes
inheritance [ string ] No
name string Yes
permissions [ string ] No
position integer No

model.CreateTagRequest

Name Type Description Required
congener integer 允许与同Sort的Tag共存的数量 0:不限 n:只允许n个(含自身) No
level integer Yes
name string Yes
sort string Yes

model.CreateUserRequest

Name Type Description Required
display_name string Yes
division_id integer No
email string No
name string Yes
password string Yes
phone string No
real_name string No
role_name string No

model.DivisionJson

Name Type Description Required
children [ model.DivisionJson ] No
id integer No
name string No
parent_id integer 父分组ID No

model.ItemJson

Name Type Description Required
count integer No
discription string No
id integer No
name string No

model.LoginRequest

Name Type Description Required
account string Yes
password string Yes

model.OrderJson

Name Type Description Required
address string No
allow_comment boolean No
appraisal integer No
comments [ model.CommentJson ] No
contact_name string No
contact_phone string No
content string No
created_at integer unix timestamp in seconds (UTC) No
id integer No
status integer No
tags [ model.TagJson ] No
title string No
updated_at integer unix timestamp in seconds (UTC) No
user model.UserJson No
user_id integer No

model.PermissionJson

Name Type Description Required
display_name string No
name string No

model.RegisterUserRequest

Name Type Description Required
display_name string Yes
email string No
name string Yes
password string Yes
phone string No
real_name string No

model.RoleJson

Name Type Description Required
default boolean No
display_name string No
guest boolean No
inheritance [ string ] No
name string No
permissions [ model.PermissionJson ] No

model.TagJson

Name Type Description Required
congener integer 允许与同Sort的Tag共存的数量 0:不限 n:只允许n个(含自身) No
id integer No
level integer No
name string No
sort string No

model.UpdateAnnounceRequest

Name Type Description Required
content string No
end_time integer unix timestamp in seconds (UTC); -1代表不限; 含本数 Yes
start_time integer unix timestamp in seconds (UTC); -1代表不限; 含本数 Yes
title string No

model.UpdateDivisionRequest

Name Type Description Required
name string No
parent_id integer No

model.UpdateOrderRequest

Name Type Description Required
add_tags [ integer ] 若干需要添加的 Tag 的 ID No
address string No
contact_name string No
contact_phone string No
content string No
del_tags [ integer ] 若干需要删除的 Tag 的 ID No
title string No

model.UpdateRoleRequest

Name Type Description Required
add_inheritance [ string ] No
add_permissions [ string ] No
del_inheritance [ string ] No
del_permissions [ string ] No
display_name string Yes
position integer No

model.UpdateUserRequest

Name Type Description Required
display_name string No
division_id integer No
email string No
name string No
password string No
phone string No
real_name string No
role_name string No

model.UserJson

Name Type Description Required
display_name string 昵称 No
division model.DivisionJson No
email string No
id integer No
login_time integer unix timestamp in seconds (UTC) No
name string No
phone string No
real_name string No
role model.RoleJson No
user_role string No

model.WxLoginRequest

Name Type Description Required
code string Yes

model.WxRegisterRequest

Name Type Description Required
code string Yes
display_name string Yes
email string No
name string Yes
password string Yes
phone string No
real_name string No
Clone this wiki locally