ljw 1 year ago
parent
commit
ef414855f0
3 changed files with 497 additions and 9 deletions
  1. 189 3
      docs/api/api_docs.go
  2. 189 3
      docs/api/api_swagger.json
  3. 119 3
      docs/api/api_swagger.yaml

+ 189 - 3
docs/api/api_docs.go

@@ -136,7 +136,7 @@ const docTemplateapi = `{
136 136
                     "application/json"
137 137
                 ],
138 138
                 "tags": [
139
-                    "地址"
139
+                    "地址[Personal]"
140 140
                 ],
141 141
                 "summary": "标签添加",
142 142
                 "responses": {
@@ -155,7 +155,7 @@ const docTemplateapi = `{
155 155
                 }
156 156
             }
157 157
         },
158
-        "/ab/peer/add/{id}": {
158
+        "/ab/peer/add/{guid}": {
159 159
             "post": {
160 160
                 "security": [
161 161
                     {
@@ -196,6 +196,90 @@ const docTemplateapi = `{
196 196
                         }
197 197
                     }
198 198
                 }
199
+            },
200
+            "delete": {
201
+                "security": [
202
+                    {
203
+                        "BearerAuth": []
204
+                    }
205
+                ],
206
+                "description": "删除地址",
207
+                "consumes": [
208
+                    "application/json"
209
+                ],
210
+                "produces": [
211
+                    "application/json"
212
+                ],
213
+                "tags": [
214
+                    "地址[Personal]"
215
+                ],
216
+                "summary": "删除地址",
217
+                "parameters": [
218
+                    {
219
+                        "type": "string",
220
+                        "description": "id",
221
+                        "name": "id",
222
+                        "in": "path",
223
+                        "required": true
224
+                    }
225
+                ],
226
+                "responses": {
227
+                    "200": {
228
+                        "description": "OK",
229
+                        "schema": {
230
+                            "type": "string"
231
+                        }
232
+                    },
233
+                    "500": {
234
+                        "description": "Internal Server Error",
235
+                        "schema": {
236
+                            "$ref": "#/definitions/response.ErrorResponse"
237
+                        }
238
+                    }
239
+                }
240
+            }
241
+        },
242
+        "/ab/peer/update/{guid}": {
243
+            "put": {
244
+                "security": [
245
+                    {
246
+                        "BearerAuth": []
247
+                    }
248
+                ],
249
+                "description": "更新地址",
250
+                "consumes": [
251
+                    "application/json"
252
+                ],
253
+                "produces": [
254
+                    "application/json"
255
+                ],
256
+                "tags": [
257
+                    "地址[Personal]"
258
+                ],
259
+                "summary": "更新地址",
260
+                "parameters": [
261
+                    {
262
+                        "type": "string",
263
+                        "description": "id",
264
+                        "name": "id",
265
+                        "in": "path",
266
+                        "required": true
267
+                    }
268
+                ],
269
+                "responses": {
270
+                    "200": {
271
+                        "description": "OK",
272
+                        "schema": {
273
+                            "type": "string"
274
+                        }
275
+                    },
276
+                    "500": {
277
+                        "description": "Internal Server Error",
278
+                        "schema": {
279
+                            "$ref": "#/definitions/response.ErrorResponse"
280
+                        }
281
+                    }
282
+                }
199 283
             }
200 284
         },
201 285
         "/ab/peers": {
@@ -374,7 +458,109 @@ const docTemplateapi = `{
374 458
                 }
375 459
             }
376 460
         },
377
-        "/ab/tags/{id}": {
461
+        "/ab/tag/rename/{guid}": {
462
+            "put": {
463
+                "security": [
464
+                    {
465
+                        "BearerAuth": []
466
+                    }
467
+                ],
468
+                "description": "标签",
469
+                "consumes": [
470
+                    "application/json"
471
+                ],
472
+                "produces": [
473
+                    "application/json"
474
+                ],
475
+                "tags": [
476
+                    "地址[Personal]"
477
+                ],
478
+                "summary": "标签重命名",
479
+                "responses": {
480
+                    "200": {
481
+                        "description": "OK",
482
+                        "schema": {
483
+                            "type": "string"
484
+                        }
485
+                    },
486
+                    "500": {
487
+                        "description": "Internal Server Error",
488
+                        "schema": {
489
+                            "$ref": "#/definitions/response.ErrorResponse"
490
+                        }
491
+                    }
492
+                }
493
+            }
494
+        },
495
+        "/ab/tag/update/{guid}": {
496
+            "put": {
497
+                "security": [
498
+                    {
499
+                        "BearerAuth": []
500
+                    }
501
+                ],
502
+                "description": "标签",
503
+                "consumes": [
504
+                    "application/json"
505
+                ],
506
+                "produces": [
507
+                    "application/json"
508
+                ],
509
+                "tags": [
510
+                    "地址[Personal]"
511
+                ],
512
+                "summary": "标签修改颜色",
513
+                "responses": {
514
+                    "200": {
515
+                        "description": "OK",
516
+                        "schema": {
517
+                            "type": "string"
518
+                        }
519
+                    },
520
+                    "500": {
521
+                        "description": "Internal Server Error",
522
+                        "schema": {
523
+                            "$ref": "#/definitions/response.ErrorResponse"
524
+                        }
525
+                    }
526
+                }
527
+            }
528
+        },
529
+        "/ab/tag/{guid}": {
530
+            "delete": {
531
+                "security": [
532
+                    {
533
+                        "BearerAuth": []
534
+                    }
535
+                ],
536
+                "description": "标签",
537
+                "consumes": [
538
+                    "application/json"
539
+                ],
540
+                "produces": [
541
+                    "application/json"
542
+                ],
543
+                "tags": [
544
+                    "地址[Personal]"
545
+                ],
546
+                "summary": "标签删除",
547
+                "responses": {
548
+                    "200": {
549
+                        "description": "OK",
550
+                        "schema": {
551
+                            "type": "string"
552
+                        }
553
+                    },
554
+                    "500": {
555
+                        "description": "Internal Server Error",
556
+                        "schema": {
557
+                            "$ref": "#/definitions/response.ErrorResponse"
558
+                        }
559
+                    }
560
+                }
561
+            }
562
+        },
563
+        "/ab/tags/{guid}": {
378 564
             "post": {
379 565
                 "security": [
380 566
                     {

+ 189 - 3
docs/api/api_swagger.json

@@ -129,7 +129,7 @@
129 129
                     "application/json"
130 130
                 ],
131 131
                 "tags": [
132
-                    "地址"
132
+                    "地址[Personal]"
133 133
                 ],
134 134
                 "summary": "标签添加",
135 135
                 "responses": {
@@ -148,7 +148,7 @@
148 148
                 }
149 149
             }
150 150
         },
151
-        "/ab/peer/add/{id}": {
151
+        "/ab/peer/add/{guid}": {
152 152
             "post": {
153 153
                 "security": [
154 154
                     {
@@ -189,6 +189,90 @@
189 189
                         }
190 190
                     }
191 191
                 }
192
+            },
193
+            "delete": {
194
+                "security": [
195
+                    {
196
+                        "BearerAuth": []
197
+                    }
198
+                ],
199
+                "description": "删除地址",
200
+                "consumes": [
201
+                    "application/json"
202
+                ],
203
+                "produces": [
204
+                    "application/json"
205
+                ],
206
+                "tags": [
207
+                    "地址[Personal]"
208
+                ],
209
+                "summary": "删除地址",
210
+                "parameters": [
211
+                    {
212
+                        "type": "string",
213
+                        "description": "id",
214
+                        "name": "id",
215
+                        "in": "path",
216
+                        "required": true
217
+                    }
218
+                ],
219
+                "responses": {
220
+                    "200": {
221
+                        "description": "OK",
222
+                        "schema": {
223
+                            "type": "string"
224
+                        }
225
+                    },
226
+                    "500": {
227
+                        "description": "Internal Server Error",
228
+                        "schema": {
229
+                            "$ref": "#/definitions/response.ErrorResponse"
230
+                        }
231
+                    }
232
+                }
233
+            }
234
+        },
235
+        "/ab/peer/update/{guid}": {
236
+            "put": {
237
+                "security": [
238
+                    {
239
+                        "BearerAuth": []
240
+                    }
241
+                ],
242
+                "description": "更新地址",
243
+                "consumes": [
244
+                    "application/json"
245
+                ],
246
+                "produces": [
247
+                    "application/json"
248
+                ],
249
+                "tags": [
250
+                    "地址[Personal]"
251
+                ],
252
+                "summary": "更新地址",
253
+                "parameters": [
254
+                    {
255
+                        "type": "string",
256
+                        "description": "id",
257
+                        "name": "id",
258
+                        "in": "path",
259
+                        "required": true
260
+                    }
261
+                ],
262
+                "responses": {
263
+                    "200": {
264
+                        "description": "OK",
265
+                        "schema": {
266
+                            "type": "string"
267
+                        }
268
+                    },
269
+                    "500": {
270
+                        "description": "Internal Server Error",
271
+                        "schema": {
272
+                            "$ref": "#/definitions/response.ErrorResponse"
273
+                        }
274
+                    }
275
+                }
192 276
             }
193 277
         },
194 278
         "/ab/peers": {
@@ -367,7 +451,109 @@
367 451
                 }
368 452
             }
369 453
         },
370
-        "/ab/tags/{id}": {
454
+        "/ab/tag/rename/{guid}": {
455
+            "put": {
456
+                "security": [
457
+                    {
458
+                        "BearerAuth": []
459
+                    }
460
+                ],
461
+                "description": "标签",
462
+                "consumes": [
463
+                    "application/json"
464
+                ],
465
+                "produces": [
466
+                    "application/json"
467
+                ],
468
+                "tags": [
469
+                    "地址[Personal]"
470
+                ],
471
+                "summary": "标签重命名",
472
+                "responses": {
473
+                    "200": {
474
+                        "description": "OK",
475
+                        "schema": {
476
+                            "type": "string"
477
+                        }
478
+                    },
479
+                    "500": {
480
+                        "description": "Internal Server Error",
481
+                        "schema": {
482
+                            "$ref": "#/definitions/response.ErrorResponse"
483
+                        }
484
+                    }
485
+                }
486
+            }
487
+        },
488
+        "/ab/tag/update/{guid}": {
489
+            "put": {
490
+                "security": [
491
+                    {
492
+                        "BearerAuth": []
493
+                    }
494
+                ],
495
+                "description": "标签",
496
+                "consumes": [
497
+                    "application/json"
498
+                ],
499
+                "produces": [
500
+                    "application/json"
501
+                ],
502
+                "tags": [
503
+                    "地址[Personal]"
504
+                ],
505
+                "summary": "标签修改颜色",
506
+                "responses": {
507
+                    "200": {
508
+                        "description": "OK",
509
+                        "schema": {
510
+                            "type": "string"
511
+                        }
512
+                    },
513
+                    "500": {
514
+                        "description": "Internal Server Error",
515
+                        "schema": {
516
+                            "$ref": "#/definitions/response.ErrorResponse"
517
+                        }
518
+                    }
519
+                }
520
+            }
521
+        },
522
+        "/ab/tag/{guid}": {
523
+            "delete": {
524
+                "security": [
525
+                    {
526
+                        "BearerAuth": []
527
+                    }
528
+                ],
529
+                "description": "标签",
530
+                "consumes": [
531
+                    "application/json"
532
+                ],
533
+                "produces": [
534
+                    "application/json"
535
+                ],
536
+                "tags": [
537
+                    "地址[Personal]"
538
+                ],
539
+                "summary": "标签删除",
540
+                "responses": {
541
+                    "200": {
542
+                        "description": "OK",
543
+                        "schema": {
544
+                            "type": "string"
545
+                        }
546
+                    },
547
+                    "500": {
548
+                        "description": "Internal Server Error",
549
+                        "schema": {
550
+                            "$ref": "#/definitions/response.ErrorResponse"
551
+                        }
552
+                    }
553
+                }
554
+            }
555
+        },
556
+        "/ab/tags/{guid}": {
371 557
             "post": {
372 558
                 "security": [
373 559
                     {

+ 119 - 3
docs/api/api_swagger.yaml

@@ -228,8 +228,34 @@ paths:
228 228
       - BearerAuth: []
229 229
       summary: 标签添加
230 230
       tags:
231
-      - 地址
232
-  /ab/peer/add/{id}:
231
+      - 地址[Personal]
232
+  /ab/peer/add/{guid}:
233
+    delete:
234
+      consumes:
235
+      - application/json
236
+      description: 删除地址
237
+      parameters:
238
+      - description: id
239
+        in: path
240
+        name: id
241
+        required: true
242
+        type: string
243
+      produces:
244
+      - application/json
245
+      responses:
246
+        "200":
247
+          description: OK
248
+          schema:
249
+            type: string
250
+        "500":
251
+          description: Internal Server Error
252
+          schema:
253
+            $ref: '#/definitions/response.ErrorResponse'
254
+      security:
255
+      - BearerAuth: []
256
+      summary: 删除地址
257
+      tags:
258
+      - 地址[Personal]
233 259
     post:
234 260
       consumes:
235 261
       - application/json
@@ -256,6 +282,33 @@ paths:
256 282
       summary: 添加地址
257 283
       tags:
258 284
       - 地址[Personal]
285
+  /ab/peer/update/{guid}:
286
+    put:
287
+      consumes:
288
+      - application/json
289
+      description: 更新地址
290
+      parameters:
291
+      - description: id
292
+        in: path
293
+        name: id
294
+        required: true
295
+        type: string
296
+      produces:
297
+      - application/json
298
+      responses:
299
+        "200":
300
+          description: OK
301
+          schema:
302
+            type: string
303
+        "500":
304
+          description: Internal Server Error
305
+          schema:
306
+            $ref: '#/definitions/response.ErrorResponse'
307
+      security:
308
+      - BearerAuth: []
309
+      summary: 更新地址
310
+      tags:
311
+      - 地址[Personal]
259 312
   /ab/peers:
260 313
     post:
261 314
       consumes:
@@ -364,7 +417,70 @@ paths:
364 417
       summary: 共享地址簿
365 418
       tags:
366 419
       - 地址[Personal]
367
-  /ab/tags/{id}:
420
+  /ab/tag/{guid}:
421
+    delete:
422
+      consumes:
423
+      - application/json
424
+      description: 标签
425
+      produces:
426
+      - application/json
427
+      responses:
428
+        "200":
429
+          description: OK
430
+          schema:
431
+            type: string
432
+        "500":
433
+          description: Internal Server Error
434
+          schema:
435
+            $ref: '#/definitions/response.ErrorResponse'
436
+      security:
437
+      - BearerAuth: []
438
+      summary: 标签删除
439
+      tags:
440
+      - 地址[Personal]
441
+  /ab/tag/rename/{guid}:
442
+    put:
443
+      consumes:
444
+      - application/json
445
+      description: 标签
446
+      produces:
447
+      - application/json
448
+      responses:
449
+        "200":
450
+          description: OK
451
+          schema:
452
+            type: string
453
+        "500":
454
+          description: Internal Server Error
455
+          schema:
456
+            $ref: '#/definitions/response.ErrorResponse'
457
+      security:
458
+      - BearerAuth: []
459
+      summary: 标签重命名
460
+      tags:
461
+      - 地址[Personal]
462
+  /ab/tag/update/{guid}:
463
+    put:
464
+      consumes:
465
+      - application/json
466
+      description: 标签
467
+      produces:
468
+      - application/json
469
+      responses:
470
+        "200":
471
+          description: OK
472
+          schema:
473
+            type: string
474
+        "500":
475
+          description: Internal Server Error
476
+          schema:
477
+            $ref: '#/definitions/response.ErrorResponse'
478
+      security:
479
+      - BearerAuth: []
480
+      summary: 标签修改颜色
481
+      tags:
482
+      - 地址[Personal]
483
+  /ab/tags/{guid}:
368 484
     post:
369 485
       consumes:
370 486
       - application/json