ljw 1 год назад
Родитель
Сommit
49eaa831ed

+ 358 - 7
docs/admin/admin_docs.go

@@ -958,7 +958,214 @@ const docTemplateadmin = `{
958 958
                 }
959 959
             }
960 960
         },
961
+        "/admin/audit_conn/batchDelete": {
962
+            "post": {
963
+                "security": [
964
+                    {
965
+                        "token": []
966
+                    }
967
+                ],
968
+                "description": "链接日志批量删除",
969
+                "consumes": [
970
+                    "application/json"
971
+                ],
972
+                "produces": [
973
+                    "application/json"
974
+                ],
975
+                "tags": [
976
+                    "链接日志"
977
+                ],
978
+                "summary": "链接日志批量删除",
979
+                "parameters": [
980
+                    {
981
+                        "description": "链接日志",
982
+                        "name": "body",
983
+                        "in": "body",
984
+                        "required": true,
985
+                        "schema": {
986
+                            "$ref": "#/definitions/admin.AuditConnLogIds"
987
+                        }
988
+                    }
989
+                ],
990
+                "responses": {
991
+                    "200": {
992
+                        "description": "OK",
993
+                        "schema": {
994
+                            "$ref": "#/definitions/response.Response"
995
+                        }
996
+                    },
997
+                    "500": {
998
+                        "description": "Internal Server Error",
999
+                        "schema": {
1000
+                            "$ref": "#/definitions/response.Response"
1001
+                        }
1002
+                    }
1003
+                }
1004
+            }
1005
+        },
961 1006
         "/admin/audit_conn/delete": {
1007
+            "post": {
1008
+                "security": [
1009
+                    {
1010
+                        "token": []
1011
+                    }
1012
+                ],
1013
+                "description": "链接日志删除",
1014
+                "consumes": [
1015
+                    "application/json"
1016
+                ],
1017
+                "produces": [
1018
+                    "application/json"
1019
+                ],
1020
+                "tags": [
1021
+                    "链接日志"
1022
+                ],
1023
+                "summary": "链接日志删除",
1024
+                "parameters": [
1025
+                    {
1026
+                        "description": "链接日志信息",
1027
+                        "name": "body",
1028
+                        "in": "body",
1029
+                        "required": true,
1030
+                        "schema": {
1031
+                            "$ref": "#/definitions/model.AuditConn"
1032
+                        }
1033
+                    }
1034
+                ],
1035
+                "responses": {
1036
+                    "200": {
1037
+                        "description": "OK",
1038
+                        "schema": {
1039
+                            "$ref": "#/definitions/response.Response"
1040
+                        }
1041
+                    },
1042
+                    "500": {
1043
+                        "description": "Internal Server Error",
1044
+                        "schema": {
1045
+                            "$ref": "#/definitions/response.Response"
1046
+                        }
1047
+                    }
1048
+                }
1049
+            }
1050
+        },
1051
+        "/admin/audit_conn/list": {
1052
+            "get": {
1053
+                "security": [
1054
+                    {
1055
+                        "token": []
1056
+                    }
1057
+                ],
1058
+                "description": "链接日志列表",
1059
+                "consumes": [
1060
+                    "application/json"
1061
+                ],
1062
+                "produces": [
1063
+                    "application/json"
1064
+                ],
1065
+                "tags": [
1066
+                    "链接日志"
1067
+                ],
1068
+                "summary": "链接日志列表",
1069
+                "parameters": [
1070
+                    {
1071
+                        "type": "integer",
1072
+                        "description": "页码",
1073
+                        "name": "page",
1074
+                        "in": "query"
1075
+                    },
1076
+                    {
1077
+                        "type": "integer",
1078
+                        "description": "页大小",
1079
+                        "name": "page_size",
1080
+                        "in": "query"
1081
+                    },
1082
+                    {
1083
+                        "type": "integer",
1084
+                        "description": "目标设备",
1085
+                        "name": "peer_id",
1086
+                        "in": "query"
1087
+                    },
1088
+                    {
1089
+                        "type": "integer",
1090
+                        "description": "来源设备",
1091
+                        "name": "from_peer",
1092
+                        "in": "query"
1093
+                    }
1094
+                ],
1095
+                "responses": {
1096
+                    "200": {
1097
+                        "description": "OK",
1098
+                        "schema": {
1099
+                            "allOf": [
1100
+                                {
1101
+                                    "$ref": "#/definitions/response.Response"
1102
+                                },
1103
+                                {
1104
+                                    "type": "object",
1105
+                                    "properties": {
1106
+                                        "data": {
1107
+                                            "$ref": "#/definitions/model.AuditConnList"
1108
+                                        }
1109
+                                    }
1110
+                                }
1111
+                            ]
1112
+                        }
1113
+                    },
1114
+                    "500": {
1115
+                        "description": "Internal Server Error",
1116
+                        "schema": {
1117
+                            "$ref": "#/definitions/response.Response"
1118
+                        }
1119
+                    }
1120
+                }
1121
+            }
1122
+        },
1123
+        "/admin/audit_file/batchDelete": {
1124
+            "post": {
1125
+                "security": [
1126
+                    {
1127
+                        "token": []
1128
+                    }
1129
+                ],
1130
+                "description": "文件日志批量删除",
1131
+                "consumes": [
1132
+                    "application/json"
1133
+                ],
1134
+                "produces": [
1135
+                    "application/json"
1136
+                ],
1137
+                "tags": [
1138
+                    "文件日志"
1139
+                ],
1140
+                "summary": "文件日志批量删除",
1141
+                "parameters": [
1142
+                    {
1143
+                        "description": "文件日志",
1144
+                        "name": "body",
1145
+                        "in": "body",
1146
+                        "required": true,
1147
+                        "schema": {
1148
+                            "$ref": "#/definitions/admin.AuditFileLogIds"
1149
+                        }
1150
+                    }
1151
+                ],
1152
+                "responses": {
1153
+                    "200": {
1154
+                        "description": "OK",
1155
+                        "schema": {
1156
+                            "$ref": "#/definitions/response.Response"
1157
+                        }
1158
+                    },
1159
+                    "500": {
1160
+                        "description": "Internal Server Error",
1161
+                        "schema": {
1162
+                            "$ref": "#/definitions/response.Response"
1163
+                        }
1164
+                    }
1165
+                }
1166
+            }
1167
+        },
1168
+        "/admin/audit_file/delete": {
962 1169
             "post": {
963 1170
                 "security": [
964 1171
                     {
@@ -1003,7 +1210,7 @@ const docTemplateadmin = `{
1003 1210
                 }
