ljw 1 year ago
parent
commit
62167836dc

+ 119 - 1
docs/admin/admin_docs.go

@@ -244,6 +244,51 @@ const docTemplateadmin = `{
244 244
                 }
245 245
             }
246 246
         },
247
+        "/admin/address_book/share": {
248
+            "post": {
249
+                "security": [
250
+                    {
251
+                        "token": []
252
+                    }
253
+                ],
254
+                "description": "地址簿分享",
255
+                "consumes": [
256
+                    "application/json"
257
+                ],
258
+                "produces": [
259
+                    "application/json"
260
+                ],
261
+                "tags": [
262
+                    "地址簿"
263
+                ],
264
+                "summary": "地址簿分享",
265
+                "parameters": [
266
+                    {
267
+                        "description": "地址簿信息",
268
+                        "name": "body",
269
+                        "in": "body",
270
+                        "required": true,
271
+                        "schema": {
272
+                            "$ref": "#/definitions/admin.ShareByWebClientForm"
273
+                        }
274
+                    }
275
+                ],
276
+                "responses": {
277
+                    "200": {
278
+                        "description": "OK",
279
+                        "schema": {
280
+                            "$ref": "#/definitions/response.Response"
281
+                        }
282
+                    },
283
+                    "500": {
284
+                        "description": "Internal Server Error",
285
+                        "schema": {
286
+                            "$ref": "#/definitions/response.Response"
287
+                        }
288
+                    }
289
+                }
290
+            }
291
+        },
247 292
         "/admin/address_book/update": {
248 293
             "post": {
249 294
                 "security": [
@@ -301,6 +346,40 @@ const docTemplateadmin = `{
301 346
                 }
302 347
             }
303 348
         },
