mbsky.com · 独立本地模拟API · OpenAPI 3.0.3
完整阅读版,无需外部JS、CSS或网络连接;接口运行另需本地服务。
分页和状态过滤用户
operationId: listUsers;业务版本 1.0.0
[
{
"$ref": "#/components/parameters/Page"
},
{
"$ref": "#/components/parameters/Limit"
},
{
"$ref": "#/components/parameters/Offset"
},
{
"name": "status",
"in": "query",
"schema": {
"type": "string",
"enum": [
"active",
"inactive",
"banned"
]
}
}
]{}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserList"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}创建用户
operationId: createUser;业务版本 1.0.0
[]
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewUser"
}
}
}
}{
"responses": {
"201": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "用户名或邮箱冲突",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}获取用户详情
operationId: getUser;业务版本 1.0.0
[
{
"name": "userId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserDetail"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}整体替换允许的用户资料
operationId: replaceUser;业务版本 1.0.0
[
{
"name": "userId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReplaceUser"
}
}
}
}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserDetail"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "资源冲突",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}删除用户
operationId: deleteUser;业务版本 1.0.0
[
{
"name": "userId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{}{
"responses": {
"204": {
"description": "成功"
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}部分更新允许的用户字段
operationId: patchUser;业务版本 1.0.0
[
{
"name": "userId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateUser"
}
}
}
}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserDetail"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "资源冲突",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}教学用户登录
operationId: login;业务版本 1.0.0
[]
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Login"
}
}
}
}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Token"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "凭证错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": []
}注册独立模拟用户
operationId: register;业务版本 1.0.0
[]
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewUser"
}
}
}
}{
"responses": {
"201": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RegisterResult"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "冲突",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": []
}分页过滤books
operationId: listBooks;业务版本 1.0.0
[
{
"$ref": "#/components/parameters/Page"
},
{
"$ref": "#/components/parameters/Limit"
},
{
"name": "category",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "author",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "title",
"in": "query",
"schema": {
"type": "string"
}
}
]{}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BookList"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": []
}创建books
operationId: createBook;业务版本 1.0.0
[]
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BookInput"
}
}
}
}{
"responses": {
"201": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Book"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "资源冲突",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}books详情/替换/删除
operationId: getBook;业务版本 1.0.0
[
{
"name": "bookId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Book"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": []
}books详情/替换/删除
operationId: replaceBook;业务版本 1.0.0
[
{
"name": "bookId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BookInput"
}
}
}
}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Book"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "资源冲突",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}books详情/替换/删除
operationId: deleteBook;业务版本 1.0.0
[
{
"name": "bookId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{}{
"responses": {
"204": {
"description": "成功"
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}部分更新允许的图书字段
operationId: patchBook;业务版本 1.0.0
[
{
"name": "bookId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BookPatch"
}
}
}
}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Book"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "资源冲突",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}分页过滤products
operationId: listProducts;业务版本 1.0.0
[
{
"$ref": "#/components/parameters/Page"
},
{
"$ref": "#/components/parameters/Limit"
},
{
"name": "category",
"in": "query",
"schema": {
"type": "string"
}
}
]{}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProductList"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": []
}创建products
operationId: createProduct;业务版本 1.0.0
[]
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProductInput"
}
}
}
}{
"responses": {
"201": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Product"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "资源冲突",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}products详情/替换/删除
operationId: getProduct;业务版本 1.0.0
[
{
"name": "productId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Product"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": []
}products详情/替换/删除
operationId: replaceProduct;业务版本 1.0.0
[
{
"name": "productId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProductInput"
}
}
}
}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Product"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}products详情/替换/删除
operationId: deleteProduct;业务版本 1.0.0
[
{
"name": "productId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
}
]{}{
"responses": {
"204": {
"description": "成功"
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}查询自己的订单
operationId: listOrders;业务版本 1.0.0
[
{
"$ref": "#/components/parameters/Page"
},
{
"$ref": "#/components/parameters/Limit"
},
{
"name": "status",
"in": "query",
"schema": {
"type": "string",
"enum": [
"pending",
"processing",
"shipped",
"delivered",
"cancelled"
]
}
}
]{}{
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OrderList"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}按真实产品价格计算模拟订单
operationId: createOrder;业务版本 1.0.0
[]
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OrderInput"
}
}
}
}{
"responses": {
"201": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Order"
}
}
}
},
"400": {
"description": "输入错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "权限不足",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "本地教学限流",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "请求体过大",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "媒体类型错误",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}{
"servers": [
{
"url": "/api/v1",
"description": "独立本机教学服务"
}
],
"globalSecurity": [
{
"bearerAuth": []
}
],
"parameters": {
"Page": {
"name": "page",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"default": 1
}
},
"Limit": {
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 20
}
},
"Offset": {
"name": "offset",
"in": "query",
"schema": {
"type": "integer",
"minimum": 0,
"default": 0
}
}
},
"responses": {
"Unauthorized": {
"description": "未认证",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"NotFound": {
"description": "资源不存在",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
},
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "X-API-Key"
},
"OAuthExample": {
"type": "oauth2",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://example.invalid/authorize",
"tokenUrl": "https://example.invalid/token",
"scopes": {
"read": "读取",
"write": "写入"
}
}
}
}
}
}{
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 1,
"readOnly": true
},
"username": {
"type": "string",
"minLength": 3,
"maxLength": 50
},
"email": {
"type": "string",
"format": "email"
},
"status": {
"type": "string",
"enum": [
"active",
"inactive",
"banned"
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"readOnly": true
}
},
"required": [
"id",
"username",
"email",
"status",
"createdAt"
]
}{
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 1,
"readOnly": true
},
"username": {
"type": "string",
"minLength": 3,
"maxLength": 50
},
"email": {
"type": "string",
"format": "email"
},
"status": {
"type": "string",
"enum": [
"active",
"inactive",
"banned"
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"readOnly": true
}
},
"allOf": [
{
"$ref": "#/components/schemas/UserBase"
}
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 1,
"readOnly": true
},
"username": {
"type": "string",
"minLength": 3,
"maxLength": 50
},
"email": {
"type": "string",
"format": "email"
},
"status": {
"type": "string",
"enum": [
"active",
"inactive",
"banned"
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"firstName": {
"type": "string",
"maxLength": 80
},
"lastName": {
"type": "string",
"maxLength": 80
},
"phone": {
"type": "string",
"maxLength": 30
},
"lastLogin": {
"type": "string",
"format": "date-time"
}
},
"allOf": [
{
"$ref": "#/components/schemas/UserBase"
}
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"username": {
"type": "string",
"minLength": 3,
"maxLength": 50
},
"email": {
"type": "string",
"format": "email"
},
"password": {
"type": "string",
"minLength": 8,
"maxLength": 100,
"writeOnly": true
}
},
"required": [
"username",
"email",
"password"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email"
},
"firstName": {
"type": "string",
"maxLength": 80
},
"lastName": {
"type": "string",
"maxLength": 80
},
"phone": {
"type": "string",
"maxLength": 30
},
"password": {
"type": "string",
"minLength": 8,
"maxLength": 100,
"writeOnly": true
}
},
"minProperties": 1,
"additionalProperties": false
}{
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string",
"writeOnly": true
}
},
"required": [
"username",
"password"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"accessToken": {
"type": "string"
},
"tokenType": {
"type": "string",
"enum": [
"Bearer"
]
},
"expiresIn": {
"type": "integer",
"minimum": 1
}
},
"required": [
"accessToken",
"tokenType",
"expiresIn"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"street": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"city": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"state": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"zipCode": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"country": {
"type": "string",
"minLength": 1,
"maxLength": 120
}
},
"required": [
"street",
"city",
"state",
"zipCode",
"country"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"description": {
"type": "string",
"maxLength": 1000
},
"priceCents": {
"type": "integer",
"minimum": 0,
"maximum": 100000000
},
"category": {
"type": "string",
"enum": [
"electronics",
"books",
"clothing",
"food"
]
},
"inStock": {
"type": "boolean",
"default": true
}
},
"required": [
"name",
"priceCents",
"category"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"productId": {
"type": "integer",
"minimum": 1
},
"quantity": {
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
"required": [
"productId",
"quantity"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"items": {
"type": "array",
"minItems": 1,
"maxItems": 100,
"items": {
"$ref": "#/components/schemas/OrderItemInput"
}
},
"shippingAddress": {
"$ref": "#/components/schemas/Address"
}
},
"required": [
"items",
"shippingAddress"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"author": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"publishDate": {
"type": "string",
"format": "date"
},
"isbn": {
"type": "string",
"format": "isbn",
"description": "Custom validation: real ISBN10/13 checksum; sample code does not claim actual publisher assignment."
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 40
}
},
"required": [
"title",
"author",
"isbn"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"username": {
"type": "string",
"minLength": 3,
"maxLength": 50
},
"email": {
"type": "string",
"format": "email"
},
"status": {
"type": "string",
"enum": [
"active",
"inactive",
"banned"
]
},
"firstName": {
"type": "string",
"maxLength": 80
},
"lastName": {
"type": "string",
"maxLength": 80
},
"phone": {
"type": "string",
"maxLength": 30
}
},
"required": [
"username",
"email",
"status"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"description": {
"type": "string",
"maxLength": 1000
},
"priceCents": {
"type": "integer",
"minimum": 0,
"maximum": 100000000
},
"category": {
"type": "string",
"enum": [
"electronics",
"books",
"clothing",
"food"
]
},
"inStock": {
"type": "boolean",
"default": true
},
"id": {
"type": "integer",
"minimum": 1,
"readOnly": true
},
"createdAt": {
"type": "string",
"format": "date-time",
"readOnly": true
}
},
"required": [
"name",
"priceCents",
"category",
"id",
"createdAt"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"author": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"publishDate": {
"type": "string",
"format": "date"
},
"isbn": {
"type": "string",
"format": "isbn",
"description": "Custom validation: real ISBN10/13 checksum; sample code does not claim actual publisher assignment."
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"id": {
"type": "integer",
"minimum": 1,
"readOnly": true
}
},
"required": [
"title",
"author",
"isbn",
"id"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"author": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"publishDate": {
"type": "string",
"format": "date"
},
"isbn": {
"type": "string",
"format": "isbn",
"description": "Custom validation: real ISBN10/13 checksum; sample code does not claim actual publisher assignment."
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 40
}
},
"additionalProperties": false,
"minProperties": 1
}{
"type": "object",
"properties": {
"productId": {
"type": "integer",
"minimum": 1
},
"quantity": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"unitPriceCents": {
"type": "integer",
"minimum": 0,
"readOnly": true
}
},
"required": [
"productId",
"quantity",
"unitPriceCents"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 1,
"readOnly": true
},
"userId": {
"type": "integer",
"minimum": 1,
"readOnly": true
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OrderItem"
}
},
"shippingAddress": {
"$ref": "#/components/schemas/Address"
},
"totalCents": {
"type": "integer",
"minimum": 0,
"readOnly": true
},
"status": {
"type": "string",
"enum": [
"pending",
"processing",
"shipped",
"delivered",
"cancelled"
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"readOnly": true
}
},
"required": [
"id",
"userId",
"items",
"shippingAddress",
"totalCents",
"status",
"createdAt"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"total": {
"type": "integer",
"minimum": 0
},
"page": {
"type": "integer",
"minimum": 1
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/User"
}
}
},
"required": [
"total",
"page",
"limit",
"data"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"total": {
"type": "integer",
"minimum": 0
},
"page": {
"type": "integer",
"minimum": 1
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Book"
}
}
},
"required": [
"total",
"page",
"limit",
"data"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"total": {
"type": "integer",
"minimum": 0
},
"page": {
"type": "integer",
"minimum": 1
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Product"
}
}
},
"required": [
"total",
"page",
"limit",
"data"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"total": {
"type": "integer",
"minimum": 0
},
"page": {
"type": "integer",
"minimum": 1
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
},
"required": [
"total",
"page",
"limit",
"data"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"user": {
"$ref": "#/components/schemas/User"
},
"token": {
"$ref": "#/components/schemas/Token"
}
},
"required": [
"user",
"token"
],
"additionalProperties": false
}