gitee.com/woood2/luca@v1.0.4/cmd/backend/docs/swagger.json (about) 1 { 2 "swagger": "2.0", 3 "info": { 4 "description": "基于Gin封装的demo项目", 5 "title": "Luca APIs", 6 "contact": {}, 7 "license": {}, 8 "version": "1.0" 9 }, 10 "basePath": "/", 11 "paths": { 12 "/apps": { 13 "get": { 14 "security": [ 15 { 16 "ApiKeyAuth": [] 17 } 18 ], 19 "description": "批量获取应用列表,支持模糊查询", 20 "consumes": [ 21 "application/json" 22 ], 23 "produces": [ 24 "application/json" 25 ], 26 "tags": [ 27 "应用" 28 ], 29 "summary": "应用列表", 30 "operationId": "list-app", 31 "parameters": [ 32 { 33 "type": "string", 34 "description": "应用标识", 35 "name": "appkey", 36 "in": "query" 37 }, 38 { 39 "type": "string", 40 "description": "应用名称", 41 "name": "name", 42 "in": "query" 43 } 44 ], 45 "responses": { 46 "200": { 47 "description": "OK", 48 "schema": { 49 "allOf": [ 50 { 51 "$ref": "#/definitions/errcode.Resp" 52 }, 53 { 54 "type": "object", 55 "properties": { 56 "data": { 57 "type": "array", 58 "items": { 59 "$ref": "#/definitions/controller.App" 60 } 61 } 62 } 63 } 64 ] 65 } 66 }, 67 "400": { 68 "description": "Bad Request", 69 "schema": { 70 "type": "string" 71 } 72 }, 73 "401": { 74 "description": "Unauthorized", 75 "schema": { 76 "type": "string" 77 } 78 }, 79 "403": { 80 "description": "Forbidden", 81 "schema": { 82 "type": "string" 83 } 84 }, 85 "500": { 86 "description": "Internal Server Error", 87 "schema": { 88 "$ref": "#/definitions/errcode.Resp" 89 } 90 } 91 } 92 }, 93 "post": { 94 "security": [ 95 { 96 "ApiKeyAuth": [] 97 } 98 ], 99 "description": "创建一个新的应用", 100 "consumes": [ 101 "application/json" 102 ], 103 "produces": [ 104 "application/json" 105 ], 106 "tags": [ 107 "应用" 108 ], 109 "summary": "应用创建", 110 "operationId": "create-app", 111 "parameters": [ 112 { 113 "description": "应用参数", 114 "name": "CreateAppParam", 115 "in": "body", 116 "required": true, 117 "schema": { 118 "$ref": "#/definitions/controller.CreateAppParam" 119 } 120 } 121 ], 122 "responses": { 123 "200": { 124 "description": "OK", 125 "schema": { 126 "allOf": [ 127 { 128 "$ref": "#/definitions/errcode.Resp" 129 }, 130 { 131 "type": "object", 132 "properties": { 133 "data": { 134 "$ref": "#/definitions/controller.App" 135 } 136 } 137 } 138 ] 139 } 140 }, 141 "400": { 142 "description": "Bad Request", 143 "schema": { 144 "type": "string" 145 } 146 }, 147 "401": { 148 "description": "Unauthorized", 149 "schema": { 150 "type": "string" 151 } 152 }, 153 "403": { 154 "description": "Forbidden", 155 "schema": { 156 "type": "string" 157 } 158 }, 159 "500": { 160 "description": "Internal Server Error", 161 "schema": { 162 "$ref": "#/definitions/errcode.Resp" 163 } 164 } 165 } 166 } 167 }, 168 "/apps/{appkey}": { 169 "get": { 170 "security": [ 171 { 172 "ApiKeyAuth": [] 173 } 174 ], 175 "description": "查询单个应用详情", 176 "consumes": [ 177 "application/json" 178 ], 179 "produces": [ 180 "application/json" 181 ], 182 "tags": [ 183 "应用" 184 ], 185 "summary": "应用查询", 186 "operationId": "get-app", 187 "parameters": [ 188 { 189 "type": "string", 190 "description": "应用标识", 191 "name": "appkey", 192 "in": "path", 193 "required": true 194 } 195 ], 196 "responses": { 197 "200": { 198 "description": "OK", 199 "schema": { 200 "allOf": [ 201 { 202 "$ref": "#/definitions/errcode.Resp" 203 }, 204 { 205 "type": "object", 206 "properties": { 207 "data": { 208 "$ref": "#/definitions/controller.App" 209 } 210 } 211 } 212 ] 213 } 214 }, 215 "401": { 216 "description": "Unauthorized", 217 "schema": { 218 "type": "string" 219 } 220 }, 221 "403": { 222 "description": "Forbidden", 223 "schema": { 224 "type": "string" 225 } 226 }, 227 "500": { 228 "description": "Internal Server Error", 229 "schema": { 230 "$ref": "#/definitions/errcode.Resp" 231 } 232 } 233 } 234 }, 235 "put": { 236 "security": [ 237 { 238 "ApiKeyAuth": [] 239 } 240 ], 241 "description": "修改应用的属性", 242 "consumes": [ 243 "application/json" 244 ], 245 "produces": [ 246 "application/json" 247 ], 248 "tags": [ 249 "应用" 250 ], 251 "summary": "应用修改", 252 "operationId": "edit-app", 253 "parameters": [ 254 { 255 "type": "string", 256 "description": "应用标识", 257 "name": "appkey", 258 "in": "path", 259 "required": true 260 }, 261 { 262 "description": "应用参数", 263 "name": "EditAppParam", 264 "in": "body", 265 "required": true, 266 "schema": { 267 "$ref": "#/definitions/controller.EditAppParam" 268 } 269 } 270 ], 271 "responses": { 272 "200": { 273 "description": "OK", 274 "schema": { 275 "allOf": [ 276 { 277 "$ref": "#/definitions/errcode.Resp" 278 }, 279 { 280 "type": "object", 281 "properties": { 282 "data": { 283 "type": "boolean" 284 } 285 } 286 } 287 ] 288 } 289 }, 290 "400": { 291 "description": "Bad Request", 292 "schema": { 293 "type": "string" 294 } 295 }, 296 "401": { 297 "description": "Unauthorized", 298 "schema": { 299 "type": "string" 300 } 301 }, 302 "403": { 303 "description": "Forbidden", 304 "schema": { 305 "type": "string" 306 } 307 }, 308 "500": { 309 "description": "Internal Server Error", 310 "schema": { 311 "$ref": "#/definitions/errcode.Resp" 312 } 313 } 314 } 315 }, 316 "delete": { 317 "security": [ 318 { 319 "ApiKeyAuth": [] 320 } 321 ], 322 "description": "删除一个应用", 323 "consumes": [ 324 "application/json" 325 ], 326 "produces": [ 327 "application/json" 328 ], 329 "tags": [ 330 "应用" 331 ], 332 "summary": "应用删除", 333 "operationId": "delete-app", 334 "parameters": [ 335 { 336 "type": "string", 337 "description": "应用标识", 338 "name": "appkey", 339 "in": "path", 340 "required": true 341 } 342 ], 343 "responses": { 344 "200": { 345 "description": "OK", 346 "schema": { 347 "allOf": [ 348 { 349 "$ref": "#/definitions/errcode.Resp" 350 }, 351 { 352 "type": "object", 353 "properties": { 354 "data": { 355 "type": "boolean" 356 } 357 } 358 } 359 ] 360 } 361 }, 362 "401": { 363 "description": "Unauthorized", 364 "schema": { 365 "type": "string" 366 } 367 }, 368 "403": { 369 "description": "Forbidden", 370 "schema": { 371 "type": "string" 372 } 373 }, 374 "500": { 375 "description": "Internal Server Error", 376 "schema": { 377 "$ref": "#/definitions/errcode.Resp" 378 } 379 } 380 } 381 } 382 }, 383 "/apps/{appkey}/disabled": { 384 "put": { 385 "security": [ 386 { 387 "ApiKeyAuth": [] 388 } 389 ], 390 "description": "转变一个应用的状态", 391 "consumes": [ 392 "application/json" 393 ], 394 "produces": [ 395 "application/json" 396 ], 397 "tags": [ 398 "应用" 399 ], 400 "summary": "应用启用/禁用", 401 "operationId": "change-app-disabled", 402 "parameters": [ 403 { 404 "type": "string", 405 "description": "应用标识", 406 "name": "appkey", 407 "in": "path", 408 "required": true 409 }, 410 { 411 "description": "参数", 412 "name": "ChangeAppDisabledParam", 413 "in": "body", 414 "required": true, 415 "schema": { 416 "$ref": "#/definitions/controller.ChangeAppDisabledParam" 417 } 418 } 419 ], 420 "responses": { 421 "200": { 422 "description": "OK", 423 "schema": { 424 "allOf": [ 425 { 426 "$ref": "#/definitions/errcode.Resp" 427 }, 428 { 429 "type": "object", 430 "properties": { 431 "data": { 432 "type": "boolean" 433 } 434 } 435 } 436 ] 437 } 438 }, 439 "400": { 440 "description": "Bad Request", 441 "schema": { 442 "type": "string" 443 } 444 }, 445 "401": { 446 "description": "Unauthorized", 447 "schema": { 448 "type": "string" 449 } 450 }, 451 "403": { 452 "description": "Forbidden", 453 "schema": { 454 "type": "string" 455 } 456 }, 457 "500": { 458 "description": "Internal Server Error", 459 "schema": { 460 "$ref": "#/definitions/errcode.Resp" 461 } 462 } 463 } 464 } 465 } 466 }, 467 "definitions": { 468 "controller.App": { 469 "type": "object", 470 "properties": { 471 "appkey": { 472 "type": "string", 473 "example": "weibo" 474 }, 475 "contacts": { 476 "type": "string", 477 "example": "@来去之间" 478 }, 479 "createtime": { 480 "type": "string", 481 "example": "2006-01-02 15:04:05" 482 }, 483 "disabled": { 484 "type": "integer", 485 "example": 0 486 }, 487 "id": { 488 "type": "integer", 489 "example": 24 490 }, 491 "logo": { 492 "type": "string", 493 "example": "https://img.t.sinajs.cn/t6/style/images/apple/wbfont.svg" 494 }, 495 "name": { 496 "type": "string", 497 "example": "新浪微博" 498 }, 499 "remark": { 500 "type": "string", 501 "example": "备注" 502 }, 503 "secret": { 504 "type": "string", 505 "example": "wow24^_^" 506 }, 507 "updatetime": { 508 "type": "string", 509 "example": "2006-01-02 15:04:05" 510 }, 511 "url": { 512 "type": "string", 513 "example": "https://weibo.com" 514 } 515 } 516 }, 517 "controller.ChangeAppDisabledParam": { 518 "type": "object", 519 "properties": { 520 "disabled": { 521 "type": "boolean", 522 "example": true 523 } 524 } 525 }, 526 "controller.CreateAppParam": { 527 "type": "object", 528 "required": [ 529 "appkey", 530 "name", 531 "secret" 532 ], 533 "properties": { 534 "appkey": { 535 "type": "string", 536 "example": "weibo" 537 }, 538 "contacts": { 539 "type": "string", 540 "example": "@来去之间" 541 }, 542 "logo": { 543 "type": "string", 544 "example": "https://img.t.sinajs.cn/t6/style/images/apple/wbfont.svg" 545 }, 546 "name": { 547 "type": "string", 548 "example": "新浪微博" 549 }, 550 "remark": { 551 "type": "string", 552 "example": "备注" 553 }, 554 "secret": { 555 "type": "string", 556 "example": "wow24^_^" 557 }, 558 "url": { 559 "type": "string", 560 "example": "https://weibo.com" 561 } 562 } 563 }, 564 "controller.EditAppParam": { 565 "type": "object", 566 "required": [ 567 "name", 568 "secret" 569 ], 570 "properties": { 571 "contacts": { 572 "type": "string", 573 "example": "@来去之间" 574 }, 575 "logo": { 576 "type": "string", 577 "example": "https://img.t.sinajs.cn/t6/style/images/apple/wbfont.svg" 578 }, 579 "name": { 580 "type": "string", 581 "example": "新浪微博" 582 }, 583 "remark": { 584 "type": "string", 585 "example": "备注" 586 }, 587 "secret": { 588 "type": "string", 589 "example": "wow24^_^" 590 }, 591 "url": { 592 "type": "string", 593 "example": "https://weibo.com" 594 } 595 } 596 }, 597 "errcode.Resp": { 598 "type": "object", 599 "properties": { 600 "data": { 601 "type": "object" 602 }, 603 "errCode": { 604 "type": "string" 605 }, 606 "errMsg": { 607 "type": "string" 608 }, 609 "stack": { 610 "type": "string" 611 }, 612 "traceID": { 613 "type": "string" 614 } 615 } 616 } 617 }, 618 "securityDefinitions": { 619 "ApiKeyAuth": { 620 "type": "apiKey", 621 "name": "token", 622 "in": "header" 623 } 624 } 625 }