Files
BOSS/BOSSFrontEnd/mock-api.json

178 lines
4.3 KiB
JSON
Raw Normal View History

2026-01-10 21:55:01 +08:00
{
"openapi": "3.0.1",
"info": {
"title": "BOSS Backend API",
"version": "1.0.0"
},
"paths": {
"/api/users": {
"get": {
"summary": "Get all users",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "number"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string"
},
"email": {
"type": "string"
}
}
}
},
"message": {
"type": "string"
}
}
}
}
}
}
}
},
"post": {
"summary": "Create a user",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/api/users/{id}": {
"get": {
"summary": "Get user by ID",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "number"
},
"data": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string"
},
"email": {
"type": "string"
}
}
},
"message": {
"type": "string"
}
}
}
}
}
}
}
},
"put": {
"summary": "Update user by ID",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "number"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response"
}
}
},
"delete": {
"summary": "Delete user by ID",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "Successful response"
}
}
}
}
}
}