1004 1211
             }
1005 1212
         },
1006
-        "/admin/audit_conn/list": {
1213
+        "/admin/audit_file/list": {
1007 1214
             "get": {
1008 1215
                 "security": [
1009 1216
                     {
@@ -1075,6 +1282,108 @@ const docTemplateadmin = `{
1075 1282
                 }
1076 1283
             }
1077 1284
         },
1285
+        "/admin/config/admin": {
1286
+            "get": {
1287
+                "security": [
1288
+                    {
1289
+                        "token": []
1290
+                    }
1291
+                ],
1292
+                "description": "ADMIN服务配置",
1293
+                "consumes": [
1294
+                    "application/json"
1295
+                ],
1296
+                "produces": [
1297
+                    "application/json"
1298
+                ],
1299
+                "tags": [
1300
+                    "ADMIN"
1301
+                ],
1302
+                "summary": "ADMIN服务配置",
1303
+                "responses": {
1304
+                    "200": {
1305
+                        "description": "OK",
1306
+                        "schema": {
1307
+                            "$ref": "#/definitions/response.Response"
1308
+                        }
1309
+                    },
1310
+                    "500": {
1311
+                        "description": "Internal Server Error",
1312
+                        "schema": {
1313
+                            "$ref": "#/definitions/response.Response"
1314
+                        }
1315
+                    }
1316
+                }
1317
+            }
1318
+        },
1319
+        "/admin/config/app": {
1320
+            "get": {
1321
+                "security": [
1322
+                    {
1323
+                        "token": []
1324
+                    }
1325
+                ],
1326
+                "description": "APP服务配置",
1327
+                "consumes": [
1328
+                    "application/json"
1329
+                ],
1330
+                "produces": [
1331
+                    "application/json"
1332
+                ],
1333
+                "tags": [
1334
+                    "ADMIN"
1335
+                ],
1336
+                "summary": "APP服务配置",
1337
+                "responses": {
1338
+                    "200": {
1339
+                        "description": "OK",
1340
+                        "schema": {
1341
+                            "$ref": "#/definitions/response.Response"
1342
+                        }
1343
+                    },
1344
+                    "500": {
1345
+                        "description": "Internal Server Error",
1346
+                        "schema": {
1347
+                            "$ref": "#/definitions/response.Response"
1348
+                        }
1349
+                    }
1350
+                }
1351
+            }
1352
+        },
1353
+        "/admin/config/server": {
1354
+            "get": {
1355
+                "security": [
1356
+                    {
1357
+                        "token": []
1358
+                    }
1359
+                ],
1360
+                "description": "服务配置,给webclient提供api-server",
1361
+                "consumes": [
1362
+                    "application/json"
1363
+                ],
1364
+                "produces": [
1365
+                    "application/json"
1366
+                ],
1367
+                "tags": [
1368
+                    "ADMIN"
1369
+                ],
1370
+                "summary": "RUSTDESK服务配置",
1371
+                "responses": {
1372
+                    "200": {
1373
+                        "description": "OK",
1374
+                        "schema": {
1375
+                            "$ref": "#/definitions/response.Response"
1376
+                        }
1377
+                    },
1378
+                    "500": {
1379
+                        "description": "Internal Server Error",
1380
+                        "schema": {
1381
+                            "$ref": "#/definitions/response.Response"
1382
+                        }
1383
+                    }
1384
+                }
1385
+            }
1386
+        },
1078 1387
         "/admin/file/oss_token": {
1079 1388
             "get": {
1080 1389
                 "security": [
@@ -1522,7 +1831,7 @@ const docTemplateadmin = `{
1522 1831
                         "token": []
1523 1832
                     }
1524 1833
                 ],
1525
-                "description": "登录日志删除",
1834
+                "description": "登录日志批量删除",
1526 1835
                 "consumes": [
1527 1836
                     "application/json"
1528 1837
                 ],
@@ -1532,15 +1841,15 @@ const docTemplateadmin = `{
1532 1841
                 "tags": [
1533 1842
                     "登录日志"
1534 1843
                 ],
1535
-                "summary": "登录日志删除",
1844
+                "summary": "登录日志批量删除",
1536 1845
                 "parameters": [
1537 1846
                     {
1538
-                        "description": "登录日志信息",
1847
+                        "description": "登录日志",
1539 1848
                         "name": "body",
1540 1849
                         "in": "body",
1541 1850
                         "required": true,
1542 1851
                         "schema": {
1543
-                            "$ref": "#/definitions/model.LoginLog"
1852
+                            "$ref": "#/definitions/admin.LoginLogIds"
1544 1853
                         }
1545 1854
                     }
1546 1855
                 ],
@@ -3074,7 +3383,7 @@ const docTemplateadmin = `{
3074 3383
                         "token": []
3075 3384
                     }
3076 3385
                 ],
3077
-                "description": "设备列表",
3386
+                "description": "我的设备列表",
3078 3387
                 "consumes": [
3079 3388
                     "application/json"
3080 3389
                 ],
@@ -3084,7 +3393,7 @@ const docTemplateadmin = `{
3084 3393
                 "tags": [
3085 3394
                     "设备"
3086 3395
                 ],
3087
-                "summary": "设备列表",
3396
+                "summary": "我的设备列表",
3088 3397
                 "parameters": [
3089 3398
                     {
3090 3399
                         "type": "integer",
@@ -3452,6 +3761,34 @@ const docTemplateadmin = `{
3452 3761
                 }
3453 3762
             }
3454 3763
         },
3764
+        "admin.AuditConnLogIds": {
3765
+            "type": "object",
3766
+            "required": [
3767
+                "ids"
3768
+            ],
3769
+            "properties": {
3770
+                "ids": {
3771
+                    "type": "array",
3772
+                    "items": {
3773
+                        "type": "integer"
3774
+                    }
3775
+                }
3776
+            }
3777
+        },
3778
+        "admin.AuditFileLogIds": {
3779
+            "type": "object",
3780
+            "required": [
3781
+                "ids"
3782
+            ],
3783
+            "properties": {
3784
+                "ids": {
3785
+                    "type": "array",
3786
+                    "items": {
3787
+                        "type": "integer"
3788
+                    }
3789
+                }
3790
+            }
3791
+        },
3455 3792
         "admin.ChangeCurPasswordForm": {
3456 3793
             "type": "object",
3457 3794
             "required": [
@@ -3488,6 +3825,20 @@ const docTemplateadmin = `{
3488 3825
                 }
3489 3826
             }
3490 3827
         },
3828
+        "admin.LoginLogIds": {
3829
+            "type": "object",
3830
+            "required": [
3831
+                "ids"
3832
+            ],
3833
+            "properties": {
3834
+                "ids": {
3835
+                    "type": "array",
3836
+                    "items": {
3837
+                        "type": "integer"
3838
+                    }
3839
+                }
3840
+            }
3841
+        },
3491 3842
         "admin.LoginPayload": {
3492 3843
             "type": "object",
3493 3844
             "properties": {

+ 358 - 7
docs/admin/admin_swagger.json

@@ -951,7 +951,214 @@
951 951
                 }
952 952
             }
953 953
         },
954
+        "/admin/audit_conn/batchDelete": {
955
+            "post": {
956
+                "security": [
957
+                    {
958
+                        "token": []
959
+                    }
960
+                ],
961
+                "description": "链接日志批量删除",
962
+                "consumes": [
963
+                    "application/json"
964
+                ],
965
+                "produces": [
966
+                    "application/json"
967
+                ],
968
+                "tags": [
969
+                    "链接日志"
970
+                ],
971
+                "summary": "链接日志批量删除",
972
+                "parameters": [
973
+                    {
974
+                        "description": "链接日志",
975
+                        "name": "body",
976
+                        "in": "body",
977
+                        "required": true,
978
+                        "schema": {
979
+                            "$ref": "#/definitions/admin.AuditConnLogIds"
980
+                        }
981
+                    }
982
+                ],
983
+                "responses": {
984
+                    "200": {
985
+                        "description": "OK",
986
+                        "schema": {
987
+                            "$ref": "#/definitions/response.Response"
988
+                        }
989
+                    },
990
+                    "500": {
991
+                        "description": "Internal Server Error",
992
+                        "schema": {
993
+                            "$ref": "#/definitions/response.Response"
994
+                        }
995
+                    }
996
+                }
997
+            }
998
+        },
954 999
         "/admin/audit_conn/delete": {
1000
+            "post": {
1001
+                "security": [
1002
+                    {
1003
+                        "token": []
1004
+                    }
1005
+                ],
1006
+                "description": "链接日志删除",
1007
+                "consumes": [
1008
+                    "application/json"
1009
+                ],
1010
+                "produces": [
1011
+                    "application/json"
1012
+                ],
1013
+                "tags": [
1014
+                    "链接日志"
1015
+                ],
1016
+                "summary": "链接日志删除",
1017
+                "parameters": [
1018
+                    {
1019
+                        "description": "链接日志信息",
1020
+                        "name": "body",
1021
+                        "in": "body",
1022
+                        "required": true,
1023
+                        "schema": {
1024
+                            "$ref": "#/definitions/model.AuditConn"
1025
+                        }
1026
+                    }
1027
+                ],
1028
+                "responses": {
1029
+                    "200": {
1030
+                        "description": "OK",
1031
+                        "schema": {
1032
+                            "$ref": "#/definitions/response.Response"
1033
+                        }
1034
+                    },
1035
+                    "500": {
1036
+                        "description": "Internal Server Error",
1037
+                        "schema": {
1038
+                            "$ref": "#/definitions/response.Response"
1039
+                        }
1040
+                    }
1041
+                }
1042
+            }
1043
+        },
1044
+        "/admin/audit_conn/list": {
1045
+            "get": {
1046
+                "security": [
1047
+                    {
1048
+                        "token": []
1049
+                    }
1050
+                ],
1051
+                "description": "链接日志列表",
1052
+                "consumes": [
1053
+                    "application/json"
1054
+                ],
1055
+                "produces": [
1056
+                    "application/json"
1057
+                ],
1058
+                "tags": [
1059
+                    "链接日志"
1060
+                ],
1061
+                "summary": "链接日志列表",
1062
+                "parameters": [
1063
+                    {
1064
+                        "type": "integer",
1065
+                        "description": "页码",
1066
+                        "name": "page",
1067
+                        "in": "query"
1068
+                    },
1069
+                    {
1070
+                        "type": "integer",
1071
+                        "description": "页大小",
1072
+                        "name": "page_size",
1073
+                        "in": "query"
1074
+                    },
1075
+                    {
1076
+                        "type": "integer",
1077
+                        "description": "目标设备",
1078
+                        "name": "peer_id",
1079
+                        "in": "query"
1080
+                    },
1081
+                    {
1082
+                        "type": "integer",
1083
+                        "description": "来源设备",
1084
+                        "name": "from_peer",
1085
+                        "in": "query"
1086
+                    }
1087
+                ],
1088
+                "responses": {
1089
+                    "200": {
1090
+                        "description": "OK",
1091
+                        "schema": {
1092
+                            "allOf": [
1093
+                                {
1094
+                                    "$ref": "#/definitions/response.Response"
1095
+                                },
1096
+                                {
1097
+                                    "type": "object",
1098
+                                    "properties": {
1099
+                                        "data": {
1100
+                                            "$ref": "#/definitions/model.AuditConnList"
1101
+                                        }
1102
+                                    }
1103
+                                }
1104
+                            ]
1105
+                        }
1106
+                    },
1107
+                    "500": {
1108
+                        "description": "Internal Server Error",
1109
+                        "schema": {
1110
+                            "$ref": "#/definitions/response.Response"
1111
+                        }
1112
+                    }
1113
+                }
1114
+            }
1115
+        },
1116
+        "/admin/audit_file/batchDelete": {
1117
+            "post": {
1118
+                "security": [
1119
+                    {
1120
+                        "token": []
1121
+                    }
1122
+                ],
1123
+                "description": "文件日志批量删除",
1124
+                "consumes": [
1125
+                    "application/json"
1126
+                ],
1127
+                "produces": [
1128
+                    "application/json"
1129
+                ],
1130
+                "tags": [
1131
+                    "文件日志"
1132
+                ],
1133
+                "summary": "文件日志批量删除",
1134
+                "parameters": [
1135
+                    {
1136
+                        "description": "文件日志",
1137
+                        "name": "body",
1138
+                        "in": "body",
1139
+                        "required": true,
1140
+                        "schema": {
1141
+                            "$ref": "#/definitions/admin.AuditFileLogIds"
1142
+                        }
1143
+                    }
1144
+                ],
1145
+                "responses": {
1146
+                    "200": {
1147
+                        "description": "OK",
1148
+                        "schema": {
1149
+                            "$ref": "#/definitions/response.Response"
1150
+                        }
1151
+                    },
1152
+                    "500": {
1153
+                        "description": "Internal Server Error",
1154
+                        "schema": {
1155
+                            "$ref": "#/definitions/response.Response"
1156
+                        }
1157
+                    }
1158
+                }
1159
+            }
1160
+        },
1161
+        "/admin/audit_file/delete": {
955 1162
             "post": {
956 1163
                 "security": [
957 1164
                     {
@@ -996,7 +1203,7 @@
996 1203
                 }
997 1204
             }
998 1205
         },
999
-        "/admin/audit_conn/list": {
1206
+        "/admin/audit_file/list": {
1000 1207
             "get": {
1001 1208
                 "security": [
1002 1209
                     {
@@ -1068,6 +1275,108 @@
1068 1275
                 }
1069 1276
             }
1070 1277
         },
1278
+        "/admin/config/admin": {
1279
+            "get": {
1280
+                "security": [
1281
+                    {
1282
+                        "token": []
1283
+                    }
1284
+                ],
1285
+                "description": "ADMIN服务配置",
1286
+                "consumes": [
1287
+                    "application/json"
1288
+                ],
1289
+                "produces": [
1290
+                    "application/json"
1291
+                ],
1292
+                "tags": [
1293
+                    "ADMIN"
1294
+                ],
1295
+                "summary": "ADMIN服务配置",
1296
+                "responses": {
1297
+                    "200": {
1298
+                        "description": "OK",
1299
+                        "schema": {
1300
+                            "$ref": "#/definitions/response.Response"
1301
+                        }
1302
+                    },
1303
+                    "500": {
1304
+                        "description": "Internal Server Error",
1305
+                        "schema": {
1306
+                            "$ref": "#/definitions/response.Response"
1307
+                        }
1308
+                    }
1309
+                }
1310
+            }
1311
+        },
1312
+        "/admin/config/app": {
1313
+            "get": {
1314
+                "security": [
1315
+                    {
1316
+                        "token": []
1317
+                    }
1318
+                ],
1319
+                "description": "APP服务配置",
1320
+                "consumes": [
1321
+                    "application/json"
1322
+                ],
1323
+                "produces": [
1324
+                    "application/json"
1325
+                ],
1326
+                "tags": [
1327
+                    "ADMIN"
1328
+                ],
1329
+                "summary": "APP服务配置",
1330
+                "responses": {
1331
+                    "200": {
1332
+                        "description": "OK",
1333
+                        "schema": {
1334
+                            "$ref": "#/definitions/response.Response"
1335
+                        }
1336
+                    },
1337
+                    "500": {
1338
+                        "description": "Internal Server Error",
1339
+                        "schema": {
1340
+                            "$ref": "#/definitions/response.Response"
1341
+                        }
1342
+                    }
1343
+                }
1344
+            }
1345
+        },
1346
+        "/admin/config/server": {
1347
+            "get": {
1348
+                "security": [
1349
+                    {
1350
+                        "token": []
1351
+                    }
1352
+                ],
1353
+                "description": "服务配置,给webclient提供api-server",
1354
+                "consumes": [
1355
+                    "application/json"
1356
+                ],
1357
+                "produces": [
1358
+                    "application/json"
1359
+                ],
1360
+                "tags": [
1361
+                    "ADMIN"
1362
+                ],
1363
+                "summary": "RUSTDESK服务配置",
1364
+                "responses": {
1365
+                    "200": {
1366
+                        "description": "OK",
1367
+                        "schema": {
1368
+                            "$ref": "#/definitions/response.Response"
1369
+                        }
1370
+                    },
1371
+                    "500": {
1372
+                        "description": "Internal Server Error",
1373
+                        "schema": {
1374
+                            "$ref": "#/definitions/response.Response"
1375
+                        }
1376
+                    }
1377
+                }
1378
+            }
1379
+        },
1071 1380
         "/admin/file/oss_token": {
1072 1381
             "get": {
1073 1382
                 "security": [
@@ -1515,7 +1824,7 @@
1515 1824
                         "token": []
1516 1825
                     }
1517 1826
                 ],
1518
-                "description": "登录日志删除",
1827
+                "description": "登录日志批量删除",
1519 1828
                 "consumes": [
1520 1829
                     "application/json"
1521 1830
                 ],
@@ -1525,15 +1834,15 @@
1525 1834
                 "tags": [
1526 1835
                     "登录日志"
1527 1836
                 ],
1528
-                "summary": "登录日志删除",
1837
+                "summary": "登录日志批量删除",
1529 1838
                 "parameters": [
1530 1839
                     {
1531
-                        "description": "登录日志信息",
1840
+                        "description": "登录日志",
1532 1841
                         "name": "body",
1533 1842
                         "in": "body",
1534 1843
                         "required": true,
1535 1844
                         "schema": {
1536
-                            "$ref": "#/definitions/model.LoginLog"
1845
+                            "$ref": "#/definitions/admin.LoginLogIds"
1537 1846
                         }
1538 1847
                     }
1539 1848
                 ],
@@ -3067,7 +3376,7 @@
3067 3376
                         "token": []
3068 3377
                     }
3069 3378
                 ],
3070
-                "description": "设备列表",
3379
+                "description": "我的设备列表",
3071 3380
                 "consumes": [
3072 3381
                     "application/json"
3073 3382
                 ],
@@ -3077,7 +3386,7 @@
3077 3386
                 "tags": [
3078 3387
                     "设备"
3079 3388
                 ],
3080
-                "summary": "设备列表",
3389
+                "summary": "我的设备列表",
3081 3390
                 "parameters": [
3082 3391
                     {
3083 3392
                         "type": "integer",
@@ -3445,6 +3754,34 @@
3445 3754
                 }
3446 3755
             }
3447 3756
         },
3757
+        "admin.AuditConnLogIds": {
3758
+            "type": "object",
3759
+            "required": [
3760
+                "ids"
3761
+            ],
3762
+            "properties": {
3763
+                "ids": {
3764
+                    "type": "array",
3765
+                    "items": {
3766
+                        "type": "integer"
3767
+                    }
3768
+                }
3769
+            }
3770
+        },
3771
+        "admin.AuditFileLogIds": {
3772
+            "type": "object",
3773
+            "required": [
3774
+                "ids"
3775
+            ],
3776
+            "properties": {
3777
+                "ids": {
3778
+                    "type": "array",
3779
+                    "items": {
3780
+                        "type": "integer"
3781
+                    }
3782
+                }
3783
+            }
3784
+        },
3448 3785
         "admin.ChangeCurPasswordForm": {
3449 3786
             "type": "object",
3450 3787
             "required": [
@@ -3481,6 +3818,20 @@
3481 3818
                 }
3482 3819
             }
3483 3820
         },
3821
+        "admin.LoginLogIds": {
3822
+            "type": "object",
3823
+            "required": [
3824
+                "ids"
3825
+            ],
3826
+            "properties": {
3827
+                "ids": {
3828
+                    "type": "array",
3829
+                    "items": {
3830
+                        "type": "integer"
3831
+                    }
3832
+                }
3833
+            }
3834
+        },
3484 3835
         "admin.LoginPayload": {
3485 3836
             "type": "object",
3486 3837
             "properties": {

+ 224 - 7
docs/admin/admin_swagger.yaml

@@ -57,6 +57,24 @@ definitions:
57 57
     required:
58 58
     - id
59 59
     type: object
60
+  admin.AuditConnLogIds:
61
+    properties:
62
+      ids:
63
+        items:
64
+          type: integer
65
+        type: array
66
+    required:
67
+    - ids
68
+    type: object
69
+  admin.AuditFileLogIds:
70
+    properties:
71
+      ids:
72
+        items:
73
+          type: integer
74
+        type: array
75
+    required:
76
+    - ids
77
+    type: object
60 78
   admin.ChangeCurPasswordForm:
61 79
     properties:
62 80
       new_password:
@@ -82,6 +100,15 @@ definitions:
82 100
     required:
83 101
     - name
84 102
     type: object
103
+  admin.LoginLogIds:
104
+    properties:
105
+      ids:
106
+        items:
107
+          type: integer
108
+        type: array
109
+    required:
110
+    - ids
111
+    type: object
85 112
   admin.LoginPayload:
86 113
     properties:
87 114
       avatar:
@@ -1281,7 +1308,134 @@ paths:
1281 1308
       summary: APP服务配置
1282 1309
       tags:
1283 1310
       - ADMIN
1311
+  /admin/audit_conn/batchDelete:
1312
+    post:
1313
+      consumes:
1314
+      - application/json
1315
+      description: 链接日志批量删除
1316
+      parameters:
1317
+      - description: 链接日志
1318
+        in: body
1319
+        name: body
1320
+        required: true
1321
+        schema:
1322
+          $ref: '#/definitions/admin.AuditConnLogIds'
1323
+      produces:
1324
+      - application/json
1325
+      responses:
1326
+        "200":
1327
+          description: OK
1328
+          schema:
1329
+            $ref: '#/definitions/response.Response'
1330
+        "500":
1331
+          description: Internal Server Error
1332
+          schema:
1333
+            $ref: '#/definitions/response.Response'
1334
+      security:
1335
+      - token: []
1336
+      summary: 链接日志批量删除
1337
+      tags:
1338
+      - 链接日志
1284 1339
   /admin/audit_conn/delete:
1340
+    post:
1341
+      consumes:
1342
+      - application/json
1343
+      description: 链接日志删除
1344
+      parameters:
1345
+      - description: 链接日志信息
1346
+        in: body
1347
+        name: body
1348
+        required: true
1349
+        schema:
1350
+          $ref: '#/definitions/model.AuditConn'
1351
+      produces:
1352
+      - application/json
1353
+      responses:
1354
+        "200":
1355
+          description: OK
1356
+          schema:
1357
+            $ref: '#/definitions/response.Response'
1358
+        "500":
1359
+          description: Internal Server Error
1360
+          schema:
1361
+            $ref: '#/definitions/response.Response'
1362
+      security:
1363
+      - token: []
1364
+      summary: 链接日志删除
1365
+      tags:
1366
+      - 链接日志
1367
+  /admin/audit_conn/list:
1368
+    get:
1369
+      consumes:
1370
+      - application/json
1371
+      description: 链接日志列表
1372
+      parameters:
1373
+      - description: 页码
1374
+        in: query
1375
+        name: page
1376
+        type: integer
1377
+      - description: 页大小
1378
+        in: query
1379
+        name: page_size
1380
+        type: integer
1381
+      - description: 目标设备
1382
+        in: query
1383
+        name: peer_id
1384
+        type: integer
1385
+      - description: 来源设备
1386
+        in: query
1387
+        name: from_peer
1388
+        type: integer
1389
+      produces:
1390
+      - application/json
1391
+      responses:
1392
+        "200":
1393
+          description: OK
1394
+          schema:
1395
+            allOf:
1396
+            - $ref: '#/definitions/response.Response'
1397
+            - properties:
1398
+                data:
1399
+                  $ref: '#/definitions/model.AuditConnList'
1400
+              type: object
1401
+        "500":
1402
+          description: Internal Server Error
1403
+          schema:
1404
+            $ref: '#/definitions/response.Response'
1405
+      security:
1406
+      - token: []
1407
+      summary: 链接日志列表
1408
+      tags:
1409
+      - 链接日志
1410
+  /admin/audit_file/batchDelete:
1411
+    post:
1412
+      consumes:
1413
+      - application/json
1414
+      description: 文件日志批量删除
1415
+      parameters:
1416
+      - description: 文件日志
1417
+        in: body
1418
+        name: body
1419
+        required: true
1420
+        schema:
1421
+          $ref: '#/definitions/admin.AuditFileLogIds'
1422
+      produces:
1423
+      - application/json
1424
+      responses:
1425
+        "200":
1426
+          description: OK
1427
+          schema:
1428
+            $ref: '#/definitions/response.Response'
1429
+        "500":
1430
+          description: Internal Server Error
1431
+          schema:
1432
+            $ref: '#/definitions/response.Response'
1433
+      security:
1434
+      - token: []
1435
+      summary: 文件日志批量删除
1436
+      tags:
1437
+      - 文件日志
1438
+  /admin/audit_file/delete:
1285 1439
     post:
1286 1440
       consumes:
1287 1441
       - application/json
@@ -1309,7 +1463,7 @@ paths:
1309 1463
       summary: 文件日志删除
1310 1464
       tags:
1311 1465
       - 文件日志
1312
-  /admin/audit_conn/list:
1466
+  /admin/audit_file/list:
1313 1467
     get:
1314 1468
       consumes:
1315 1469
       - application/json
@@ -1352,6 +1506,69 @@ paths:
1352 1506
       summary: 文件日志列表
1353 1507
       tags:
1354 1508
       - 文件日志
1509
+  /admin/config/admin:
1510
+    get:
1511
+      consumes:
1512
+      - application/json
1513
+      description: ADMIN服务配置
1514
+      produces:
1515
+      - application/json
1516
+      responses:
1517
+        "200":
1518
+          description: OK
1519
+          schema:
1520
+            $ref: '#/definitions/response.Response'
1521
+        "500":
1522
+          description: Internal Server Error
1523
+          schema:
1524
+            $ref: '#/definitions/response.Response'
1525
+      security:
1526
+      - token: []
1527
+      summary: ADMIN服务配置
1528
+      tags:
1529
+      - ADMIN
1530
+  /admin/config/app:
1531
+    get:
1532
+      consumes:
1533
+      - application/json
1534
+      description: APP服务配置
1535
+      produces:
1536
+      - application/json
1537
+      responses:
1538
+        "200":
1539
+          description: OK
1540
+          schema:
1541
+            $ref: '#/definitions/response.Response'
1542
+        "500":
1543
+          description: Internal Server Error
1544
+          schema:
1545
+            $ref: '#/definitions/response.Response'
1546
+      security:
1547
+      - token: []
1548
+      summary: APP服务配置
1549
+      tags:
1550
+      - ADMIN
1551
+  /admin/config/server:
1552
+    get:
1553
+      consumes:
1554
+      - application/json
1555
+      description: 服务配置,给webclient提供api-server
1556
+      produces:
1557
+      - application/json
1558
+      responses:
1559
+        "200":
1560
+          description: OK
1561
+          schema:
1562
+            $ref: '#/definitions/response.Response'
1563
+        "500":
1564
+          description: Internal Server Error
1565
+          schema:
1566
+            $ref: '#/definitions/response.Response'
1567
+      security:
1568
+      - token: []
1569
+      summary: RUSTDESK服务配置
1570
+      tags:
1571
+      - ADMIN
1355 1572
   /admin/file/oss_token:
1356 1573
     get:
1357 1574
       consumes:
@@ -1619,14 +1836,14 @@ paths:
1619 1836
     post:
1620 1837
       consumes:
1621 1838
       - application/json
1622
-      description: 登录日志删除
1839
+      description: 登录日志批量删除
1623 1840
       parameters:
1624
-      - description: 登录日志信息
1841
+      - description: 登录日志
1625 1842
         in: body
1626 1843
         name: body
1627 1844
         required: true
1628 1845
         schema:
1629
-          $ref: '#/definitions/model.LoginLog'
1846
+          $ref: '#/definitions/admin.LoginLogIds'
1630 1847
       produces:
1631 1848
       - application/json
1632 1849
       responses:
@@ -1640,7 +1857,7 @@ paths:
1640 1857
             $ref: '#/definitions/response.Response'
1641 1858
       security:
1642 1859
       - token: []
1643
-      summary: 登录日志删除
1860
+      summary: 登录日志批量删除
1644 1861
       tags:
1645 1862
       - 登录日志
1646 1863
   /admin/login_log/detail/{id}:
@@ -2542,7 +2759,7 @@ paths:
2542 2759
     get:
2543 2760
       consumes:
2544 2761
       - application/json
2545
-      description: 设备列表
2762
+      description: 我的设备列表
2546 2763
       parameters:
2547 2764
       - description: 页码
2548 2765
         in: query
@@ -2586,7 +2803,7 @@ paths:
2586 2803
             $ref: '#/definitions/response.Response'
2587 2804
       security:
2588 2805
       - token: []
2589
-      summary: 设备列表
2806
+      summary: 我的设备列表
2590 2807
       tags:
2591 2808
       - 设备
2592 2809
   /admin/user/update:

+ 64 - 2
http/controller/admin/audit.go

@@ -81,6 +81,37 @@ func (a *Audit) ConnDelete(c *gin.Context) {
81 81
 	response.Fail(c, 101, response.TranslateMsg(c, "ItemNotFound"))
82 82
 }
83 83
 
84
+// BatchConnDelete 删除
85
+// @Tags 链接日志
86
+// @Summary 链接日志批量删除
87
+// @Description 链接日志批量删除
88
+// @Accept  json
89
+// @Produce  json
90
+// @Param body body admin.AuditConnLogIds true "链接日志"
91
+// @Success 200 {object} response.Response
92
+// @Failure 500 {object} response.Response
93
+// @Router /admin/audit_conn/batchDelete [post]
94
+// @Security token
95
+func (a *Audit) BatchConnDelete(c *gin.Context) {
96
+	f := &admin.AuditConnLogIds{}
97
+	if err := c.ShouldBindJSON(f); err != nil {
98
+		response.Fail(c, 101, response.TranslateMsg(c, "ParamsError")+err.Error())
99
+		return
100
+	}
101
+	if len(f.Ids) == 0 {
102
+		response.Fail(c, 101, response.TranslateMsg(c, "ParamsError"))
103
+		return
104
+	}
105
+
106
+	err := service.AllService.AuditService.BatchDeleteAuditConn(f.Ids)
107
+	if err == nil {
108
+		response.Success(c, nil)
109
+		return
110
+	}
111
+	response.Fail(c, 101, err.Error())
112
+	return
113
+}
114
+
84 115
 // FileList 列表
85 116
 // @Tags 文件日志
86 117
 // @Summary 文件日志列表
@@ -93,7 +124,7 @@ func (a *Audit) ConnDelete(c *gin.Context) {
93 124
 // @Param from_peer query int false "来源设备"
94 125
 // @Success 200 {object} response.Response{data=model.AuditFileList}
95 126
 // @Failure 500 {object} response.Response
96
-// @Router /admin/audit_conn/list [get]
127
+// @Router /admin/audit_file/list [get]
97 128
 // @Security token
98 129
 func (a *Audit) FileList(c *gin.Context) {
99 130
 	query := &admin.AuditQuery{}
@@ -122,7 +153,7 @@ func (a *Audit) FileList(c *gin.Context) {
122 153
 // @Param body body model.AuditFile true "文件日志信息"
123 154
 // @Success 200 {object} response.Response
124 155
 // @Failure 500 {object} response.Response
125
-// @Router /admin/audit_conn/delete [post]
156
+// @Router /admin/audit_file/delete [post]
126 157
 // @Security token
127 158
 func (a *Audit) FileDelete(c *gin.Context) {
128 159
 	f := &model.AuditFile{}
@@ -148,3 +179,34 @@ func (a *Audit) FileDelete(c *gin.Context) {
148 179
 	}
149 180
 	response.Fail(c, 101, response.TranslateMsg(c, "ItemNotFound"))
150 181
 }
182
+
183
+// BatchFileDelete 删除
184
+// @Tags 文件日志
185
+// @Summary 文件日志批量删除
186
+// @Description 文件日志批量删除
187
+// @Accept  json
188
+// @Produce  json
189
+// @Param body body admin.AuditFileLogIds true "文件日志"
190
+// @Success 200 {object} response.Response
191
+// @Failure 500 {object} response.Response
192
+// @Router /admin/audit_file/batchDelete [post]
193
+// @Security token
194
+func (a *Audit) BatchFileDelete(c *gin.Context) {
195
+	f := &admin.AuditFileLogIds{}
196
+	if err := c.ShouldBindJSON(f); err != nil {
197
+		response.Fail(c, 101, response.TranslateMsg(c, "ParamsError")+err.Error())
198
+		return
199
+	}
200
+	if len(f.Ids) == 0 {
201
+		response.Fail(c, 101, response.TranslateMsg(c, "ParamsError"))
202
+		return
203
+	}
204
+
205
+	err := service.AllService.AuditService.BatchDeleteAuditFile(f.Ids)
206
+	if err == nil {
207
+		response.Success(c, nil)
208
+		return
209
+	}
210
+	response.Fail(c, 101, err.Error())
211
+	return
212
+}

+ 31 - 0
http/controller/admin/loginLog.go

@@ -109,3 +109,34 @@ func (ct *LoginLog) Delete(c *gin.Context) {
109 109
 	}
110 110
 	response.Fail(c, 101, response.TranslateMsg(c, "ItemNotFound"))
111 111
 }
112
+
113
+// BatchDelete 删除
114
+// @Tags 登录日志
115
+// @Summary 登录日志批量删除
116
+// @Description 登录日志批量删除
117
+// @Accept  json
118
+// @Produce  json
119
+// @Param body body admin.LoginLogIds true "登录日志"
120
+// @Success 200 {object} response.Response
121
+// @Failure 500 {object} response.Response
122
+// @Router /admin/login_log/delete [post]
123
+// @Security token
124
+func (ct *LoginLog) BatchDelete(c *gin.Context) {
125
+	f := &admin.LoginLogIds{}
126
+	if err := c.ShouldBindJSON(f); err != nil {
127
+		response.Fail(c, 101, response.TranslateMsg(c, "ParamsError")+err.Error())
128
+		return
129
+	}
130
+	if len(f.Ids) == 0 {
131
+		response.Fail(c, 101, response.TranslateMsg(c, "ParamsError"))
132
+		return
133
+	}
134
+
135
+	err := service.AllService.LoginLogService.BatchDelete(f.Ids)
136
+	if err == nil {
137
+		response.Success(c, nil)
138
+		return
139
+	}
140
+	response.Fail(c, 101, err.Error())
141
+	return
142
+}

+ 3 - 3
http/controller/admin/user.go

@@ -295,10 +295,10 @@ func (ct *User) MyOauth(c *gin.Context) {
295 295
 	response.Success(c, res)
296 296
 }
297 297
 
298
-// List 列表
298
+// MyPeer 列表
299 299
 // @Tags 设备
300
-// @Summary 设备列表
301
-// @Description 设备列表
300
+// @Summary 我的设备列表
301
+// @Description 我的设备列表
302 302
 // @Accept  json
303 303
 // @Produce  json
304 304
 // @Param page query int false "页码"

+ 7 - 0
http/request/admin/audit.go

@@ -5,3 +5,10 @@ type AuditQuery struct {
5 5
 	FromPeer string `form:"from_peer"`
6 6
 	PageQuery
7 7
 }
8
+
9
+type AuditConnLogIds struct {
10
+	Ids []uint `json:"ids" validate:"required"`
11
+}
12
+type AuditFileLogIds struct {
13
+	Ids []uint `json:"ids" validate:"required"`
14
+}

+ 4 - 0
http/request/admin/login.go

@@ -15,3 +15,7 @@ type LoginTokenQuery struct {
15 15
 	UserId int `form:"user_id"`
16 16
 	PageQuery
17 17
 }
18
+
19
+type LoginLogIds struct {
20
+	Ids []uint `json:"ids" validate:"required"`
21
+}

+ 3 - 0
http/router/admin.go

@@ -154,15 +154,18 @@ func LoginLogBind(rg *gin.RouterGroup) {
154 154
 	cont := &admin.LoginLog{}
155 155
 	aR.GET("/list", cont.List)
156 156
 	aR.POST("/delete", cont.Delete)
157
+	aR.POST("/batchDelete", cont.BatchDelete)
157 158
 }
158 159
 func AuditBind(rg *gin.RouterGroup) {
159 160
 	cont := &admin.Audit{}
160 161
 	aR := rg.Group("/audit_conn").Use(middleware.AdminPrivilege())
161 162
 	aR.GET("/list", cont.ConnList)
162 163
 	aR.POST("/delete", cont.ConnDelete)
164
+	aR.POST("/batchDelete", cont.BatchConnDelete)
163 165
 	afR := rg.Group("/audit_file").Use(middleware.AdminPrivilege())
164 166
 	afR.GET("/list", cont.FileList)
165 167
 	afR.POST("/delete", cont.FileDelete)
168
+	afR.POST("/batchDelete", cont.BatchFileDelete)
166 169
 }
167 170
 func AddressBookCollectionBind(rg *gin.RouterGroup) {
168 171
 	aR := rg.Group("/address_book_collection")

+ 8 - 0
service/audit.go

@@ -85,3 +85,11 @@ func (as *AuditService) DeleteAuditFile(u *model.AuditFile) error {
85 85
 func (as *AuditService) UpdateAuditFile(u *model.AuditFile) error {
86 86
 	return global.DB.Model(u).Updates(u).Error
87 87
 }
88
+
89
+func (as *AuditService) BatchDeleteAuditConn(ids []uint) error {
90
+	return global.DB.Where("id in (?)", ids).Delete(&model.AuditConn{}).Error
91
+}
92
+
93
+func (as *AuditService) BatchDeleteAuditFile(ids []uint) error {
94
+	return global.DB.Where("id in (?)", ids).Delete(&model.AuditFile{}).Error
95
+}

+ 4 - 0
service/loginLog.go

@@ -43,3 +43,7 @@ func (us *LoginLogService) Delete(u *model.LoginLog) error {
43 43
 func (us *LoginLogService) Update(u *model.LoginLog) error {
44 44
 	return global.DB.Model(u).Updates(u).Error
45 45
 }
46
+
47
+func (us *LoginLogService) BatchDelete(ids []uint) error {
48
+	return global.DB.Where("id in (?)", ids).Delete(&model.LoginLog{}).Error
49
+}