@rainyun/cli 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +176 -2
  2. package/bin/postinstall.mjs +13 -0
  3. package/bin/rainyun-cli.mjs +13 -0
  4. package/catalog/human-names.json +340 -0
  5. package/catalog/list.openapi.json +354 -0
  6. package/catalog/openapi.json +34527 -0
  7. package/catalog/product-commands.json +332 -0
  8. package/catalog/public.openapi.json +1891 -0
  9. package/docs/AGENT_GUIDE.md +64 -0
  10. package/docs/install.md +44 -0
  11. package/docs/product-lists.md +48 -0
  12. package/docs/rgp.md +77 -0
  13. package/docs/terminal-exec.md +111 -0
  14. package/examples/public-panel.json +1 -0
  15. package/examples/public-rcs-price.json +1 -0
  16. package/examples/rca-terminal-input.json +1 -0
  17. package/examples/rcs-get.json +1 -0
  18. package/examples/rcs-list.json +1 -0
  19. package/examples/rcs-reboot.json +1 -0
  20. package/examples/terminal-controls.ndjson +3 -0
  21. package/examples/terminal-input.json +1 -0
  22. package/node_modules/ws/LICENSE +20 -0
  23. package/node_modules/ws/README.md +539 -0
  24. package/node_modules/ws/browser.js +8 -0
  25. package/node_modules/ws/index.js +22 -0
  26. package/node_modules/ws/lib/buffer-util.js +142 -0
  27. package/node_modules/ws/lib/constants.js +19 -0
  28. package/node_modules/ws/lib/event-target.js +292 -0
  29. package/node_modules/ws/lib/extension.js +203 -0
  30. package/node_modules/ws/lib/limiter.js +55 -0
  31. package/node_modules/ws/lib/permessage-deflate.js +530 -0
  32. package/node_modules/ws/lib/receiver.js +751 -0
  33. package/node_modules/ws/lib/sender.js +610 -0
  34. package/node_modules/ws/lib/stream.js +161 -0
  35. package/node_modules/ws/lib/subprotocol.js +62 -0
  36. package/node_modules/ws/lib/validation.js +152 -0
  37. package/node_modules/ws/lib/websocket-server.js +565 -0
  38. package/node_modules/ws/lib/websocket.js +1471 -0
  39. package/node_modules/ws/package.json +74 -0
  40. package/node_modules/ws/wrapper.mjs +21 -0
  41. package/package.json +29 -4
  42. package/skills/rainyun-cli/SKILL.md +46 -0
  43. package/src/api/catalog.mjs +230 -0
  44. package/src/api/http.mjs +222 -0
  45. package/src/api/request.mjs +178 -0
  46. package/src/api/titles.mjs +9 -0
  47. package/src/auth/commands.mjs +192 -0
  48. package/src/auth/store.mjs +162 -0
  49. package/src/cli.mjs +154 -0
  50. package/src/commands/dispatch.mjs +128 -0
  51. package/src/commands/fields.mjs +77 -0
  52. package/src/commands/products.mjs +209 -0
  53. package/src/commands/rgs.mjs +44 -0
  54. package/src/json.mjs +81 -0
  55. package/src/output/business.mjs +188 -0
  56. package/src/output/discovery.mjs +197 -0
  57. package/src/output/examples.mjs +71 -0
  58. package/src/output/format.mjs +164 -0
  59. package/src/output/help.json +181 -0
  60. package/src/output/help.mjs +334 -0
  61. package/src/rgp/commands.mjs +251 -0
  62. package/src/rgp/input.mjs +144 -0
  63. package/src/rgp/operations.json +625 -0
  64. package/src/rgp/result.mjs +103 -0
  65. package/src/rgp/transfer.mjs +213 -0
  66. package/src/terminal/commands.mjs +155 -0
  67. package/src/terminal/session.mjs +233 -0
  68. package/src/terminal/target.mjs +155 -0
