-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
158 lines (158 loc) · 6.74 KB
/
openapi.json
File metadata and controls
158 lines (158 loc) · 6.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
"openapi": "3.0.3",
"info": {
"title": "SignInPlus Web API",
"version": "1.0.0",
"description": "HTTP API exposed by the SignInPlus Minecraft plugin (endpoints discovered from src/main/kotlin/cc/vastsea/web/WebApiServer.kt).",
"contact": { "name": "TeamVastsea" }
},
"servers": [
{
"url": "http://127.0.0.1:7999/api",
"description": "Local test server"
},
{
"url": "http://{host}:{port}{basePath}",
"description": "Custom server",
"variables": {
"host": { "default": "localhost" },
"port": { "default": "8080" },
"basePath": { "default": "" }
}
}
],
"paths": {
"/ifsignin": {
"get": {
"summary": "检查玩家今天是否签到",
"parameters": [
{ "name": "player", "in": "query", "required": true, "schema": { "type": "string" }, "description": "玩家名" }
],
"responses": {
"200": { "description": "返回 true 或 false", "content": { "text/plain": { "schema": { "type": "string", "example": "true" } } } },
"400": { "$ref": "#/components/responses/BadRequest" },
"405": { "$ref": "#/components/responses/MethodNotAllowed" },
"500": { "$ref": "#/components/responses/InternalError" }
}
}
},
"/total": {
"get": {
"summary": "获取玩家累计签到天数",
"parameters": [ { "name": "player", "in": "query", "required": true, "schema": { "type": "string" } } ],
"responses": {
"200": { "description": "返回整数(文本)", "content": { "text/plain": { "schema": { "type": "string", "example": "42" } } } },
"400": { "$ref": "#/components/responses/BadRequest" },
"405": { "$ref": "#/components/responses/MethodNotAllowed" },
"500": { "$ref": "#/components/responses/InternalError" }
}
}
},
"/streak": {
"get": {
"summary": "获取玩家当前连签天数",
"parameters": [ { "name": "player", "in": "query", "required": true, "schema": { "type": "string" } } ],
"responses": {
"200": { "description": "返回整数(文本)", "content": { "text/plain": { "schema": { "type": "string", "example": "3" } } } },
"400": { "$ref": "#/components/responses/BadRequest" },
"405": { "$ref": "#/components/responses/MethodNotAllowed" },
"500": { "$ref": "#/components/responses/InternalError" }
}
}
},
"/last_check_in_time": {
"get": {
"summary": "获取玩家上次签到时间(字符串)",
"parameters": [ { "name": "player", "in": "query", "required": true, "schema": { "type": "string" } } ],
"responses": {
"200": { "description": "返回时间字符串(文本)", "content": { "text/plain": { "schema": { "type": "string", "example": "2025-10-26T13:12:00Z" } } } },
"400": { "$ref": "#/components/responses/BadRequest" },
"405": { "$ref": "#/components/responses/MethodNotAllowed" },
"500": { "$ref": "#/components/responses/InternalError" }
}
}
},
"/ranktoday": {
"get": {
"summary": "获取玩家今日排名(字符串)",
"parameters": [ { "name": "player", "in": "query", "required": true, "schema": { "type": "string" } } ],
"responses": {
"200": { "description": "返回排名字符串(文本)", "content": { "text/plain": { "schema": { "type": "string", "example": "5" } } } },
"400": { "$ref": "#/components/responses/BadRequest" },
"405": { "$ref": "#/components/responses/MethodNotAllowed" },
"500": { "$ref": "#/components/responses/InternalError" }
}
}
},
"/points": {
"get": {
"summary": "获取玩家积分(以两位小数显示)",
"parameters": [ { "name": "player", "in": "query", "required": true, "schema": { "type": "string" } } ],
"responses": {
"200": { "description": "返回积分字符串(格式化为两位小数,例如 12.34)", "content": { "text/plain": { "schema": { "type": "string", "example": "12.34" } } } },
"400": { "$ref": "#/components/responses/BadRequest" },
"405": { "$ref": "#/components/responses/MethodNotAllowed" },
"500": { "$ref": "#/components/responses/InternalError" }
}
}
},
"/info": {
"get": {
"summary": "获取玩家综合信息(JSON)",
"parameters": [ { "name": "player", "in": "query", "required": true, "schema": { "type": "string" } } ],
"responses": {
"200": {
"description": "玩家信息 JSON",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/PlayerInfo" },
"example": {
"name": "Steve",
"total": 42,
"streak": 3,
"last_check_in_time": "2025-10-26T13:12:00Z",
"rank_today": "5",
"points": 12.34
}
}
}
},
"400": { "$ref": "#/components/responses/BadRequest" },
"405": { "$ref": "#/components/responses/MethodNotAllowed" },
"500": { "$ref": "#/components/responses/InternalError" }
}
}
},
"/amounttoday": {
"get": {
"summary": "获取今日签到人数",
"responses": {
"200": { "description": "返回今日签到人数(整数,文本)", "content": { "text/plain": { "schema": { "type": "string", "example": "10" } } } },
"405": { "$ref": "#/components/responses/MethodNotAllowed" },
"500": { "$ref": "#/components/responses/InternalError" }
}
}
}
},
"components": {
"schemas": {
"PlayerInfo": {
"type": "object",
"properties": {
"name": { "type": "string" },
"total": { "type": "integer", "format": "int32" },
"streak": { "type": "integer", "format": "int32" },
"last_check_in_time": { "type": "string" },
"rank_today": { "type": "string" },
"points": { "type": "number", "format": "double" }
},
"required": ["name","total","streak","last_check_in_time","points"]
}
},
"responses": {
"BadRequest": { "description": "缺少或无效的请求参数", "content": { "text/plain": { "schema": { "type": "string", "example": "missing player" } } } },
"MethodNotAllowed": { "description": "仅支持 GET", "content": { "text/plain": { "schema": { "type": "string", "example": "method not allowed" } } } },
"InternalError": { "description": "服务器内部错误", "content": { "text/plain": { "schema": { "type": "string", "example": "internal error" } } } }
}
}
}