-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
310 lines (271 loc) · 9.59 KB
/
Copy pathindex.html
File metadata and controls
310 lines (271 loc) · 9.59 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Heimdall API 文档</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
line-height: 1.6;
color: #333;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
header {
text-align: center;
margin-bottom: 3rem;
color: white;
}
h1 {
font-size: 3rem;
margin-bottom: 1rem;
text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.subtitle {
font-size: 1.2rem;
opacity: 0.9;
}
.api-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 2rem;
margin-bottom: 3rem;
}
.api-card {
background: white;
border-radius: 12px;
box-shadow: 0 8px 32px rgba(0,0,0,0.1);
overflow: hidden;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.api-card:hover {
transform: translateY(-5px);
box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}
.card-header {
padding: 2rem;
background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
color: white;
}
.card-header.admin {
background: linear-gradient(45deg, #fa709a 0%, #fee140 100%);
}
.card-title {
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
.card-description {
opacity: 0.9;
}
.card-body {
padding: 2rem;
}
.api-info {
margin-bottom: 1.5rem;
}
.info-item {
display: flex;
margin-bottom: 0.5rem;
}
.info-label {
font-weight: 600;
min-width: 60px;
color: #666;
}
.info-value {
color: #333;
}
.endpoint-count {
background: #e3f2fd;
color: #1976d2;
padding: 0.25rem 0.75rem;
border-radius: 20px;
font-size: 0.875rem;
font-weight: 600;
}
.actions {
display: flex;
gap: 1rem;
flex-wrap: wrap;
}
.btn {
display: inline-flex;
align-items: center;
padding: 0.75rem 1.5rem;
border: none;
border-radius: 8px;
text-decoration: none;
font-weight: 600;
transition: all 0.3s ease;
cursor: pointer;
}
.btn-primary {
background: #007bff;
color: white;
}
.btn-primary:hover {
background: #0056b3;
transform: translateY(-2px);
}
.btn-secondary {
background: #6c757d;
color: white;
}
.btn-secondary:hover {
background: #545b62;
transform: translateY(-2px);
}
.commands {
background: white;
border-radius: 12px;
padding: 2rem;
box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.commands h3 {
margin-bottom: 1rem;
color: #333;
}
.command-list {
background: #f8f9fa;
border-radius: 8px;
padding: 1.5rem;
font-family: 'Monaco', 'Consolas', monospace;
}
.command {
margin-bottom: 0.5rem;
color: #495057;
}
.command:last-child {
margin-bottom: 0;
}
.command-comment {
color: #6c757d;
font-size: 0.875rem;
}
footer {
text-align: center;
margin-top: 3rem;
color: white;
opacity: 0.8;
}
@media (max-width: 768px) {
.container {
padding: 1rem;
}
h1 {
font-size: 2rem;
}
.actions {
flex-direction: column;
}
.btn {
justify-content: center;
}
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>🛡️ Heimdall API</h1>
<p class="subtitle">博客系统 RESTful API 文档</p>
</header>
<div class="api-grid">
<!-- Admin API Card -->
<div class="api-card">
<div class="card-header admin">
<h2 class="card-title">Admin API</h2>
<p class="card-description">管理后台接口 - 用户认证、内容管理、系统监控</p>
</div>
<div class="card-body">
<div class="api-info">
<div class="info-item">
<span class="info-label">端口:</span>
<span class="info-value">8080</span>
</div>
<div class="info-item">
<span class="info-label">基础路径:</span>
<span class="info-value">/api/v1/admin</span>
</div>
<div class="info-item">
<span class="info-label">接口数:</span>
<span class="endpoint-count">6个</span>
</div>
</div>
<div class="actions">
<a href="https://editor.swagger.io/" target="_blank" class="btn btn-primary">
📝 在线查看
</a>
<a href="admin-api.yaml" download class="btn btn-secondary">
💾 下载文档
</a>
</div>
</div>
</div>
<!-- Public API Card -->
<div class="api-card">
<div class="card-header">
<h2 class="card-title">Public API</h2>
<p class="card-description">公开前台接口 - 博客文章、评论、搜索</p>
</div>
<div class="card-body">
<div class="api-info">
<div class="info-item">
<span class="info-label">端口:</span>
<span class="info-value">8081</span>
</div>
<div class="info-item">
<span class="info-label">基础路径:</span>
<span class="info-value">/api/v1/public</span>
</div>
<div class="info-item">
<span class="info-label">接口数:</span>
<span class="endpoint-count">1个 (开发中)</span>
</div>
</div>
<div class="actions">
<a href="https://editor.swagger.io/" target="_blank" class="btn btn-primary">
📝 在线查看
</a>
<a href="public-api.yaml" download class="btn btn-secondary">
💾 下载文档
</a>
</div>
</div>
</div>
</div>
<div class="commands">
<h3>🔧 快速命令</h3>
<div class="command-list">
<div class="command"># 启动服务</div>
<div class="command">make admin <span class="command-comment"># 启动管理后台 (8080)</span></div>
<div class="command">make public <span class="command-comment"># 启动公开前台 (8081)</span></div>
<div class="command"></div>
<div class="command"># 生成文档</div>
<div class="command">make swagger <span class="command-comment"># 生成所有Swagger文档</span></div>
<div class="command">make swagger-admin <span class="command-comment"># 仅生成Admin API文档</span></div>
<div class="command"></div>
<div class="command"># 测试接口</div>
<div class="command">curl -X POST http://localhost:8080/api/v1/admin/auth/login \\</div>
<div class="command"> -H "Content-Type: application/json" \\</div>
<div class="command"> -d '{"username":"admin","password":"admin123"}'</div>
</div>
</div>
<footer>
<p>Generated by goctl • Last updated: 2025-07-04</p>
<p>📚 <a href="../" style="color: white;">返回文档首页</a> | 🚀 <a href="../../" style="color: white;">项目主页</a></p>
</footer>
</div>
</body>
</html>