349
+        "/admin/app-config": {
350
+            "get": {
351
+                "security": [
352
+                    {
353
+                        "token": []
354
+                    }
355
+                ],
356
+                "description": "APP服务配置",
357
+                "consumes": [
358
+                    "application/json"
359
+                ],
360
+                "produces": [
361
+                    "application/json"
362
+                ],
363
+                "tags": [
364
+                    "ADMIN"
365
+                ],
366
+                "summary": "APP服务配置",
367
+                "responses": {
368
+                    "200": {
369
+                        "description": "OK",
370
+                        "schema": {
371
+                            "$ref": "#/definitions/response.Response"
372
+                        }
373
+                    },
374
+                    "500": {
375
+                        "description": "Internal Server Error",
376
+                        "schema": {
377
+                            "$ref": "#/definitions/response.Response"
378
+                        }
379
+                    }
380
+                }
381
+            }
382
+        },
304 383
         "/admin/file/oss_token": {
305 384
             "get": {
306 385
                 "security": [
@@ -1371,6 +1450,18 @@ const docTemplateadmin = `{
1371 1450
                         "description": "时间",
1372 1451
                         "name": "time_ago",
1373 1452
                         "in": "query"
1453
+                    },
1454
+                    {
1455
+                        "type": "string",
1456
+                        "description": "ID",
1457
+                        "name": "id",
1458
+                        "in": "query"
1459
+                    },
1460
+                    {
1461
+                        "type": "string",
1462
+                        "description": "主机名",
1463
+                        "name": "hostname",
1464
+                        "in": "query"
1374 1465
                     }
1375 1466
                 ],
1376 1467
                 "responses": {
@@ -1475,7 +1566,7 @@ const docTemplateadmin = `{
1475 1566
                 "tags": [
1476 1567
                     "ADMIN"
1477 1568
                 ],
1478
-                "summary": "服务配置",
1569
+                "summary": "RUSTDESK服务配置",
1479 1570
                 "responses": {
1480 1571
                     "200": {
1481 1572
                         "description": "OK",
@@ -2456,6 +2547,33 @@ const docTemplateadmin = `{
2456 2547
                 }
2457 2548
             }
2458 2549
         },
2550
+        "admin.ShareByWebClientForm": {
2551
+            "type": "object",
2552
+            "required": [
2553
+                "id",
2554
+                "password",
2555
+                "password_type"
2556
+            ],
2557
+            "properties": {
2558
+                "expire": {
2559
+                    "type": "integer"
2560
+                },
2561
+                "id": {
2562
+                    "type": "string"
2563
+                },
2564
+                "password": {
2565
+                    "type": "string"
2566
+                },
2567
+                "password_type": {
2568
+                    "description": "只能是once,fixed",
2569
+                    "type": "string",
2570
+                    "enum": [
2571
+                        "once",
2572
+                        "fixed"
2573
+                    ]
2574
+                }
2575
+            }
2576
+        },
2459 2577
         "admin.TagForm": {
2460 2578
             "type": "object",
2461 2579
             "required": [

+ 119 - 1
docs/admin/admin_swagger.json

@@ -237,6 +237,51 @@
237 237
                 }
238 238
             }
239 239
         },
240
+        "/admin/address_book/share": {
241
+            "post": {
242
+                "security": [
243
+                    {
244
+                        "token": []
245
+                    }
246
+                ],
247
+                "description": "地址簿分享",
248
+                "consumes": [
249
+                    "application/json"
250
+                ],
251
+                "produces": [
252
+                    "application/json"
253
+                ],
254
+                "tags": [
255
+                    "地址簿"
256
+                ],
257
+                "summary": "地址簿分享",
258
+                "parameters": [
259
+                    {
260
+                        "description": "地址簿信息",
261
+                        "name": "body",
262
+                        "in": "body",
263
+                        "required": true,
264
+                        "schema": {
265
+                            "$ref": "#/definitions/admin.ShareByWebClientForm"
266
+                        }
267
+                    }
268
+                ],
269
+                "responses": {
270
+                    "200": {
271
+                        "description": "OK",
272
+                        "schema": {
273
+                            "$ref": "#/definitions/response.Response"
274
+                        }
275
+                    },
276
+                    "500": {
277
+                        "description": "Internal Server Error",
278
+                        "schema": {
279
+                            "$ref": "#/definitions/response.Response"
280
+                        }
281
+                    }
282
+                }
283
+            }
284
+        },
240 285
         "/admin/address_book/update": {
241 286
             "post": {
242 287
                 "security": [
@@ -294,6 +339,40 @@
294 339
                 }
295 340
             }
296 341
         },
342
+        "/admin/app-config": {
343
+            "get": {
344
+                "security": [
345
+                    {
346
+                        "token": []
347
+                    }
348
+                ],
349
+                "description": "APP服务配置",
350
+                "consumes": [
351
+                    "application/json"
352
+                ],
353
+                "produces": [
354
+                    "application/json"
355
+                ],
356
+                "tags": [
357
+                    "ADMIN"
358
+                ],
359
+                "summary": "APP服务配置",
360
+                "responses": {
361
+                    "200": {
362
+                        "description": "OK",
363
+                        "schema": {
364
+                            "$ref": "#/definitions/response.Response"
365
+                        }
366
+                    },
367
+                    "500": {
368
+                        "description": "Internal Server Error",
369
+                        "schema": {
370
+                            "$ref": "#/definitions/response.Response"
371
+                        }
372
+                    }
373
+                }
374
+            }
375
+        },
297 376
         "/admin/file/oss_token": {
298 377
             "get": {
299 378
                 "security": [
@@ -1364,6 +1443,18 @@
1364 1443
                         "description": "时间",
1365 1444
                         "name": "time_ago",
1366 1445
                         "in": "query"
1446
+                    },
1447
+                    {
1448
+                        "type": "string",
1449
+                        "description": "ID",
1450
+                        "name": "id",
1451
+                        "in": "query"
1452
+                    },
1453
+                    {
1454
+                        "type": "string",
1455
+                        "description": "主机名",
1456
+                        "name": "hostname",
1457
+                        "in": "query"
1367 1458
                     }
1368 1459
                 ],
1369 1460
                 "responses": {
@@ -1468,7 +1559,7 @@
1468 1559
                 "tags": [
1469 1560
                     "ADMIN"
1470 1561
                 ],
1471
-                "summary": "服务配置",
1562
+                "summary": "RUSTDESK服务配置",
1472 1563
                 "responses": {
1473 1564
                     "200": {
1474 1565
                         "description": "OK",
@@ -2449,6 +2540,33 @@
2449 2540
                 }
2450 2541
             }
2451 2542
         },
2543
+        "admin.ShareByWebClientForm": {
2544
+            "type": "object",
2545
+            "required": [
2546
+                "id",
2547
+                "password",
2548
+                "password_type"
2549
+            ],
2550
+            "properties": {
2551
+                "expire": {
2552
+                    "type": "integer"
2553
+                },
2554
+                "id": {
2555
+                    "type": "string"
2556
+                },
2557
+                "password": {
2558
+                    "type": "string"
2559
+                },
2560
+                "password_type": {
2561
+                    "description": "只能是once,fixed",
2562
+                    "type": "string",
2563
+                    "enum": [
2564
+                        "once",
2565
+                        "fixed"
2566
+                    ]
2567
+                }
2568
+            }
2569
+        },
2452 2570
         "admin.TagForm": {
2453 2571
             "type": "object",
2454 2572
             "required": [

+ 77 - 1
docs/admin/admin_swagger.yaml

@@ -141,6 +141,25 @@ definitions:
141 141
       version:
142 142
         type: string
143 143
     type: object
144
+  admin.ShareByWebClientForm:
145
+    properties:
146
+      expire:
147
+        type: integer
148
+      id:
149
+        type: string
150
+      password:
151
+        type: string
152
+      password_type:
153
+        description: 只能是once,fixed
154
+        enum:
155
+        - once
156
+        - fixed
157
+        type: string
158
+    required:
159
+    - id
160
+    - password
161
+    - password_type
162
+    type: object
144 163
   admin.TagForm:
145 164
     properties:
146 165
       color:
@@ -618,6 +637,34 @@ paths:
618 637
       summary: 地址簿列表
619 638
       tags:
620 639
       - 地址簿
640
+  /admin/address_book/share:
641
+    post:
642
+      consumes:
643
+      - application/json
644
+      description: 地址簿分享
645
+      parameters:
646
+      - description: 地址簿信息
647
+        in: body
648
+        name: body
649
+        required: true
650
+        schema:
651
+          $ref: '#/definitions/admin.ShareByWebClientForm'
652
+      produces:
653
+      - application/json
654
+      responses:
655
+        "200":
656
+          description: OK
657
+          schema:
658
+            $ref: '#/definitions/response.Response'
659
+        "500":
660
+          description: Internal Server Error
661
+          schema:
662
+            $ref: '#/definitions/response.Response'
663
+      security:
664
+      - token: []
665
+      summary: 地址簿分享
666
+      tags:
667
+      - 地址簿
621 668
   /admin/address_book/update:
622 669
     post:
623 670
       consumes:
@@ -651,6 +698,27 @@ paths:
651 698
       summary: 地址簿编辑
652 699
       tags:
653 700
       - 地址簿
701
+  /admin/app-config:
702
+    get:
703
+      consumes:
704
+      - application/json
705
+      description: APP服务配置
706
+      produces:
707
+      - application/json
708
+      responses:
709
+        "200":
710
+          description: OK
711
+          schema:
712
+            $ref: '#/definitions/response.Response'
713
+        "500":
714
+          description: Internal Server Error
715
+          schema:
716
+            $ref: '#/definitions/response.Response'
717
+      security:
718
+      - token: []
719
+      summary: APP服务配置
720
+      tags:
721
+      - ADMIN
654 722
   /admin/file/oss_token:
655 723
     get:
656 724
       consumes:
@@ -1283,6 +1351,14 @@ paths:
1283 1351
         in: query
1284 1352
         name: time_ago
1285 1353
         type: integer
1354
+      - description: ID
1355
+        in: query
1356
+        name: id
1357
+        type: string
1358
+      - description: 主机名
1359
+        in: query
1360
+        name: hostname
1361
+        type: string
1286 1362
       produces:
1287 1363
       - application/json
1288 1364
       responses:
@@ -1355,7 +1431,7 @@ paths:
1355 1431
             $ref: '#/definitions/response.Response'
1356 1432
       security:
1357 1433
       - token: []
1358
-      summary: 服务配置
1434
+      summary: RUSTDESK服务配置
1359 1435
       tags:
1360 1436
       - ADMIN
1361 1437
   /admin/tag/create:

+ 29 - 5
docs/api/api_docs.go

@@ -945,13 +945,37 @@ const docTemplateapi = `{
945 945
                 }
946 946
             }
947 947
         },
948
-        "/sysinfo": {
948
+        "/shared-peer": {
949 949
             "post": {
950
-                "security": [
951
-                    {
952
-                        "BearerAuth": []
953
-                    }
950
+                "description": "分享的peer",
951
+                "consumes": [
952
+                    "application/json"
953
+                ],
954
+                "produces": [
955
+                    "application/json"
956
+                ],
957
+                "tags": [
958
+                    "WEBCLIENT"
954 959
                 ],
960
+                "summary": "分享的peer",
961
+                "responses": {
962
+                    "200": {
963
+                        "description": "OK",
964
+                        "schema": {
965
+                            "$ref": "#/definitions/response.Response"
966
+                        }
967
+                    },
968
+                    "500": {
969
+                        "description": "Internal Server Error",
970
+                        "schema": {
971
+                            "$ref": "#/definitions/response.Response"
972
+                        }
973
+                    }
974
+                }
975
+            }
976
+        },
977
+        "/sysinfo": {
978
+            "post": {
955 979
                 "description": "提交系统信息",
956 980
                 "consumes": [
957 981
                     "application/json"

+ 29 - 5
docs/api/api_swagger.json

@@ -938,13 +938,37 @@
938 938
                 }
939 939
             }
940 940
         },
941
-        "/sysinfo": {
941
+        "/shared-peer": {
942 942
             "post": {
943
-                "security": [
944
-                    {
945
-                        "BearerAuth": []
946
-                    }
943
+                "description": "分享的peer",
944
+                "consumes": [
945
+                    "application/json"
946
+                ],
947
+                "produces": [
948
+                    "application/json"
949
+                ],
950
+                "tags": [
951
+                    "WEBCLIENT"
947 952
                 ],
953
+                "summary": "分享的peer",
954
+                "responses": {
955
+                    "200": {
956
+                        "description": "OK",
957
+                        "schema": {
958
+                            "$ref": "#/definitions/response.Response"
959
+                        }
960
+                    },
961
+                    "500": {
962
+                        "description": "Internal Server Error",
963
+                        "schema": {
964
+                            "$ref": "#/definitions/response.Response"
965
+                        }
966
+                    }
967
+                }
968
+            }
969
+        },
970
+        "/sysinfo": {
971
+            "post": {
948 972
                 "description": "提交系统信息",
949 973
                 "consumes": [
950 974
                     "application/json"

+ 19 - 2
docs/api/api_swagger.yaml

@@ -727,6 +727,25 @@ paths:
727 727
       summary: 服务配置
728 728
       tags:
729 729
       - WEBCLIENT
730
+  /shared-peer:
731
+    post:
732
+      consumes:
733
+      - application/json
734
+      description: 分享的peer
735
+      produces:
736
+      - application/json
737
+      responses:
738
+        "200":
739
+          description: OK
740
+          schema:
741
+            $ref: '#/definitions/response.Response'
742
+        "500":
743
+          description: Internal Server Error
744
+          schema:
745
+            $ref: '#/definitions/response.Response'
746
+      summary: 分享的peer
747
+      tags:
748
+      - WEBCLIENT
730 749
   /sysinfo:
731 750
     post:
732 751
       consumes:
@@ -750,8 +769,6 @@ paths:
750 769
           description: Internal Server Error
751 770
           schema:
752 771
             $ref: '#/definitions/response.ErrorResponse'
753
-      security:
754
-      - BearerAuth: []
755 772
       summary: 提交系统信息
756 773
       tags:
757 774
       - 地址

+ 2 - 0
http/controller/admin/peer.go

@@ -77,6 +77,8 @@ func (ct *Peer) Create(c *gin.Context) {
77 77
 // @Param page query int false "页码"
78 78
 // @Param page_size query int false "页大小"
79 79
 // @Param time_ago query int false "时间"
80
+// @Param id query string false "ID"
81
+// @Param hostname query string false "主机名"
80 82
 // @Success 200 {object} response.Response{data=model.PeerList}
81 83
 // @Failure 500 {object} response.Response
82 84
 // @Router /admin/peer/list [get]