@@ -0,0 +1,1891 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "title": "雨云公共接口补充快照",
5
+ "version": "2026-11-18",
6
+ "description": "依据本地后端路由、控制器与服务逐项人工核对。公共 JSON API;不包含网页登录、协议回调或 SSE。面板配置仅声明有限的 Referer 请求头。与 API Key 快照合并使用。"
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "https://api.v2.rainyun.com"
11
+ }
12
+ ],
13
+ "paths": {
14
+ "/news": {
15
+ "get": {
16
+ "operationId": "public_news",
17
+ "summary": "查询论坛公告",
18
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
19
+ "tags": [
20
+ "公共"
21
+ ],
22
+ "security": [],
23
+ "x-public": true,
24
+ "x-api-key-enabled": false,
25
+ "x-source-route": "routers/controllers/home.go:22",
26
+ "x-api-key-scopes": [],
27
+ "parameters": [],
28
+ "responses": {
29
+ "200": {
30
+ "description": "HTTP 与业务 code 均成功才视为成功。",
31
+ "content": {
32
+ "application/json": {
33
+ "schema": {
34
+ "$ref": "#/components/schemas/PublicResponse"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ },
42
+ "/app_config": {
43
+ "get": {
44
+ "operationId": "public_site_config",
45
+ "summary": "查询公开站点配置",
46
+ "description": "返回 agent_id=0 的公开站点配置。此路由不加载用户身份。",
47
+ "tags": [
48
+ "公共"
49
+ ],
50
+ "security": [],
51
+ "x-public": true,
52
+ "x-api-key-enabled": false,
53
+ "x-source-route": "routers/controllers/home.go:41",
54
+ "x-api-key-scopes": [],
55
+ "parameters": [],
56
+ "responses": {
57
+ "200": {
58
+ "description": "HTTP 与业务 code 均成功才视为成功。",
59
+ "content": {
60
+ "application/json": {
61
+ "schema": {
62
+ "$ref": "#/components/schemas/PublicResponse"
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "/status": {
71
+ "get": {
72
+ "operationId": "public_status",
73
+ "summary": "查询节点网络状态",
74
+ "description": "返回未隐藏节点的状态、分页结果及正在进行的服务事件;options 支持 Product 筛选。",
75
+ "tags": [
76
+ "公共"
77
+ ],
78
+ "security": [],
79
+ "x-public": true,
80
+ "x-api-key-enabled": false,
81
+ "x-source-route": "routers/controllers/home.go:62;services/api/node/status.go:34、85",
82
+ "x-api-key-scopes": [],
83
+ "parameters": [
84
+ {
85
+ "name": "options",
86
+ "in": "query",
87
+ "required": true,
88
+ "description": "分页、筛选和排序条件的 JSON 字符串;CLI 也接受对象并只序列化一次。建议 page=1、perPage=20。",
89
+ "schema": {
90
+ "type": "string"
91
+ },
92
+ "x-json-content-schema": {
93
+ "$ref": "#/components/schemas/PaginationOptions"
94
+ }
95
+ }
96
+ ],
97
+ "responses": {
98
+ "200": {
99
+ "description": "HTTP 与业务 code 均成功才视为成功。",
100
+ "content": {
101
+ "application/json": {
102
+ "schema": {
103
+ "$ref": "#/components/schemas/PublicResponse"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "/discourse": {
112
+ "get": {
113
+ "operationId": "public_discourse",
114
+ "summary": "查询论坛公开数据",
115
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
116
+ "tags": [
117
+ "公共"
118
+ ],
119
+ "security": [],
120
+ "x-public": true,
121
+ "x-api-key-enabled": false,
122
+ "x-source-route": "routers/init.go:82;services/discourse/topic.go:108",
123
+ "x-api-key-scopes": [],
124
+ "parameters": [
125
+ {
126
+ "name": "paths",
127
+ "in": "query",
128
+ "required": true,
129
+ "description": "论坛站内相对路径的标准 Base64 编码;不能是外站绝对 URL。",
130
+ "schema": {
131
+ "type": "string"
132
+ }
133
+ }
134
+ ],
135
+ "responses": {
136
+ "200": {
137
+ "description": "HTTP 与业务 code 均成功才视为成功。",
138
+ "content": {
139
+ "application/json": {
140
+ "schema": {
141
+ "$ref": "#/components/schemas/PublicResponse"
142
+ }
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ },
149
+ "/short_params": {
150
+ "get": {
151
+ "operationId": "public_short_params_get",
152
+ "summary": "读取分享参数",
153
+ "description": "返回 data 字符串,内容是存储的 Base64 编码参数。",
154
+ "tags": [
155
+ "公共"
156
+ ],
157
+ "security": [],
158
+ "x-public": true,
159
+ "x-api-key-enabled": false,
160
+ "x-source-route": "routers/controllers/user.go:367",
161
+ "x-api-key-scopes": [],
162
+ "parameters": [
163
+ {
164
+ "name": "name",
165
+ "in": "query",
166
+ "required": true,
167
+ "description": "短参数名称。",
168
+ "schema": {
169
+ "type": "string",
170
+ "minLength": 1,
171
+ "maxLength": 10
172
+ }
173
+ }
174
+ ],
175
+ "responses": {
176
+ "200": {
177
+ "description": "HTTP 与业务 code 均成功才视为成功。",
178
+ "content": {
179
+ "application/json": {
180
+ "schema": {
181
+ "$ref": "#/components/schemas/PublicResponse"
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+ },
188
+ "post": {
189
+ "operationId": "public_short_params_create",
190
+ "summary": "创建分享参数",
191
+ "description": "公开写操作。action 仅支持 plan_share;params 传原文,后端会编码成 Base64。Name 是可选 JSON 字段(注意大写),未传则生成名称;存在按 IP 的频率限制。返回 data 为短参数名称。",
192
+ "tags": [
193
+ "公共"
194
+ ],
195
+ "security": [],
196
+ "x-public": true,
197
+ "x-api-key-enabled": false,
198
+ "x-source-route": "routers/init.go:130;routers/controllers/user.go:351;services/user/setting.go:573",
199
+ "x-api-key-scopes": [],
200
+ "parameters": [],
201
+ "responses": {
202
+ "200": {
203
+ "description": "HTTP 与业务 code 均成功才视为成功。",
204
+ "content": {
205
+ "application/json": {
206
+ "schema": {
207
+ "$ref": "#/components/schemas/PublicResponse"
208
+ }
209
+ }
210
+ }
211
+ }
212
+ },
213
+ "requestBody": {
214
+ "required": true,
215
+ "content": {
216
+ "application/json": {
217
+ "schema": {
218
+ "type": "object",
219
+ "required": [
220
+ "action",
221
+ "params"
222
+ ],
223
+ "properties": {
224
+ "Name": {
225
+ "type": "string",
226
+ "minLength": 3,
227
+ "maxLength": 6,
228
+ "description": "可选自定义名称;不提供时自动生成。"
229
+ },
230
+ "action": {
231
+ "type": "string",
232
+ "enum": [
233
+ "plan_share"
234
+ ]
235
+ },
236
+ "params": {
237
+ "type": "string",
238
+ "minLength": 1,
239
+ "maxLength": 2000
240
+ }
241
+ }
242
+ }
243
+ }
244
+ }
245
+ }
246
+ }
247
+ },
248
+ "/user/vip/top": {
249
+ "get": {
250
+ "operationId": "public_vip_top",
251
+ "summary": "查询公开排行榜",
252
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
253
+ "tags": [
254
+ "公共"
255
+ ],
256
+ "security": [],
257
+ "x-public": true,
258
+ "x-api-key-enabled": false,
259
+ "x-source-route": "routers/init.go:154;routers/controllers/user_vip.go:47",
260
+ "x-api-key-scopes": [],
261
+ "parameters": [],
262
+ "responses": {
263
+ "200": {
264
+ "description": "HTTP 与业务 code 均成功才视为成功。",
265
+ "content": {
266
+ "application/json": {
267
+ "schema": {
268
+ "$ref": "#/components/schemas/PublicResponse"
269
+ }
270
+ }
271
+ }
272
+ }
273
+ }
274
+ }
275
+ },
276
+ "/product/rcs/plans": {
277
+ "get": {
278
+ "operationId": "public_rcs_plans",
279
+ "summary": "查询云服务器套餐",
280
+ "description": "返回套餐列表;不接受私有实例列表的 options 分页参数。",
281
+ "tags": [
282
+ "公共"
283
+ ],
284
+ "security": [],
285
+ "x-public": true,
286
+ "x-api-key-enabled": false,
287
+ "x-source-route": "routers/controllers/product_rcs.go:23;services/product/rcs/plans.go:16",
288
+ "x-api-key-scopes": [],
289
+ "parameters": [
290
+ {
291
+ "name": "is_rgpu",
292
+ "in": "query",
293
+ "required": false,
294
+ "description": "true 查询 GPU 套餐,默认 false。",
295
+ "schema": {
296
+ "type": "boolean"
297
+ }
298
+ }
299
+ ],
300
+ "responses": {
301
+ "200": {
302
+ "description": "HTTP 与业务 code 均成功才视为成功。",
303
+ "content": {
304
+ "application/json": {
305
+ "schema": {
306
+ "$ref": "#/components/schemas/PublicResponse"
307
+ }
308
+ }
309
+ }
310
+ }
311
+ }
312
+ }
313
+ },
314
+ "/product/rgs/plans": {
315
+ "get": {
316
+ "operationId": "public_rgs_plans",
317
+ "summary": "查询游戏云套餐",
318
+ "description": "返回套餐列表;不接受私有实例列表的 options 分页参数。",
319
+ "tags": [
320
+ "公共"
321
+ ],
322
+ "security": [],
323
+ "x-public": true,
324
+ "x-api-key-enabled": false,
325
+ "x-source-route": "routers/controllers/product_rgs.go:38;services/product/rgs/plans.go:17",
326
+ "x-api-key-scopes": [],
327
+ "parameters": [],
328
+ "responses": {
329
+ "200": {
330
+ "description": "HTTP 与业务 code 均成功才视为成功。",
331
+ "content": {
332
+ "application/json": {
333
+ "schema": {
334
+ "$ref": "#/components/schemas/PublicResponse"
335
+ }
336
+ }
337
+ }
338
+ }
339
+ }
340
+ }
341
+ },
342
+ "/product/ros/plans": {
343
+ "get": {
344
+ "operationId": "public_ros_plans",
345
+ "summary": "查询对象存储套餐",
346
+ "description": "返回套餐列表;不接受私有实例列表的 options 分页参数。",
347
+ "tags": [
348
+ "公共"
349
+ ],
350
+ "security": [],
351
+ "x-public": true,
352
+ "x-api-key-enabled": false,
353
+ "x-source-route": "routers/controllers/product_ros.go:265;services/product/ros/plans.go:11",
354
+ "x-api-key-scopes": [],
355
+ "parameters": [],
356
+ "responses": {
357
+ "200": {
358
+ "description": "HTTP 与业务 code 均成功才视为成功。",
359
+ "content": {
360
+ "application/json": {
361
+ "schema": {
362
+ "$ref": "#/components/schemas/PublicResponse"
363
+ }
364
+ }
365
+ }
366
+ }
367
+ }
368
+ }
369
+ },
370
+ "/product/rbm/models": {
371
+ "get": {
372
+ "operationId": "public_rbm_models",
373
+ "summary": "查询裸金属机型套餐",
374
+ "description": "返回公开机型套餐列表。",
375
+ "tags": [
376
+ "公共"
377
+ ],
378
+ "security": [],
379
+ "x-public": true,
380
+ "x-api-key-enabled": false,
381
+ "x-source-route": "routers/controllers/product_rbm.go:326",
382
+ "x-api-key-scopes": [],
383
+ "parameters": [],
384
+ "responses": {
385
+ "200": {
386
+ "description": "HTTP 与业务 code 均成功才视为成功。",
387
+ "content": {
388
+ "application/json": {
389
+ "schema": {
390
+ "$ref": "#/components/schemas/PublicResponse"
391
+ }
392
+ }
393
+ }
394
+ }
395
+ }
396
+ }
397
+ },
398
+ "/product/rcs/os-templates": {
399
+ "get": {
400
+ "operationId": "public_rcs_os_templates",
401
+ "summary": "查询云服务器操作系统模板",
402
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
403
+ "tags": [
404
+ "公共"
405
+ ],
406
+ "security": [],
407
+ "x-public": true,
408
+ "x-api-key-enabled": false,
409
+ "x-source-route": "routers/controllers/product_rcs.go:37",
410
+ "x-api-key-scopes": [],
411
+ "parameters": [],
412
+ "responses": {
413
+ "200": {
414
+ "description": "HTTP 与业务 code 均成功才视为成功。",
415
+ "content": {
416
+ "application/json": {
417
+ "schema": {
418
+ "$ref": "#/components/schemas/PublicResponse"
419
+ }
420
+ }
421
+ }
422
+ }
423
+ }
424
+ }
425
+ },
426
+ "/product/rbm/os-templates": {
427
+ "get": {
428
+ "operationId": "public_rbm_os_templates",
429
+ "summary": "查询裸金属操作系统模板",
430
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
431
+ "tags": [
432
+ "公共"
433
+ ],
434
+ "security": [],
435
+ "x-public": true,
436
+ "x-api-key-enabled": false,
437
+ "x-source-route": "routers/controllers/product_rbm.go:320",
438
+ "x-api-key-scopes": [],
439
+ "parameters": [],
440
+ "responses": {
441
+ "200": {
442
+ "description": "HTTP 与业务 code 均成功才视为成功。",
443
+ "content": {
444
+ "application/json": {
445
+ "schema": {
446
+ "$ref": "#/components/schemas/PublicResponse"
447
+ }
448
+ }
449
+ }
450
+ }
451
+ }
452
+ }
453
+ },
454
+ "/product/rgs/os-templates": {
455
+ "get": {
456
+ "operationId": "public_rgs_os_templates",
457
+ "summary": "查询游戏云操作系统模板",
458
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
459
+ "tags": [
460
+ "公共"
461
+ ],
462
+ "security": [],
463
+ "x-public": true,
464
+ "x-api-key-enabled": false,
465
+ "x-source-route": "routers/controllers/product_rgs.go:518",
466
+ "x-api-key-scopes": [],
467
+ "parameters": [],
468
+ "responses": {
469
+ "200": {
470
+ "description": "HTTP 与业务 code 均成功才视为成功。",
471
+ "content": {
472
+ "application/json": {
473
+ "schema": {
474
+ "$ref": "#/components/schemas/PublicResponse"
475
+ }
476
+ }
477
+ }
478
+ }
479
+ }
480
+ }
481
+ },
482
+ "/product/rcs/discount-percent": {
483
+ "get": {
484
+ "operationId": "public_rcs_discount_percent",
485
+ "summary": "查询云服务器时长折扣",
486
+ "description": "返回折扣分组映射;组内键为月数、值为折扣系数。实际折扣以服务端结果为准。",
487
+ "tags": [
488
+ "公共"
489
+ ],
490
+ "security": [],
491
+ "x-public": true,
492
+ "x-api-key-enabled": false,
493
+ "x-source-route": "services/product/rcs/utils.go:26;routers/init.go:434-463",
494
+ "x-api-key-scopes": [],
495
+ "parameters": [
496
+ {
497
+ "name": "type",
498
+ "in": "query",
499
+ "required": true,
500
+ "description": "购买或续费场景。",
501
+ "schema": {
502
+ "type": "string",
503
+ "enum": [
504
+ "create",
505
+ "renew"
506
+ ]
507
+ }
508
+ }
509
+ ],
510
+ "responses": {
511
+ "200": {
512
+ "description": "HTTP 与业务 code 均成功才视为成功。",
513
+ "content": {
514
+ "application/json": {
515
+ "schema": {
516
+ "$ref": "#/components/schemas/PublicResponse"
517
+ }
518
+ }
519
+ }
520
+ }
521
+ }
522
+ }
523
+ },
524
+ "/product/rbm/discount-percent": {
525
+ "get": {
526
+ "operationId": "public_rbm_discount_percent",
527
+ "summary": "查询裸金属时长折扣",
528
+ "description": "返回折扣分组映射;组内键为月数、值为折扣系数。实际折扣以服务端结果为准。",
529
+ "tags": [
530
+ "公共"
531
+ ],
532
+ "security": [],
533
+ "x-public": true,
534
+ "x-api-key-enabled": false,
535
+ "x-source-route": "services/product/rbm/utils.go:19;routers/init.go:434-463",
536
+ "x-api-key-scopes": [],
537
+ "parameters": [
538
+ {
539
+ "name": "type",
540
+ "in": "query",
541
+ "required": true,
542
+ "description": "购买或续费场景。",
543
+ "schema": {
544
+ "type": "string",
545
+ "enum": [
546
+ "create",
547
+ "renew"
548
+ ]
549
+ }
550
+ }
551
+ ],
552
+ "responses": {
553
+ "200": {
554
+ "description": "HTTP 与业务 code 均成功才视为成功。",
555
+ "content": {
556
+ "application/json": {
557
+ "schema": {
558
+ "$ref": "#/components/schemas/PublicResponse"
559
+ }
560
+ }
561
+ }
562
+ }
563
+ }
564
+ }
565
+ },
566
+ "/product/rgs/discount-percent": {
567
+ "get": {
568
+ "operationId": "public_rgs_discount_percent",
569
+ "summary": "查询游戏云时长折扣",
570
+ "description": "返回折扣分组映射;组内键为月数、值为折扣系数。实际折扣以服务端结果为准。",
571
+ "tags": [
572
+ "公共"
573
+ ],
574
+ "security": [],
575
+ "x-public": true,
576
+ "x-api-key-enabled": false,
577
+ "x-source-route": "services/product/rgs/utils.go:25;routers/init.go:434-463",
578
+ "x-api-key-scopes": [],
579
+ "parameters": [
580
+ {
581
+ "name": "type",
582
+ "in": "query",
583
+ "required": true,
584
+ "description": "购买或续费场景。",
585
+ "schema": {
586
+ "type": "string",
587
+ "enum": [
588
+ "create",
589
+ "renew"
590
+ ]
591
+ }
592
+ }
593
+ ],
594
+ "responses": {
595
+ "200": {
596
+ "description": "HTTP 与业务 code 均成功才视为成功。",
597
+ "content": {
598
+ "application/json": {
599
+ "schema": {
600
+ "$ref": "#/components/schemas/PublicResponse"
601
+ }
602
+ }
603
+ }
604
+ }
605
+ }
606
+ }
607
+ },
608
+ "/product/ros/discount-percent": {
609
+ "get": {
610
+ "operationId": "public_ros_discount_percent",
611
+ "summary": "查询对象存储时长折扣",
612
+ "description": "返回折扣分组映射;组内键为月数、值为折扣系数。实际折扣以服务端结果为准。",
613
+ "tags": [
614
+ "公共"
615
+ ],
616
+ "security": [],
617
+ "x-public": true,
618
+ "x-api-key-enabled": false,
619
+ "x-source-route": "services/product/ros/utils.go:23;routers/init.go:434-463",
620
+ "x-api-key-scopes": [],
621
+ "parameters": [
622
+ {
623
+ "name": "type",
624
+ "in": "query",
625
+ "required": true,
626
+ "description": "购买或续费场景。",
627
+ "schema": {
628
+ "type": "string",
629
+ "enum": [
630
+ "create",
631
+ "renew"
632
+ ]
633
+ }
634
+ }
635
+ ],
636
+ "responses": {
637
+ "200": {
638
+ "description": "HTTP 与业务 code 均成功才视为成功。",
639
+ "content": {
640
+ "application/json": {
641
+ "schema": {
642
+ "$ref": "#/components/schemas/PublicResponse"
643
+ }
644
+ }
645
+ }
646
+ }
647
+ }
648
+ }
649
+ },
650
+ "/product/rcs/price": {
651
+ "get": {
652
+ "description": "创建或试用传 plan_id;续费、公网 IP 和云盘报价传 product_id;升级还须传 dest_plan。购买或续费按 duration 指定月数。\n\n新版 API Key 所需 Scope(全部满足):rcs:pricing:read。\n\n默认匿名报价,仅支持 create、try 场景,不能使用账号优惠券。需要续费、升级等账号场景,或希望应用会员、代理关系及优惠券定价时,显式加 --authenticated;仍需本接口登记的 API Key 权限。匿名报价不保证等于你的实际下单价。",
653
+ "summary": "计算云服务器报价",
654
+ "tags": [
655
+ "rcs"
656
+ ],
657
+ "operationId": "get_product_rcs_price_85b84a78",
658
+ "x-api-key-enabled": true,
659
+ "x-api-key-scopes": [
660
+ "rcs:pricing:read"
661
+ ],
662
+ "x-api-key-scope-mode": "all",
663
+ "x-source-route": "routers/init.go:442;services/product/rcs/utils.go:85;services/product/common.go:499",
664
+ "parameters": [
665
+ {
666
+ "description": "计价场景",
667
+ "in": "query",
668
+ "name": "scene",
669
+ "required": true,
670
+ "schema": {
671
+ "enum": [
672
+ "create",
673
+ "renew",
674
+ "upgrade",
675
+ "eip",
676
+ "try",
677
+ "edisk"
678
+ ],
679
+ "type": "string"
680
+ }
681
+ },
682
+ {
683
+ "description": "创建或试用的套餐 ID",
684
+ "in": "query",
685
+ "name": "plan_id",
686
+ "schema": {
687
+ "type": "integer"
688
+ }
689
+ },
690
+ {
691
+ "description": "已有实例 ID",
692
+ "in": "query",
693
+ "name": "product_id",
694
+ "schema": {
695
+ "type": "integer"
696
+ }
697
+ },
698
+ {
699
+ "description": "购买或续费的月数",
700
+ "in": "query",
701
+ "name": "duration",
702
+ "schema": {
703
+ "enum": [
704
+ 1,
705
+ 3,
706
+ 6,
707
+ 12
708
+ ],
709
+ "type": "integer"
710
+ }
711
+ },
712
+ {
713
+ "description": "升级目标套餐 ID",
714
+ "in": "query",
715
+ "name": "dest_plan",
716
+ "schema": {
717
+ "type": "integer"
718
+ }
719
+ },
720
+ {
721
+ "description": "创建时选择的磁盘类型",
722
+ "in": "query",
723
+ "name": "disk_type",
724
+ "schema": {
725
+ "type": "string"
726
+ }
727
+ },
728
+ {
729
+ "description": "额外系统盘容量(GB)",
730
+ "in": "query",
731
+ "name": "add_disk_size",
732
+ "schema": {
733
+ "type": "integer"
734
+ }
735
+ },
736
+ {
737
+ "description": "独立 IP 数量",
738
+ "in": "query",
739
+ "name": "with_eip_num",
740
+ "schema": {
741
+ "type": "integer"
742
+ }
743
+ },
744
+ {
745
+ "description": "独立 IP 特性",
746
+ "in": "query",
747
+ "name": "with_eip_flags",
748
+ "schema": {
749
+ "type": "string"
750
+ }
751
+ },
752
+ {
753
+ "description": "参与报价的优惠券 ID",
754
+ "in": "query",
755
+ "name": "with_coupon_id",
756
+ "schema": {
757
+ "type": "integer"
758
+ }
759
+ },
760
+ {
761
+ "description": "查询原价,忽略优惠券和折扣",
762
+ "in": "query",
763
+ "name": "is_old",
764
+ "schema": {
765
+ "type": "boolean"
766
+ }
767
+ },
768
+ {
769
+ "description": "计算时忽略代理定价",
770
+ "in": "query",
771
+ "name": "ignore_agent",
772
+ "schema": {
773
+ "type": "boolean"
774
+ }
775
+ },
776
+ {
777
+ "description": "团购报价使用的折扣",
778
+ "in": "query",
779
+ "name": "group_discount",
780
+ "schema": {
781
+ "type": "number"
782
+ }
783
+ }
784
+ ],
785
+ "responses": {
786
+ "200": {
787
+ "description": "成功",
788
+ "content": {
789
+ "application/json": {
790
+ "schema": {
791
+ "allOf": [
792
+ {
793
+ "$ref": "#/components/schemas/app.ResponseData"
794
+ },
795
+ {
796
+ "properties": {
797
+ "data": {
798
+ "$ref": "#/components/schemas/controllers.rcsPriceData"
799
+ }
800
+ },
801
+ "type": "object"
802
+ }
803
+ ]
804
+ }
805
+ }
806
+ }
807
+ },
808
+ "400": {
809
+ "$ref": "#/components/responses/BadRequest"
810
+ },
811
+ "403": {
812
+ "$ref": "#/components/responses/Forbidden"
813
+ },
814
+ "500": {
815
+ "$ref": "#/components/responses/ServerError"
816
+ }
817
+ },
818
+ "security": [],
819
+ "x-public": true
820
+ }
821
+ },
822
+ "/product/rbm/price": {
823
+ "get": {
824
+ "summary": "计算裸金属价格",
825
+ "tags": [
826
+ "rbm"
827
+ ],
828
+ "operationId": "get_product_rbm_price_21406566",
829
+ "x-api-key-enabled": true,
830
+ "x-api-key-scopes": [
831
+ "rbm:pricing:read"
832
+ ],
833
+ "x-api-key-scope-mode": "all",
834
+ "x-source-route": "routers/init.go:447;services/product/rbm/utils.go:62;services/product/common.go:499",
835
+ "description": "新版 API Key 所需 Scope(全部满足):rbm:pricing:read。\n\n默认匿名报价,仅支持 create、try 场景,不能使用账号优惠券。需要续费、升级等账号场景,或希望应用会员、代理关系及优惠券定价时,显式加 --authenticated;仍需本接口登记的 API Key 权限。匿名报价不保证等于你的实际下单价。",
836
+ "parameters": [
837
+ {
838
+ "description": "计价场景",
839
+ "in": "query",
840
+ "name": "scene",
841
+ "required": true,
842
+ "schema": {
843
+ "enum": [
844
+ "create",
845
+ "renew",
846
+ "eip",
847
+ "try"
848
+ ],
849
+ "type": "string"
850
+ }
851
+ },
852
+ {
853
+ "description": "购买或试用的套餐 ID",
854
+ "in": "query",
855
+ "name": "plan_id",
856
+ "schema": {
857
+ "type": "integer"
858
+ }
859
+ },
860
+ {
861
+ "description": "已有实例的 ID",
862
+ "in": "query",
863
+ "name": "product_id",
864
+ "schema": {
865
+ "type": "integer"
866
+ }
867
+ },
868
+ {
869
+ "description": "购买或续费的月数",
870
+ "in": "query",
871
+ "name": "duration",
872
+ "schema": {
873
+ "enum": [
874
+ 1,
875
+ 3,
876
+ 6,
877
+ 12
878
+ ],
879
+ "type": "integer"
880
+ }
881
+ },
882
+ {
883
+ "description": "报价时使用的优惠券 ID",
884
+ "in": "query",
885
+ "name": "with_coupon_id",
886
+ "schema": {
887
+ "type": "integer"
888
+ }
889
+ },
890
+ {
891
+ "description": "额外购买的公网 IP 数量",
892
+ "in": "query",
893
+ "name": "with_eip_num",
894
+ "schema": {
895
+ "type": "integer"
896
+ }
897
+ },
898
+ {
899
+ "description": "公网 IP 特性",
900
+ "in": "query",
901
+ "name": "with_eip_flags",
902
+ "schema": {
903
+ "type": "string"
904
+ }
905
+ },
906
+ {
907
+ "description": "按原价报价,忽略优惠券和折扣",
908
+ "in": "query",
909
+ "name": "is_old",
910
+ "schema": {
911
+ "type": "boolean"
912
+ }
913
+ },
914
+ {
915
+ "description": "是否忽略代理定价",
916
+ "in": "query",
917
+ "name": "ignore_agent",
918
+ "schema": {
919
+ "type": "boolean"
920
+ }
921
+ },
922
+ {
923
+ "description": "团购折扣",
924
+ "in": "query",
925
+ "name": "group_discount",
926
+ "schema": {
927
+ "type": "number"
928
+ }
929
+ }
930
+ ],
931
+ "responses": {
932
+ "200": {
933
+ "description": "data.price 是最终报价,data.detail 是价格明细",
934
+ "content": {
935
+ "application/json": {
936
+ "schema": {
937
+ "allOf": [
938
+ {
939
+ "$ref": "#/components/schemas/app.ResponseData"
940
+ },
941
+ {
942
+ "properties": {
943
+ "data": {
944
+ "$ref": "#/components/schemas/controllers.rcsPriceData"
945
+ }
946
+ },
947
+ "type": "object"
948
+ }
949
+ ]
950
+ }
951
+ }
952
+ }
953
+ },
954
+ "400": {
955
+ "$ref": "#/components/responses/BadRequest"
956
+ },
957
+ "403": {
958
+ "$ref": "#/components/responses/Forbidden"
959
+ },
960
+ "500": {
961
+ "$ref": "#/components/responses/ServerError"
962
+ }
963
+ },
964
+ "security": [],
965
+ "x-public": true
966
+ }
967
+ },
968
+ "/product/rgs/price": {
969
+ "get": {
970
+ "description": "创建和试用报价传 plan_id 和 config;升级传 product_id、dest_plan 和 config;续费或公网 IP 报价使用 product_id。config 是 URL 编码的 JSON 字符串。\n\n新版 API Key 所需 Scope(全部满足):rgs:pricing:read。\n\n默认匿名报价,仅支持 create、try 场景,不能使用账号优惠券。需要续费、升级等账号场景,或希望应用会员、代理关系及优惠券定价时,显式加 --authenticated;仍需本接口登记的 API Key 权限。匿名报价不保证等于你的实际下单价。",
971
+ "summary": "计算游戏云报价",
972
+ "tags": [
973
+ "rgs"
974
+ ],
975
+ "operationId": "get_product_rgs_price_9f5dc1f3",
976
+ "x-api-key-enabled": true,
977
+ "x-api-key-scopes": [
978
+ "rgs:pricing:read"
979
+ ],
980
+ "x-api-key-scope-mode": "all",
981
+ "x-source-route": "routers/init.go:450;services/product/rgs/utils.go:73;services/product/common.go:499",
982
+ "parameters": [
983
+ {
984
+ "description": "报价场景",
985
+ "in": "query",
986
+ "name": "scene",
987
+ "required": true,
988
+ "schema": {
989
+ "enum": [
990
+ "create",
991
+ "renew",
992
+ "upgrade",
993
+ "eip",
994
+ "try"
995
+ ],
996
+ "type": "string"
997
+ }
998
+ },
999
+ {
1000
+ "description": "资源配置的 JSON 字符串,包含 cpu(核)、memory(GB)、net_in、net_out(Mbps)、base_disk、data_disk(GB)、allocation、database、backup",
1001
+ "in": "query",
1002
+ "name": "config",
1003
+ "schema": {
1004
+ "type": "string"
1005
+ }
1006
+ },
1007
+ {
1008
+ "description": "新购按月报价,可省略或传 month。",
1009
+ "in": "query",
1010
+ "name": "pay_mode",
1011
+ "schema": {
1012
+ "type": "string"
1013
+ }
1014
+ },
1015
+ {
1016
+ "description": "购买的套餐 ID",
1017
+ "in": "query",
1018
+ "name": "plan_id",
1019
+ "schema": {
1020
+ "type": "integer"
1021
+ }
1022
+ },
1023
+ {
1024
+ "description": "已持有的游戏云实例 ID",
1025
+ "in": "query",
1026
+ "name": "product_id",
1027
+ "schema": {
1028
+ "type": "integer"
1029
+ }
1030
+ },
1031
+ {
1032
+ "description": "升级目标套餐 ID",
1033
+ "in": "query",
1034
+ "name": "dest_plan",
1035
+ "schema": {
1036
+ "type": "integer"
1037
+ }
1038
+ },
1039
+ {
1040
+ "description": "计价时长,月付可选 1、3、6、12",
1041
+ "in": "query",
1042
+ "name": "duration",
1043
+ "schema": {
1044
+ "type": "integer"
1045
+ }
1046
+ },
1047
+ {
1048
+ "description": "独立 IP 数量",
1049
+ "in": "query",
1050
+ "name": "with_eip_num",
1051
+ "schema": {
1052
+ "type": "integer"
1053
+ }
1054
+ },
1055
+ {
1056
+ "description": "独立 IP 特性",
1057
+ "in": "query",
1058
+ "name": "with_eip_flags",
1059
+ "schema": {
1060
+ "type": "string"
1061
+ }
1062
+ },
1063
+ {
1064
+ "description": "优惠券 ID",
1065
+ "in": "query",
1066
+ "name": "with_coupon_id",
1067
+ "schema": {
1068
+ "type": "integer"
1069
+ }
1070
+ },
1071
+ {
1072
+ "description": "计算未打折的原价",
1073
+ "in": "query",
1074
+ "name": "is_old",
1075
+ "schema": {
1076
+ "type": "boolean"
1077
+ }
1078
+ },
1079
+ {
1080
+ "description": "忽略代理定价",
1081
+ "in": "query",
1082
+ "name": "ignore_agent",
1083
+ "schema": {
1084
+ "type": "boolean"
1085
+ }
1086
+ },
1087
+ {
1088
+ "description": "团购报价的折扣",
1089
+ "in": "query",
1090
+ "name": "group_discount",
1091
+ "schema": {
1092
+ "type": "number"
1093
+ }
1094
+ }
1095
+ ],
1096
+ "responses": {
1097
+ "200": {
1098
+ "description": "成功",
1099
+ "content": {
1100
+ "application/json": {
1101
+ "schema": {
1102
+ "allOf": [
1103
+ {
1104
+ "$ref": "#/components/schemas/app.ResponseData"
1105
+ },
1106
+ {
1107
+ "properties": {
1108
+ "data": {
1109
+ "$ref": "#/components/schemas/controllers.rcsPriceData"
1110
+ }
1111
+ },
1112
+ "type": "object"
1113
+ }
1114
+ ]
1115
+ }
1116
+ }
1117
+ }
1118
+ },
1119
+ "400": {
1120
+ "$ref": "#/components/responses/BadRequest"
1121
+ },
1122
+ "403": {
1123
+ "$ref": "#/components/responses/Forbidden"
1124
+ },
1125
+ "500": {
1126
+ "$ref": "#/components/responses/ServerError"
1127
+ }
1128
+ },
1129
+ "security": [],
1130
+ "x-public": true
1131
+ }
1132
+ },
1133
+ "/product/ros/price": {
1134
+ "get": {
1135
+ "description": "购买时传 plan_id 和 duration,续费时传 product_id 和 duration,变更套餐时传 product_id 和 dest_plan。\n\n新版 API Key 所需 Scope(全部满足):ros:pricing:read。\n\n默认匿名报价,仅支持 create 场景,不能使用账号优惠券。需要续费、升级等账号场景,或希望应用会员、代理关系及优惠券定价时,显式加 --authenticated;仍需本接口登记的 API Key 权限。匿名报价不保证等于你的实际下单价。",
1136
+ "summary": "计算对象存储报价",
1137
+ "tags": [
1138
+ "ros"
1139
+ ],
1140
+ "operationId": "get_product_ros_price_04508044",
1141
+ "x-api-key-enabled": true,
1142
+ "x-api-key-scopes": [
1143
+ "ros:pricing:read"
1144
+ ],
1145
+ "x-api-key-scope-mode": "all",
1146
+ "x-source-route": "routers/init.go:458;services/product/ros/utils.go:65;services/product/common.go:499",
1147
+ "parameters": [
1148
+ {
1149
+ "description": "计价场景,购买、续费或变更套餐",
1150
+ "in": "query",
1151
+ "name": "scene",
1152
+ "required": true,
1153
+ "schema": {
1154
+ "enum": [
1155
+ "create",
1156
+ "renew",
1157
+ "upgrade"
1158
+ ],
1159
+ "type": "string"
1160
+ }
1161
+ },
1162
+ {
1163
+ "description": "购买的套餐 ID",
1164
+ "in": "query",
1165
+ "name": "plan_id",
1166
+ "schema": {
1167
+ "type": "integer"
1168
+ }
1169
+ },
1170
+ {
1171
+ "description": "续费或变更套餐的实例 ID",
1172
+ "in": "query",
1173
+ "name": "product_id",
1174
+ "schema": {
1175
+ "type": "integer"
1176
+ }
1177
+ },
1178
+ {
1179
+ "description": "购买或续费的月数",
1180
+ "in": "query",
1181
+ "name": "duration",
1182
+ "schema": {
1183
+ "enum": [
1184
+ 1,
1185
+ 3,
1186
+ 6,
1187
+ 12
1188
+ ],
1189
+ "type": "integer"
1190
+ }
1191
+ },
1192
+ {
1193
+ "description": "变更后的套餐 ID",
1194
+ "in": "query",
1195
+ "name": "dest_plan",
1196
+ "schema": {
1197
+ "type": "integer"
1198
+ }
1199
+ },
1200
+ {
1201
+ "description": "参与报价的优惠券 ID",
1202
+ "in": "query",
1203
+ "name": "with_coupon_id",
1204
+ "schema": {
1205
+ "type": "integer"
1206
+ }
1207
+ },
1208
+ {
1209
+ "description": "查询原价,忽略优惠券和时长折扣",
1210
+ "in": "query",
1211
+ "name": "is_old",
1212
+ "schema": {
1213
+ "type": "boolean"
1214
+ }
1215
+ },
1216
+ {
1217
+ "description": "报价时忽略代理定价",
1218
+ "in": "query",
1219
+ "name": "ignore_agent",
1220
+ "schema": {
1221
+ "type": "boolean"
1222
+ }
1223
+ },
1224
+ {
1225
+ "description": "购买报价使用的团购折扣",
1226
+ "in": "query",
1227
+ "name": "group_discount",
1228
+ "schema": {
1229
+ "type": "number"
1230
+ }
1231
+ }
1232
+ ],
1233
+ "responses": {
1234
+ "200": {
1235
+ "description": "成功",
1236
+ "content": {
1237
+ "application/json": {
1238
+ "schema": {
1239
+ "allOf": [
1240
+ {
1241
+ "$ref": "#/components/schemas/app.ResponseData"
1242
+ },
1243
+ {
1244
+ "properties": {
1245
+ "data": {
1246
+ "$ref": "#/components/schemas/controllers.rcsPriceData"
1247
+ }
1248
+ },
1249
+ "type": "object"
1250
+ }
1251
+ ]
1252
+ }
1253
+ }
1254
+ }
1255
+ },
1256
+ "400": {
1257
+ "$ref": "#/components/responses/BadRequest"
1258
+ },
1259
+ "403": {
1260
+ "$ref": "#/components/responses/Forbidden"
1261
+ },
1262
+ "500": {
1263
+ "$ref": "#/components/responses/ServerError"
1264
+ }
1265
+ },
1266
+ "security": [],
1267
+ "x-public": true
1268
+ }
1269
+ },
1270
+ "/product/rgs/egg": {
1271
+ "get": {
1272
+ "operationId": "public_rgs_eggs",
1273
+ "summary": "查询游戏模板",
1274
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
1275
+ "tags": [
1276
+ "公共"
1277
+ ],
1278
+ "security": [],
1279
+ "x-public": true,
1280
+ "x-api-key-enabled": false,
1281
+ "x-source-route": "routers/controllers/product_rgs_mcsm.go;services/product/rgs/list.go:65",
1282
+ "x-api-key-scopes": [],
1283
+ "parameters": [],
1284
+ "responses": {
1285
+ "200": {
1286
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1287
+ "content": {
1288
+ "application/json": {
1289
+ "schema": {
1290
+ "$ref": "#/components/schemas/PublicResponse"
1291
+ }
1292
+ }
1293
+ }
1294
+ }
1295
+ }
1296
+ }
1297
+ },
1298
+ "/product/rgs/egg_type": {
1299
+ "get": {
1300
+ "operationId": "public_rgs_egg_types",
1301
+ "summary": "查询游戏模板分类",
1302
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
1303
+ "tags": [
1304
+ "公共"
1305
+ ],
1306
+ "security": [],
1307
+ "x-public": true,
1308
+ "x-api-key-enabled": false,
1309
+ "x-source-route": "routers/controllers/product_rgs_mcsm.go;services/product/rgs/list.go:78",
1310
+ "x-api-key-scopes": [],
1311
+ "parameters": [],
1312
+ "responses": {
1313
+ "200": {
1314
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1315
+ "content": {
1316
+ "application/json": {
1317
+ "schema": {
1318
+ "$ref": "#/components/schemas/PublicResponse"
1319
+ }
1320
+ }
1321
+ }
1322
+ }
1323
+ }
1324
+ }
1325
+ },
1326
+ "/product/rgs/egg_server": {
1327
+ "get": {
1328
+ "operationId": "public_rgs_egg_servers",
1329
+ "summary": "查询游戏服务端类型",
1330
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
1331
+ "tags": [
1332
+ "公共"
1333
+ ],
1334
+ "security": [],
1335
+ "x-public": true,
1336
+ "x-api-key-enabled": false,
1337
+ "x-source-route": "routers/controllers/product_rgs_mcsm.go;services/product/rgs/list.go:84",
1338
+ "x-api-key-scopes": [],
1339
+ "parameters": [],
1340
+ "responses": {
1341
+ "200": {
1342
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1343
+ "content": {
1344
+ "application/json": {
1345
+ "schema": {
1346
+ "$ref": "#/components/schemas/PublicResponse"
1347
+ }
1348
+ }
1349
+ }
1350
+ }
1351
+ }
1352
+ }
1353
+ },
1354
+ "/product/fast-install-app": {
1355
+ "get": {
1356
+ "operationId": "public_fast_install_apps",
1357
+ "summary": "查询可快速安装的应用",
1358
+ "description": "这里只查询应用目录,不会安装软件。使用实际路由 /product/fast-install-app;旧 Swagger 注释中的 /fast-install-app 缺少前缀。",
1359
+ "tags": [
1360
+ "公共"
1361
+ ],
1362
+ "security": [],
1363
+ "x-public": true,
1364
+ "x-api-key-enabled": false,
1365
+ "x-source-route": "routers/init.go:465;routers/controllers/product.go:186;services/product/fast_install_app.go:22",
1366
+ "x-api-key-scopes": [],
1367
+ "parameters": [
1368
+ {
1369
+ "name": "product_type",
1370
+ "in": "query",
1371
+ "required": true,
1372
+ "description": "产品类型。",
1373
+ "schema": {
1374
+ "type": "string",
1375
+ "enum": [
1376
+ "rcs",
1377
+ "rgs"
1378
+ ]
1379
+ }
1380
+ },
1381
+ {
1382
+ "name": "os_name",
1383
+ "in": "query",
1384
+ "required": false,
1385
+ "description": "操作系统名称,用于匹配应用的系统要求。",
1386
+ "schema": {
1387
+ "type": "string"
1388
+ }
1389
+ }
1390
+ ],
1391
+ "responses": {
1392
+ "200": {
1393
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1394
+ "content": {
1395
+ "application/json": {
1396
+ "schema": {
1397
+ "$ref": "#/components/schemas/PublicResponse"
1398
+ }
1399
+ }
1400
+ }
1401
+ }
1402
+ }
1403
+ }
1404
+ },
1405
+ "/product/mcpack": {
1406
+ "get": {
1407
+ "operationId": "public_mcpack_list",
1408
+ "summary": "查询 Minecraft 整合包",
1409
+ "description": "返回 TotalRecords 与 Records。服务端默认 page=1、perPage=20,perPage 最大 100。options 可筛选/排序 chinese_name、recent_installs、order、update_date。",
1410
+ "tags": [
1411
+ "公共"
1412
+ ],
1413
+ "security": [],
1414
+ "x-public": true,
1415
+ "x-api-key-enabled": false,
1416
+ "x-source-route": "routers/init.go:466;services/mcpack/list.go:16",
1417
+ "x-api-key-scopes": [],
1418
+ "parameters": [
1419
+ {
1420
+ "name": "source",
1421
+ "in": "query",
1422
+ "required": false,
1423
+ "description": "来源;可使用 cn、modrinth、curseforge,其他来源按数据库筛选。",
1424
+ "schema": {
1425
+ "type": "string"
1426
+ }
1427
+ },
1428
+ {
1429
+ "name": "loader",
1430
+ "in": "query",
1431
+ "required": false,
1432
+ "description": "加载器筛选。",
1433
+ "schema": {
1434
+ "type": "string"
1435
+ }
1436
+ },
1437
+ {
1438
+ "name": "versions",
1439
+ "in": "query",
1440
+ "required": false,
1441
+ "description": "按一个或多个 Minecraft 版本筛选;使用重复查询键传递。",
1442
+ "schema": {
1443
+ "type": "array",
1444
+ "items": {
1445
+ "type": "string"
1446
+ }
1447
+ },
1448
+ "style": "form",
1449
+ "explode": true
1450
+ },
1451
+ {
1452
+ "name": "name",
1453
+ "in": "query",
1454
+ "required": false,
1455
+ "description": "名称关键词。",
1456
+ "schema": {
1457
+ "type": "string"
1458
+ }
1459
+ },
1460
+ {
1461
+ "name": "category",
1462
+ "in": "query",
1463
+ "required": false,
1464
+ "description": "分类。",
1465
+ "schema": {
1466
+ "type": "string"
1467
+ }
1468
+ },
1469
+ {
1470
+ "name": "options",
1471
+ "in": "query",
1472
+ "required": false,
1473
+ "description": "分页、筛选和排序条件的 JSON 字符串;CLI 也接受对象并只序列化一次。建议 page=1、perPage=20。",
1474
+ "schema": {
1475
+ "type": "string"
1476
+ },
1477
+ "x-json-content-schema": {
1478
+ "$ref": "#/components/schemas/PaginationOptions"
1479
+ }
1480
+ }
1481
+ ],
1482
+ "responses": {
1483
+ "200": {
1484
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1485
+ "content": {
1486
+ "application/json": {
1487
+ "schema": {
1488
+ "$ref": "#/components/schemas/PublicResponse"
1489
+ }
1490
+ }
1491
+ }
1492
+ }
1493
+ }
1494
+ }
1495
+ },
1496
+ "/product/mcpack/detail": {
1497
+ "get": {
1498
+ "operationId": "public_mcpack_detail",
1499
+ "summary": "查询 Minecraft 整合包详情",
1500
+ "description": "返回项目链接及版本列表。后端对外隐藏 download_url;不要把该接口描述为直接下载整合包文件。",
1501
+ "tags": [
1502
+ "公共"
1503
+ ],
1504
+ "security": [],
1505
+ "x-public": true,
1506
+ "x-api-key-enabled": false,
1507
+ "x-source-route": "routers/init.go:467;services/mcpack/detail.go:23",
1508
+ "x-api-key-scopes": [],
1509
+ "parameters": [
1510
+ {
1511
+ "name": "source",
1512
+ "in": "query",
1513
+ "required": true,
1514
+ "description": "整合包来源。",
1515
+ "schema": {
1516
+ "type": "string"
1517
+ }
1518
+ },
1519
+ {
1520
+ "name": "pack_id",
1521
+ "in": "query",
1522
+ "required": true,
1523
+ "description": "整合包 ID。",
1524
+ "schema": {
1525
+ "type": "string"
1526
+ }
1527
+ },
1528
+ {
1529
+ "name": "version_id",
1530
+ "in": "query",
1531
+ "required": false,
1532
+ "description": "版本 ID。",
1533
+ "schema": {
1534
+ "type": "string"
1535
+ }
1536
+ },
1537
+ {
1538
+ "name": "loader",
1539
+ "in": "query",
1540
+ "required": false,
1541
+ "description": "加载器。",
1542
+ "schema": {
1543
+ "type": "string"
1544
+ }
1545
+ },
1546
+ {
1547
+ "name": "game_version",
1548
+ "in": "query",
1549
+ "required": false,
1550
+ "description": "游戏版本。",
1551
+ "schema": {
1552
+ "type": "string"
1553
+ }
1554
+ }
1555
+ ],
1556
+ "responses": {
1557
+ "200": {
1558
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1559
+ "content": {
1560
+ "application/json": {
1561
+ "schema": {
1562
+ "$ref": "#/components/schemas/PublicResponse"
1563
+ }
1564
+ }
1565
+ }
1566
+ }
1567
+ }
1568
+ }
1569
+ },
1570
+ "/product/zones": {
1571
+ "get": {
1572
+ "operationId": "public_zones",
1573
+ "summary": "查询可用区",
1574
+ "description": "按 product、region、machine 查询可用区名称数组。字段没有 binding required,但不提供筛选条件可能返回空列表。",
1575
+ "tags": [
1576
+ "公共"
1577
+ ],
1578
+ "security": [],
1579
+ "x-public": true,
1580
+ "x-api-key-enabled": false,
1581
+ "x-source-route": "routers/init.go:469;routers/controllers/product.go:232;services/product/list.go:76",
1582
+ "x-api-key-scopes": [],
1583
+ "parameters": [
1584
+ {
1585
+ "name": "product",
1586
+ "in": "query",
1587
+ "required": false,
1588
+ "description": "产品类型。",
1589
+ "schema": {
1590
+ "type": "string"
1591
+ }
1592
+ },
1593
+ {
1594
+ "name": "region",
1595
+ "in": "query",
1596
+ "required": false,
1597
+ "description": "区域标识。",
1598
+ "schema": {
1599
+ "type": "string"
1600
+ }
1601
+ },
1602
+ {
1603
+ "name": "machine",
1604
+ "in": "query",
1605
+ "required": false,
1606
+ "description": "机型标识。",
1607
+ "schema": {
1608
+ "type": "string"
1609
+ }
1610
+ }
1611
+ ],
1612
+ "responses": {
1613
+ "200": {
1614
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1615
+ "content": {
1616
+ "application/json": {
1617
+ "schema": {
1618
+ "$ref": "#/components/schemas/PublicResponse"
1619
+ }
1620
+ }
1621
+ }
1622
+ }
1623
+ }
1624
+ }
1625
+ },
1626
+ "/product/panel_config": {
1627
+ "get": {
1628
+ "operationId": "public_panel_config",
1629
+ "summary": "查询公开面板配置",
1630
+ "description": "匿名请求按 Referer 匹配公开面板配置;未提供或未匹配域名时成功返回 data=null,不返回平台默认配置。本接口不接受 JSON 请求体;旧 Swagger 的更新配置请求体标注不适用于这个 GET。",
1631
+ "tags": [
1632
+ "公共"
1633
+ ],
1634
+ "security": [],
1635
+ "x-public": true,
1636
+ "x-api-key-enabled": false,
1637
+ "x-source-route": "routers/init.go:468;routers/controllers/product.go:158;services/product/panel_user.go:197",
1638
+ "x-api-key-scopes": [],
1639
+ "parameters": [
1640
+ {
1641
+ "name": "Referer",
1642
+ "in": "header",
1643
+ "required": false,
1644
+ "description": "面板来源站点,例如 https://panel.example.com/。后端据此匹配已配置的面板域名。",
1645
+ "schema": {
1646
+ "type": "string"
1647
+ }
1648
+ }
1649
+ ],
1650
+ "responses": {
1651
+ "200": {
1652
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1653
+ "content": {
1654
+ "application/json": {
1655
+ "schema": {
1656
+ "$ref": "#/components/schemas/PublicResponse"
1657
+ }
1658
+ }
1659
+ }
1660
+ }
1661
+ }
1662
+ }
1663
+ },
1664
+ "/product/playmp/competitions/{id}/public": {
1665
+ "get": {
1666
+ "operationId": "public_playmp_competition",
1667
+ "summary": "查询公开比赛详情",
1668
+ "description": "返回比赛公开资料及公开玩家信息;不存在的比赛返回错误,draft、dropped、waiting 状态不公开。虽然原用户文档按 playmp 标签隐藏,本接口实际允许匿名 JSON 查询,因此本次收录。",
1669
+ "tags": [
1670
+ "公共"
1671
+ ],
1672
+ "security": [],
1673
+ "x-public": true,
1674
+ "x-api-key-enabled": false,
1675
+ "x-source-route": "routers/init.go:487;routers/controllers/product_playmp.go:441;services/product/playmp/competition.go:848;models/productM/playmp_competition.go:173",
1676
+ "x-api-key-scopes": [],
1677
+ "parameters": [
1678
+ {
1679
+ "name": "id",
1680
+ "in": "path",
1681
+ "required": true,
1682
+ "description": "比赛 MongoDB ObjectID,24 位十六进制字符串;不是整数。",
1683
+ "schema": {
1684
+ "type": "string",
1685
+ "pattern": "^[0-9a-fA-F]{24}$"
1686
+ }
1687
+ }
1688
+ ],
1689
+ "responses": {
1690
+ "200": {
1691
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1692
+ "content": {
1693
+ "application/json": {
1694
+ "schema": {
1695
+ "$ref": "#/components/schemas/PublicResponse"
1696
+ }
1697
+ }
1698
+ }
1699
+ }
1700
+ }
1701
+ }
1702
+ },
1703
+ "/product/buy_group/list": {
1704
+ "get": {
1705
+ "operationId": "public_buy_groups",
1706
+ "summary": "查询公开团购列表",
1707
+ "description": "仅查询未结束的公开团购。options 支持 UID 筛选;不支持匿名加入、发起或确认团购。",
1708
+ "tags": [
1709
+ "公共"
1710
+ ],
1711
+ "security": [],
1712
+ "x-public": true,
1713
+ "x-api-key-enabled": false,
1714
+ "x-source-route": "routers/init.go:475;routers/controllers/product.go:245;services/product/buy_group/buy_group.go:31",
1715
+ "x-api-key-scopes": [],
1716
+ "parameters": [
1717
+ {
1718
+ "name": "product_type",
1719
+ "in": "query",
1720
+ "required": true,
1721
+ "description": "产品类型。",
1722
+ "schema": {
1723
+ "type": "string"
1724
+ }
1725
+ },
1726
+ {
1727
+ "name": "options",
1728
+ "in": "query",
1729
+ "required": true,
1730
+ "description": "分页、筛选和排序条件的 JSON 字符串;CLI 也接受对象并只序列化一次。建议 page=1、perPage=20。",
1731
+ "schema": {
1732
+ "type": "string"
1733
+ },
1734
+ "x-json-content-schema": {
1735
+ "$ref": "#/components/schemas/PaginationOptions"
1736
+ }
1737
+ }
1738
+ ],
1739
+ "responses": {
1740
+ "200": {
1741
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1742
+ "content": {
1743
+ "application/json": {
1744
+ "schema": {
1745
+ "$ref": "#/components/schemas/PublicResponse"
1746
+ }
1747
+ }
1748
+ }
1749
+ }
1750
+ }
1751
+ }
1752
+ },
1753
+ "/product/buy_group/discount": {
1754
+ "get": {
1755
+ "operationId": "public_buy_group_discount",
1756
+ "summary": "查询团购折扣配置",
1757
+ "description": "实际路由为 GET,且无需 product_type 参数。旧控制器注释误标 POST。返回公开团购折扣映射。",
1758
+ "tags": [
1759
+ "公共"
1760
+ ],
1761
+ "security": [],
1762
+ "x-public": true,
1763
+ "x-api-key-enabled": false,
1764
+ "x-source-route": "routers/init.go:476;routers/controllers/product.go:323",
1765
+ "x-api-key-scopes": [],
1766
+ "parameters": [],
1767
+ "responses": {
1768
+ "200": {
1769
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1770
+ "content": {
1771
+ "application/json": {
1772
+ "schema": {
1773
+ "$ref": "#/components/schemas/PublicResponse"
1774
+ }
1775
+ }
1776
+ }
1777
+ }
1778
+ }
1779
+ }
1780
+ },
1781
+ "/product/buy_group/{gid}": {
1782
+ "get": {
1783
+ "operationId": "public_buy_group_detail",
1784
+ "summary": "查询公开团购详情",
1785
+ "description": "无需登录或 API Key。CLI 默认匿名请求,不读取或发送凭证。",
1786
+ "tags": [
1787
+ "公共"
1788
+ ],
1789
+ "security": [],
1790
+ "x-public": true,
1791
+ "x-api-key-enabled": false,
1792
+ "x-source-route": "routers/init.go:477;routers/controllers/product.go:258;services/product/buy_group/buy_group.go:60",
1793
+ "x-api-key-scopes": [],
1794
+ "parameters": [
1795
+ {
1796
+ "name": "gid",
1797
+ "in": "path",
1798
+ "required": true,
1799
+ "description": "团购 ID。",
1800
+ "schema": {
1801
+ "type": "integer",
1802
+ "minimum": 1
1803
+ }
1804
+ }
1805
+ ],
1806
+ "responses": {
1807
+ "200": {
1808
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1809
+ "content": {
1810
+ "application/json": {
1811
+ "schema": {
1812
+ "$ref": "#/components/schemas/PublicResponse"
1813
+ }
1814
+ }
1815
+ }
1816
+ }
1817
+ }
1818
+ }
1819
+ },
1820
+ "/upload_image": {
1821
+ "post": {
1822
+ "operationId": "public_upload_image",
1823
+ "summary": "上传公共图片",
1824
+ "description": "公开写操作。使用 --file image=本地路径 上传 multipart 图片,返回 data 图片地址。请使用真正的 JPEG 图片:后端以 .jpg 和 image/jpeg 保存原始字节,后端和 CLI 均不转码。后端按 IP 限流。",
1825
+ "tags": [
1826
+ "公共"
1827
+ ],
1828
+ "security": [],
1829
+ "x-public": true,
1830
+ "x-api-key-enabled": false,
1831
+ "x-source-route": "routers/init.go:133;routers/controllers/workorder.go:340",
1832
+ "x-api-key-scopes": [],
1833
+ "parameters": [],
1834
+ "responses": {
1835
+ "200": {
1836
+ "description": "HTTP 与业务 code 均成功才视为成功。",
1837
+ "content": {
1838
+ "application/json": {
1839
+ "schema": {
1840
+ "$ref": "#/components/schemas/PublicResponse"
1841
+ }
1842
+ }
1843
+ }
1844
+ }
1845
+ },
1846
+ "requestBody": {
1847
+ "required": true,
1848
+ "content": {
1849
+ "multipart/form-data": {
1850
+ "schema": {
1851
+ "type": "object",
1852
+ "required": [
1853
+ "image"
1854
+ ],
1855
+ "properties": {
1856
+ "image": {
1857
+ "type": "string",
1858
+ "format": "binary"
1859
+ }
1860
+ }
1861
+ }
1862
+ }
1863
+ }
1864
+ }
1865
+ }
1866
+ }
1867
+ },
1868
+ "components": {
1869
+ "schemas": {
1870
+ "PublicResponse": {
1871
+ "type": "object",
1872
+ "required": [
1873
+ "code"
1874
+ ],
1875
+ "properties": {
1876
+ "code": {
1877
+ "type": "integer",
1878
+ "description": "业务成功码为 200;HTTP 200 不保证业务成功。"
1879
+ },
1880
+ "data": {
1881
+ "description": "保留服务端原始结果;可为对象、数组、字符串、数字或 null。"
1882
+ },
1883
+ "message": {
1884
+ "type": "string"
1885
+ }
1886
+ },
1887
+ "additionalProperties": true
1888
+ }
1889
+ }
1890
+ }
1891
+ }