midway-fatcms 0.0.1-beta.4 → 0.0.1-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +14 -0
- package/.prettierrc.js +4 -0
- package/README.md +7 -0
- package/dist/config/config.default.js +58 -15
- package/dist/config/seed/aeskey.txt +1 -1
- package/dist/configuration.d.ts +1 -0
- package/dist/configuration.js +33 -9
- package/dist/controller/base/BaseApiController.d.ts +7 -1
- package/dist/controller/base/BaseApiController.js +32 -6
- package/dist/controller/gateway/AsyncTaskController.d.ts +20 -0
- package/dist/controller/gateway/AsyncTaskController.js +181 -0
- package/dist/controller/gateway/CrudMtdGatewayController.d.ts +3 -3
- package/dist/controller/gateway/CrudMtdGatewayController.js +9 -6
- package/dist/controller/gateway/DocGatewayController.js +14 -9
- package/dist/controller/gateway/FileController.d.ts +3 -2
- package/dist/controller/gateway/PublicApiController.js +4 -6
- package/dist/controller/gateway/StaticController.d.ts +0 -1
- package/dist/controller/gateway/StaticController.js +40 -39
- package/dist/controller/helpers.controller.d.ts +1 -1
- package/dist/controller/home.controller.js +4 -3
- package/dist/controller/manage/AnyApiMangeApi.js +2 -2
- package/dist/controller/manage/AppLogMangeApi.js +2 -2
- package/dist/controller/manage/AppMangeApi.js +2 -2
- package/dist/controller/manage/AppPageMangeApi.js +2 -2
- package/dist/controller/manage/AppSchemaHistoryApi.js +2 -2
- package/dist/controller/manage/CrudMethodsMangeApi.js +2 -2
- package/dist/controller/manage/CrudStandardDesignApi.d.ts +1 -1
- package/dist/controller/manage/CrudStandardDesignApi.js +86 -83
- package/dist/controller/manage/DataDictManageApi.d.ts +1 -1
- package/dist/controller/manage/DataDictManageApi.js +1 -1
- package/dist/controller/manage/DeployManageApi.d.ts +1 -1
- package/dist/controller/manage/DeployManageApi.js +38 -34
- package/dist/controller/manage/DocLibManageApi.js +2 -2
- package/dist/controller/manage/DocManageApi.js +2 -2
- package/dist/controller/manage/FileManageApi.js +1 -1
- package/dist/controller/manage/LowCodeTplManageApi.js +2 -2
- package/dist/controller/manage/MenuManageApi.js +2 -2
- package/dist/controller/manage/ProxyApiMangeApi.js +2 -2
- package/dist/controller/manage/SuperAdminManageApi.d.ts +2 -2
- package/dist/controller/manage/SuperAdminManageApi.js +12 -8
- package/dist/controller/manage/SysConfigMangeApi.d.ts +1 -1
- package/dist/controller/manage/SysConfigMangeApi.js +8 -6
- package/dist/controller/manage/SystemInfoManageApi.d.ts +1 -1
- package/dist/controller/manage/SystemInfoManageApi.js +7 -1
- package/dist/controller/manage/UserAccountManageApi.d.ts +2 -2
- package/dist/controller/manage/UserAccountManageApi.js +7 -2
- package/dist/controller/manage/WorkbenchMangeApi.js +3 -3
- package/dist/controller/myinfo/AuthController.d.ts +0 -4
- package/dist/controller/myinfo/AuthController.js +1 -54
- package/dist/controller/render/AppRenderController.js +12 -5
- package/dist/controller/test.controller.d.ts +1 -1
- package/dist/controller/test.controller.js +5 -5
- package/dist/index.d.ts +35 -4
- package/dist/index.js +35 -4
- package/dist/libs/crud-pro/CrudPro.d.ts +1 -0
- package/dist/libs/crud-pro/CrudPro.js +5 -0
- package/dist/libs/crud-pro/defaultConfigs.js +2 -0
- package/dist/libs/crud-pro/interfaces.d.ts +7 -1
- package/dist/libs/crud-pro/models/ExecuteContext.d.ts +12 -5
- package/dist/libs/crud-pro/models/ExecuteContextFunc.d.ts +8 -1
- package/dist/libs/crud-pro/models/ExecuteContextFunc.js +8 -0
- package/dist/libs/crud-pro/models/RequestCfgModel.d.ts +1 -1
- package/dist/libs/crud-pro/models/ResModel.d.ts +16 -0
- package/dist/libs/crud-pro/models/ResModel.js +2 -0
- package/dist/libs/crud-pro/models/SqlCfgModel.d.ts +1 -1
- package/dist/libs/crud-pro/models/TransactionSqlServer.js +1 -1
- package/dist/libs/crud-pro/services/CrudProCachedCfgService.d.ts +1 -0
- package/dist/libs/crud-pro/services/CrudProCachedCfgService.js +27 -15
- package/dist/libs/crud-pro/services/CrudProExecuteSqlService.js +17 -19
- package/dist/libs/crud-pro/services/CrudProGenSqlCondition.d.ts +1 -1
- package/dist/libs/crud-pro/services/CrudProGenSqlCondition.js +10 -12
- package/dist/libs/crud-pro/services/CrudProGenSqlService.js +14 -23
- package/dist/libs/crud-pro/services/CrudProOriginToExecuteSql.js +7 -6
- package/dist/libs/crud-pro/services/CrudProServiceBase.d.ts +2 -6
- package/dist/libs/crud-pro/services/CrudProServiceBase.js +15 -3
- package/dist/libs/crud-pro/services/CrudProTableMetaService.d.ts +1 -0
- package/dist/libs/crud-pro/services/CrudProTableMetaService.js +32 -7
- package/dist/libs/crud-pro/sql.txt +120 -120
- package/dist/libs/crud-pro/utils/DatabaseName.js +24 -3
- package/dist/libs/crud-pro/utils/MixinUtils.js +1 -1
- package/dist/libs/crud-pro/utils/ValidateUtils.js +1 -1
- package/dist/libs/crud-pro/utils/sqlConvert/convertColumnName.js +2 -2
- package/dist/libs/crud-pro/utils/sqlConvert/convertMix.d.ts +3 -0
- package/dist/libs/crud-pro/utils/sqlConvert/convertMix.js +22 -0
- package/dist/libs/global-config/global-config.d.ts +45 -0
- package/dist/libs/global-config/global-config.js +33 -0
- package/dist/libs/utils/errorToString.d.ts +2 -0
- package/dist/libs/utils/errorToString.js +57 -0
- package/dist/libs/utils/fatcms-request.js +2 -2
- package/dist/libs/utils/functions.d.ts +2 -1
- package/dist/libs/utils/functions.js +6 -1
- package/dist/middleware/forbidden.middleware.js +4 -20
- package/dist/middleware/global.middleware.js +30 -10
- package/dist/middleware/permission.middleware.js +1 -1
- package/dist/models/AsyncTaskModel.d.ts +74 -0
- package/dist/models/AsyncTaskModel.js +31 -0
- package/dist/models/RedisKeys.d.ts +14 -0
- package/dist/models/RedisKeys.js +17 -0
- package/dist/models/SystemEntities.d.ts +8 -1
- package/dist/models/SystemEntities.js +7 -0
- package/dist/models/SystemTables.d.ts +1 -3
- package/dist/models/SystemTables.js +2 -4
- package/dist/models/bizmodels.d.ts +28 -0
- package/dist/models/bizmodels.js +6 -1
- package/dist/schedule/anonymousContext.d.ts +14 -0
- package/dist/schedule/anonymousContext.js +59 -0
- package/dist/schedule/index.d.ts +4 -3
- package/dist/schedule/index.js +8 -67
- package/dist/schedule/runSchedule.d.ts +12 -0
- package/dist/schedule/runSchedule.js +68 -0
- package/dist/schedule/scheduleNames.d.ts +13 -0
- package/dist/schedule/scheduleNames.js +17 -0
- package/dist/service/AuthService.js +8 -5
- package/dist/service/EnumInfoService.js +9 -5
- package/dist/service/FileCenterService.js +13 -9
- package/dist/service/SysConfigService.d.ts +1 -1
- package/dist/service/SysConfigService.js +4 -2
- package/dist/service/UserAccountService.js +10 -6
- package/dist/service/UserSessionService.d.ts +21 -0
- package/dist/service/UserSessionService.js +73 -2
- package/dist/service/VisitStatService.d.ts +1 -1
- package/dist/service/VisitStatService.js +20 -27
- package/dist/service/WorkbenchService.d.ts +33 -0
- package/dist/service/WorkbenchService.js +70 -12
- package/dist/service/anyapi/AnyApiSandboxService.js +12 -12
- package/dist/service/anyapi/AnyApiService.js +4 -2
- package/dist/service/asyncTask/AsyncTaskRunnerService.d.ts +50 -0
- package/dist/service/asyncTask/AsyncTaskRunnerService.js +287 -0
- package/dist/service/asyncTask/AsyncTaskService.d.ts +7 -0
- package/dist/service/asyncTask/AsyncTaskService.js +34 -0
- package/dist/service/asyncTask/handler/ExcelInfoModel.d.ts +10 -0
- package/dist/service/asyncTask/handler/ExcelInfoModel.js +2 -0
- package/dist/service/asyncTask/handler/ExportExcelAsyncTaskHandler.d.ts +7 -0
- package/dist/service/asyncTask/handler/ExportExcelAsyncTaskHandler.js +216 -0
- package/dist/service/asyncTask/handler/ExportExcelByInnerHttpHandler.d.ts +36 -0
- package/dist/service/asyncTask/handler/ExportExcelByInnerHttpHandler.js +139 -0
- package/dist/service/asyncTask/handler/ExportExcelByStdCrudHandler.d.ts +46 -0
- package/dist/service/asyncTask/handler/ExportExcelByStdCrudHandler.js +121 -0
- package/dist/service/base/BaseService.d.ts +12 -0
- package/dist/service/base/BaseService.js +22 -0
- package/dist/service/base/RedisCacheService.d.ts +7 -0
- package/dist/service/base/RedisCacheService.js +7 -0
- package/dist/service/crudstd/CrudStdService.d.ts +8 -1
- package/dist/service/crudstd/CrudStdService.js +63 -6
- package/dist/service/curd/CrudProQuick.d.ts +44 -0
- package/dist/service/curd/CrudProQuick.js +147 -0
- package/dist/service/curd/CurdMixByAccountService.d.ts +4 -4
- package/dist/service/curd/CurdMixByAccountService.js +12 -6
- package/dist/service/curd/CurdMixByDictService.d.ts +4 -4
- package/dist/service/curd/CurdMixByDictService.js +10 -7
- package/dist/service/curd/CurdMixByLinkToCustomService.d.ts +13 -4
- package/dist/service/curd/CurdMixByLinkToCustomService.js +73 -24
- package/dist/service/curd/CurdMixBySysConfigService.d.ts +3 -3
- package/dist/service/curd/CurdMixBySysConfigService.js +4 -2
- package/dist/service/curd/CurdMixByWorkbenchService.d.ts +3 -3
- package/dist/service/curd/CurdMixByWorkbenchService.js +4 -2
- package/dist/service/curd/CurdMixService.d.ts +13 -3
- package/dist/service/curd/CurdMixService.js +26 -2
- package/dist/service/curd/CurdMixUtils.d.ts +27 -4
- package/dist/service/curd/CurdMixUtils.js +115 -41
- package/dist/service/curd/CurdProService.d.ts +3 -10
- package/dist/service/curd/CurdProService.js +36 -148
- package/dist/service/curd/fixCfgModel.d.ts +3 -0
- package/dist/service/curd/fixCfgModel.js +107 -0
- package/dist/service/proxyapi/ProxyApiLoadService.js +7 -4
- package/dist/service/proxyapi/ProxyApiService.js +28 -7
- package/dist/views/404_app.html +31 -31
- package/dist/views/404_workbench.html +34 -34
- package/package.json +25 -24
- package/tsconfig.json +32 -0
- package/dist/controller/medstatistic/MedAdminController.d.ts +0 -35
- package/dist/controller/medstatistic/MedAdminController.js +0 -205
- package/dist/controller/medstatistic/MedClientController.d.ts +0 -28
- package/dist/controller/medstatistic/MedClientController.js +0 -188
- package/dist/controller/medstatistic/MedMessageService.d.ts +0 -19
- package/dist/controller/medstatistic/MedMessageService.js +0 -95
- package/dist/controller/medstatistic/MedScoreService.d.ts +0 -21
- package/dist/controller/medstatistic/MedScoreService.js +0 -107
- package/dist/controller/medstatistic/constants.d.ts +0 -32
- package/dist/controller/medstatistic/constants.js +0 -43
- package/src/config/config.default.ts +0 -172
- package/src/config/seed/aeskey.txt +0 -1
- package/src/config/utils.ts +0 -23
- package/src/configuration.ts +0 -83
- package/src/controller/base/BaseApiController.ts +0 -145
- package/src/controller/gateway/AnyApiGatewayController.ts +0 -33
- package/src/controller/gateway/CrudMtdGatewayController.ts +0 -107
- package/src/controller/gateway/CrudStdGatewayController.ts +0 -101
- package/src/controller/gateway/DocGatewayController.ts +0 -165
- package/src/controller/gateway/FileController.ts +0 -110
- package/src/controller/gateway/ProxyApiGatewayController.ts +0 -47
- package/src/controller/gateway/PublicApiController.ts +0 -145
- package/src/controller/gateway/StaticController.ts +0 -328
- package/src/controller/helpers.controller.ts +0 -161
- package/src/controller/home.controller.ts +0 -71
- package/src/controller/manage/AnyApiMangeApi.ts +0 -66
- package/src/controller/manage/AppLogMangeApi.ts +0 -53
- package/src/controller/manage/AppMangeApi.ts +0 -53
- package/src/controller/manage/AppPageMangeApi.ts +0 -52
- package/src/controller/manage/AppSchemaHistoryApi.ts +0 -49
- package/src/controller/manage/CrudMethodsMangeApi.ts +0 -49
- package/src/controller/manage/CrudStandardDesignApi.ts +0 -353
- package/src/controller/manage/DataDictManageApi.ts +0 -78
- package/src/controller/manage/DeployManageApi.ts +0 -179
- package/src/controller/manage/DocLibManageApi.ts +0 -69
- package/src/controller/manage/DocManageApi.ts +0 -99
- package/src/controller/manage/FileManageApi.ts +0 -45
- package/src/controller/manage/LowCodeTplManageApi.ts +0 -52
- package/src/controller/manage/MenuManageApi.ts +0 -63
- package/src/controller/manage/ProxyApiMangeApi.ts +0 -52
- package/src/controller/manage/SuperAdminManageApi.ts +0 -138
- package/src/controller/manage/SysConfigMangeApi.ts +0 -95
- package/src/controller/manage/SystemInfoManageApi.ts +0 -48
- package/src/controller/manage/UserAccountManageApi.ts +0 -88
- package/src/controller/manage/WorkbenchMangeApi.ts +0 -72
- package/src/controller/medstatistic/MedAdminController.ts +0 -221
- package/src/controller/medstatistic/MedClientController.ts +0 -188
- package/src/controller/medstatistic/MedMessageService.ts +0 -89
- package/src/controller/medstatistic/MedScoreService.ts +0 -108
- package/src/controller/medstatistic/constants.ts +0 -63
- package/src/controller/myinfo/AuthController.ts +0 -174
- package/src/controller/myinfo/MyInfoController.ts +0 -32
- package/src/controller/render/AppRenderController.ts +0 -76
- package/src/controller/test.controller.ts +0 -37
- package/src/filter/default.filter.ts +0 -13
- package/src/filter/notfound.filter.ts +0 -10
- package/src/index.ts +0 -71
- package/src/interface.ts +0 -31
- package/src/libs/crud-pro/CrudPro.ts +0 -158
- package/src/libs/crud-pro/defaultConfigs.ts +0 -13
- package/src/libs/crud-pro/exceptions.ts +0 -124
- package/src/libs/crud-pro/interfaces.ts +0 -183
- package/src/libs/crud-pro/models/ExecuteContext.ts +0 -111
- package/src/libs/crud-pro/models/ExecuteContextFunc.ts +0 -86
- package/src/libs/crud-pro/models/FuncContext.ts +0 -21
- package/src/libs/crud-pro/models/RequestCfgModel.ts +0 -141
- package/src/libs/crud-pro/models/RequestModel.ts +0 -141
- package/src/libs/crud-pro/models/ServiceHub.ts +0 -32
- package/src/libs/crud-pro/models/SqlCfgModel.ts +0 -52
- package/src/libs/crud-pro/models/SqlSegArg.ts +0 -13
- package/src/libs/crud-pro/models/Transaction.ts +0 -74
- package/src/libs/crud-pro/models/TransactionMySQL.ts +0 -79
- package/src/libs/crud-pro/models/TransactionPostgres.ts +0 -91
- package/src/libs/crud-pro/models/TransactionSqlServer.ts +0 -107
- package/src/libs/crud-pro/models/keys.ts +0 -159
- package/src/libs/crud-pro/services/CrudProCachedCfgService.ts +0 -75
- package/src/libs/crud-pro/services/CrudProExecuteFuncService.ts +0 -128
- package/src/libs/crud-pro/services/CrudProExecuteSqlService.ts +0 -279
- package/src/libs/crud-pro/services/CrudProFieldUpdateService.ts +0 -60
- package/src/libs/crud-pro/services/CrudProFieldValidateService.ts +0 -180
- package/src/libs/crud-pro/services/CrudProGenSqlCondition.ts +0 -373
- package/src/libs/crud-pro/services/CrudProGenSqlService.ts +0 -202
- package/src/libs/crud-pro/services/CrudProOriginToExecuteSql.ts +0 -397
- package/src/libs/crud-pro/services/CrudProServiceBase.ts +0 -98
- package/src/libs/crud-pro/services/CrudProTableMetaService.ts +0 -59
- package/src/libs/crud-pro/services/CurdProServiceHub.ts +0 -92
- package/src/libs/crud-pro/sql.txt +0 -120
- package/src/libs/crud-pro/utils/CompareUtils.ts +0 -23
- package/src/libs/crud-pro/utils/DatabaseName.ts +0 -40
- package/src/libs/crud-pro/utils/DateTimeUtils.ts +0 -20
- package/src/libs/crud-pro/utils/MemoryRefreshCache.ts +0 -64
- package/src/libs/crud-pro/utils/MessageParseUtils.ts +0 -33
- package/src/libs/crud-pro/utils/MixinUtils.ts +0 -285
- package/src/libs/crud-pro/utils/ModelUtils.ts +0 -55
- package/src/libs/crud-pro/utils/MultiKeyMap.ts +0 -72
- package/src/libs/crud-pro/utils/SqlFuncUtils.ts +0 -29
- package/src/libs/crud-pro/utils/TypeUtils.ts +0 -188
- package/src/libs/crud-pro/utils/ValidateUtils.ts +0 -167
- package/src/libs/crud-pro/utils/pool/MySQLUtils.ts +0 -20
- package/src/libs/crud-pro/utils/pool/PostgresUtils.ts +0 -22
- package/src/libs/crud-pro/utils/pool/SqlServerUtils.ts +0 -22
- package/src/libs/crud-pro/utils/sqlConvert/convertColumnName.ts +0 -26
- package/src/libs/crud-pro/utils/sqlConvert/convertMsSql.ts +0 -11
- package/src/libs/crud-pro/utils/sqlConvert/convertPgSql.ts +0 -11
- package/src/libs/crud-pro/utils/sqlConvert/convertPgType.ts +0 -129
- package/src/libs/utils/common-dto.ts +0 -52
- package/src/libs/utils/crypto-utils.ts +0 -52
- package/src/libs/utils/fatcms-request.ts +0 -115
- package/src/libs/utils/functions.ts +0 -67
- package/src/libs/utils/ordernum-utils.ts +0 -18
- package/src/libs/utils/parseConfig.ts +0 -62
- package/src/libs/utils/parseCreateSql.ts +0 -91
- package/src/libs/utils/render-utils.ts +0 -184
- package/src/middleware/forbidden.middleware.ts +0 -71
- package/src/middleware/global.middleware.ts +0 -278
- package/src/middleware/permission.middleware.ts +0 -81
- package/src/middleware/tx.middleware.ts +0 -30
- package/src/models/SystemEntities.ts +0 -115
- package/src/models/SystemPerm.ts +0 -105
- package/src/models/SystemTables.ts +0 -30
- package/src/models/bizmodels.ts +0 -89
- package/src/models/contextLogger.ts +0 -132
- package/src/models/devops.ts +0 -17
- package/src/models/userSession.ts +0 -216
- package/src/schedule/index.ts +0 -73
- package/src/service/AuthService.ts +0 -270
- package/src/service/EnumInfoService.ts +0 -129
- package/src/service/FileCenterService.ts +0 -394
- package/src/service/SysConfigService.ts +0 -34
- package/src/service/UserAccountService.ts +0 -100
- package/src/service/UserSessionService.ts +0 -81
- package/src/service/VisitStatService.ts +0 -179
- package/src/service/WorkbenchService.ts +0 -160
- package/src/service/anyapi/AnyApiSandboxService.ts +0 -121
- package/src/service/anyapi/AnyApiService.ts +0 -184
- package/src/service/base/ApiBaseService.ts +0 -42
- package/src/service/base/ApiRateLimiter.ts +0 -59
- package/src/service/base/BaseService.ts +0 -74
- package/src/service/base/RedisCacheService.ts +0 -38
- package/src/service/crudstd/CrudStdActionService.ts +0 -27
- package/src/service/crudstd/CrudStdConstant.ts +0 -62
- package/src/service/crudstd/CrudStdRelationService.ts +0 -78
- package/src/service/crudstd/CrudStdService.ts +0 -188
- package/src/service/curd/CurdMixByAccountService.ts +0 -83
- package/src/service/curd/CurdMixByDictService.ts +0 -113
- package/src/service/curd/CurdMixByLinkToCustomService.ts +0 -167
- package/src/service/curd/CurdMixBySysConfigService.ts +0 -78
- package/src/service/curd/CurdMixByWorkbenchService.ts +0 -68
- package/src/service/curd/CurdMixService.ts +0 -65
- package/src/service/curd/CurdMixUtils.ts +0 -248
- package/src/service/curd/CurdProService.ts +0 -379
- package/src/service/proxyapi/ProxyApiLoadService.ts +0 -165
- package/src/service/proxyapi/ProxyApiService.ts +0 -262
- package/src/service/proxyapi/ProxyApiUtils.ts +0 -32
- package/src/service/proxyapi/RouteHandler.ts +0 -8
- package/src/service/proxyapi/RouteTrie.ts +0 -74
- package/src/service/proxyapi/WeightedRandom.ts +0 -37
- package/src/service/proxyapi/WeightedRoundRobin.ts +0 -44
- package/src/views/404_app.html +0 -31
- package/src/views/404_workbench.html +0 -34
- package/src/views/static/favicon.ico +0 -0
|
@@ -22,6 +22,7 @@ const ApiBaseService_1 = require("../../service/base/ApiBaseService");
|
|
|
22
22
|
const CurdProService_1 = require("../../service/curd/CurdProService");
|
|
23
23
|
const CurdMixService_1 = require("../../service/curd/CurdMixService");
|
|
24
24
|
const DatabaseName_1 = require("../../libs/crud-pro/utils/DatabaseName");
|
|
25
|
+
const global_config_1 = require("../../libs/global-config/global-config");
|
|
25
26
|
const QUERY_AS_LIST = ['condition', 'data'];
|
|
26
27
|
function pickAsQuery(query_as_pick, query) {
|
|
27
28
|
if (query_as_pick && typeof query_as_pick === 'string') {
|
|
@@ -30,11 +31,11 @@ function pickAsQuery(query_as_pick, query) {
|
|
|
30
31
|
}
|
|
31
32
|
return query;
|
|
32
33
|
}
|
|
33
|
-
// /ns/gw/
|
|
34
|
+
// /ns/gw/crudApi/getUser?__query_as_condition__=id&_query_as_data__=name&&id=1&name=22
|
|
34
35
|
/**
|
|
35
|
-
* query形式1:GET: /ns/gw/
|
|
36
|
-
* query形式2:GET: /ns/gw/
|
|
37
|
-
* query形式3:GET: /ns/gw/
|
|
36
|
+
* query形式1:GET: /ns/gw/crudApi/getUser?__query_json__=%7B%22condition%22%3A%7B%22id%22%3A2%7D%7D
|
|
37
|
+
* query形式2:GET: /ns/gw/crudApi/getUser?__query_as__=condition&id=1&name=22
|
|
38
|
+
* query形式3:GET: /ns/gw/crudApi/createUser?__query_as__=data&__query_pick__=id,name&id=1&name=22
|
|
38
39
|
*
|
|
39
40
|
* 执行单个配置的接口
|
|
40
41
|
*/
|
|
@@ -50,7 +51,7 @@ let CrudMtdGatewayController = class CrudMtdGatewayController extends ApiBaseSer
|
|
|
50
51
|
if (!methodInfo || methodInfo.status !== 1) {
|
|
51
52
|
return common_dto_1.CommonResult.errorRes('接口不存在或已下线: ' + methodCode);
|
|
52
53
|
}
|
|
53
|
-
this.logInfo(
|
|
54
|
+
this.logInfo('methodInfo=== ', methodInfo);
|
|
54
55
|
const workbench_code_array = methodInfo.workbench_code_array || methodInfo.workbenchCodeArray;
|
|
55
56
|
const isSupport = await this.workbenchService.isSupportCurrentWorkbench(workbench_code_array);
|
|
56
57
|
if (!isSupport) {
|
|
@@ -83,7 +84,9 @@ let CrudMtdGatewayController = class CrudMtdGatewayController extends ApiBaseSer
|
|
|
83
84
|
const cfgModel = methodInfo;
|
|
84
85
|
const { dbType, dbName } = (0, DatabaseName_1.parseDatabaseName)(cfgModel.sqlDatabase);
|
|
85
86
|
cfgModel.sqlDatabase = dbName;
|
|
86
|
-
cfgModel.
|
|
87
|
+
cfgModel.sqlDbType = dbType;
|
|
88
|
+
// 业务系统自定义的修改cfgModel
|
|
89
|
+
await global_config_1.GLOBAL_STATIC_CONFIG.getConfig().bizUpdateCfgModelForCrudMtd(reqJson, cfgModel, methodInfo, this.ctx);
|
|
87
90
|
return this.curdMixService.executeCrudByCfg(reqJson, cfgModel);
|
|
88
91
|
}
|
|
89
92
|
};
|
|
@@ -16,6 +16,7 @@ exports.DocGatewayController = void 0;
|
|
|
16
16
|
const core_1 = require("@midwayjs/core");
|
|
17
17
|
const BaseApiController_1 = require("../base/BaseApiController");
|
|
18
18
|
const SystemTables_1 = require("../../models/SystemTables");
|
|
19
|
+
const global_config_1 = require("../../libs/global-config/global-config");
|
|
19
20
|
const keys_1 = require("../../libs/crud-pro/models/keys");
|
|
20
21
|
const WorkbenchService_1 = require("../../service/WorkbenchService");
|
|
21
22
|
const common_dto_1 = require("../../libs/utils/common-dto");
|
|
@@ -40,9 +41,10 @@ let DocGatewayController = class DocGatewayController extends BaseApiController_
|
|
|
40
41
|
if (nxRes !== 'OK') {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
44
|
+
const { SystemDbName, SystemDbType } = global_config_1.GLOBAL_STATIC_CONFIG.getConfig();
|
|
43
45
|
await this.curdMixService.executeCrudByCfg({
|
|
44
46
|
data: {
|
|
45
|
-
pv: pv + 1
|
|
47
|
+
pv: pv + 1,
|
|
46
48
|
},
|
|
47
49
|
condition: {
|
|
48
50
|
id: parseInt(docId),
|
|
@@ -51,8 +53,8 @@ let DocGatewayController = class DocGatewayController extends BaseApiController_
|
|
|
51
53
|
}, {
|
|
52
54
|
sqlTable: SystemTables_1.SystemTables.sys_doc,
|
|
53
55
|
sqlSimpleName: keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE,
|
|
54
|
-
sqlDatabase:
|
|
55
|
-
|
|
56
|
+
sqlDatabase: SystemDbName,
|
|
57
|
+
sqlDbType: SystemDbType,
|
|
56
58
|
});
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
@@ -66,6 +68,7 @@ let DocGatewayController = class DocGatewayController extends BaseApiController_
|
|
|
66
68
|
if (!docLibInfoRes.success) {
|
|
67
69
|
return docLibInfoRes;
|
|
68
70
|
}
|
|
71
|
+
const { SystemDbName, SystemDbType } = global_config_1.GLOBAL_STATIC_CONFIG.getConfig();
|
|
69
72
|
const res = await this.curdMixService.executeCrudByCfg({
|
|
70
73
|
condition: {
|
|
71
74
|
id: parseInt(docId),
|
|
@@ -74,8 +77,8 @@ let DocGatewayController = class DocGatewayController extends BaseApiController_
|
|
|
74
77
|
}, {
|
|
75
78
|
sqlTable: SystemTables_1.SystemTables.sys_doc,
|
|
76
79
|
sqlSimpleName: keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE,
|
|
77
|
-
sqlDatabase:
|
|
78
|
-
|
|
80
|
+
sqlDatabase: SystemDbName,
|
|
81
|
+
sqlDbType: SystemDbType,
|
|
79
82
|
});
|
|
80
83
|
// 更新PV数据
|
|
81
84
|
const docObj = res.getOneObj();
|
|
@@ -94,6 +97,7 @@ let DocGatewayController = class DocGatewayController extends BaseApiController_
|
|
|
94
97
|
if (!docLibInfoRes.success) {
|
|
95
98
|
return docLibInfoRes;
|
|
96
99
|
}
|
|
100
|
+
const { SystemDbName, SystemDbType } = global_config_1.GLOBAL_STATIC_CONFIG.getConfig();
|
|
97
101
|
return this.curdMixService.executeCrudByCfg({
|
|
98
102
|
columns: 'id,title,doc_category_code,sort_index',
|
|
99
103
|
orderBy: 'sort_index+,id-',
|
|
@@ -106,8 +110,8 @@ let DocGatewayController = class DocGatewayController extends BaseApiController_
|
|
|
106
110
|
}, {
|
|
107
111
|
sqlTable: SystemTables_1.SystemTables.sys_doc,
|
|
108
112
|
sqlSimpleName: keys_1.KeysOfSimpleSQL.SIMPLE_QUERY,
|
|
109
|
-
sqlDatabase:
|
|
110
|
-
|
|
113
|
+
sqlDatabase: SystemDbName,
|
|
114
|
+
sqlDbType: SystemDbType,
|
|
111
115
|
});
|
|
112
116
|
}
|
|
113
117
|
/**
|
|
@@ -116,6 +120,7 @@ let DocGatewayController = class DocGatewayController extends BaseApiController_
|
|
|
116
120
|
*/
|
|
117
121
|
async getDocLibInfo(docLibId) {
|
|
118
122
|
checkIsNumber(docLibId, 'docLibId');
|
|
123
|
+
const { SystemDbName, SystemDbType } = global_config_1.GLOBAL_STATIC_CONFIG.getConfig();
|
|
119
124
|
const s = await this.curdMixService.executeCrudByCfg({
|
|
120
125
|
condition: {
|
|
121
126
|
id: parseInt(docLibId),
|
|
@@ -123,8 +128,8 @@ let DocGatewayController = class DocGatewayController extends BaseApiController_
|
|
|
123
128
|
}, {
|
|
124
129
|
sqlTable: SystemTables_1.SystemTables.sys_doc_lib,
|
|
125
130
|
sqlSimpleName: keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE,
|
|
126
|
-
sqlDatabase:
|
|
127
|
-
|
|
131
|
+
sqlDatabase: SystemDbName,
|
|
132
|
+
sqlDbType: SystemDbType,
|
|
128
133
|
});
|
|
129
134
|
const docLibInfo = s.getOneObj();
|
|
130
135
|
if (!docLibInfo) {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Context } from '@midwayjs/koa';
|
|
2
2
|
import { BaseApiController } from '../base/BaseApiController';
|
|
3
|
+
import { FileCenterService } from '../../service/FileCenterService';
|
|
3
4
|
import { CommonResult } from '../../libs/utils/common-dto';
|
|
4
5
|
/**
|
|
5
6
|
* 文件上传下载服务
|
|
6
7
|
*/
|
|
7
8
|
export declare class FileController extends BaseApiController {
|
|
8
|
-
ctx: Context;
|
|
9
|
-
|
|
9
|
+
protected ctx: Context;
|
|
10
|
+
protected fileCenterService: FileCenterService;
|
|
10
11
|
/**
|
|
11
12
|
* 上传普通文件。必须是登录用户才能上传。
|
|
12
13
|
* @param files
|
|
@@ -48,11 +48,11 @@ let PublicApiController = class PublicApiController extends BaseApiController_1.
|
|
|
48
48
|
if (!workbenchMenuCode) {
|
|
49
49
|
return common_dto_1.CommonResult.errorRes('param workbenchMenuCode is null');
|
|
50
50
|
}
|
|
51
|
-
const workbenchMenuCodeStr =
|
|
51
|
+
const workbenchMenuCodeStr = '' + workbenchMenuCode;
|
|
52
52
|
const workbenchMenuCodeArray = workbenchMenuCodeStr.split(',');
|
|
53
53
|
const condition = {
|
|
54
54
|
menu_code: {
|
|
55
|
-
|
|
55
|
+
$in: workbenchMenuCodeArray,
|
|
56
56
|
},
|
|
57
57
|
};
|
|
58
58
|
const rows = await this.sysDBUtil.getList({ condition }, SystemTables_1.SystemTables.sys_menus);
|
|
@@ -74,9 +74,7 @@ let PublicApiController = class PublicApiController extends BaseApiController_1.
|
|
|
74
74
|
// 特殊的devops菜单
|
|
75
75
|
map['devops'] = {
|
|
76
76
|
menu_list: [],
|
|
77
|
-
hasPermission: this.ctx.userSession.isAuthPass(keys_1.KeysOfAuthType.byRoleCode, [
|
|
78
|
-
SystemPerm_1.SystemRoleCode.DevOpsWriter, SystemPerm_1.SystemRoleCode.DevOpsViewer, SystemPerm_1.SystemRoleCode.SuperAdmin
|
|
79
|
-
])
|
|
77
|
+
hasPermission: this.ctx.userSession.isAuthPass(keys_1.KeysOfAuthType.byRoleCode, [SystemPerm_1.SystemRoleCode.DevOpsWriter, SystemPerm_1.SystemRoleCode.DevOpsViewer, SystemPerm_1.SystemRoleCode.SuperAdmin]),
|
|
80
78
|
};
|
|
81
79
|
return common_dto_1.CommonResult.successRes(map);
|
|
82
80
|
}
|
|
@@ -109,7 +107,7 @@ let PublicApiController = class PublicApiController extends BaseApiController_1.
|
|
|
109
107
|
const body = this.ctx.request.body;
|
|
110
108
|
const query = this.ctx.query || {};
|
|
111
109
|
let codeList = _.get(body, 'codeList');
|
|
112
|
-
|
|
110
|
+
const refreshCache = `${_.get(body, 'refreshCache')}` === 'true' || query.refreshCache === 'true';
|
|
113
111
|
if (query.codeList) {
|
|
114
112
|
//codeList=dict@@SexEnum,sysCfgEnum@@EntityStatusEnum
|
|
115
113
|
const codeListStr = query.codeList;
|
|
@@ -20,12 +20,13 @@ const fs2 = require("fs");
|
|
|
20
20
|
const path = require("path");
|
|
21
21
|
const https = require("https");
|
|
22
22
|
const functions_1 = require("../../libs/utils/functions");
|
|
23
|
+
const schedule_1 = require("../../schedule");
|
|
23
24
|
function getPathConfig(ossName) {
|
|
24
25
|
const remoteBaseUrlMap = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
cdnjsx: 'https://cdnjsx.oss-cn-shanghai.aliyuncs.com',
|
|
27
|
+
'i.alicdn.com': 'https://i.alicdn.com',
|
|
28
|
+
'img.alicdn.com': 'https://img.alicdn.com',
|
|
29
|
+
'at.alicdn.com': 'https://at.alicdn.com',
|
|
29
30
|
};
|
|
30
31
|
let remoteBaseUrl = remoteBaseUrlMap[ossName];
|
|
31
32
|
if (!remoteBaseUrl) {
|
|
@@ -43,17 +44,14 @@ let notFoundListIsInit = false;
|
|
|
43
44
|
* 静态文件代理功能
|
|
44
45
|
*/
|
|
45
46
|
let StaticController = class StaticController extends BaseApiController_1.BaseApiController {
|
|
46
|
-
constructor() {
|
|
47
|
-
super();
|
|
48
|
-
this.initNotFoundList();
|
|
49
|
-
}
|
|
50
47
|
getLocalPaths() {
|
|
51
|
-
const
|
|
48
|
+
const app = schedule_1.ANONYMOUS_CONTEXT.getApp();
|
|
49
|
+
const appDir = app.getAppDir();
|
|
52
50
|
const localDir = path.join(appDir, './public/static'); // 本地文件存储目录
|
|
53
51
|
const notFoundListFile = path.join(localDir, '__404__list.json'); // 404列表文件
|
|
54
52
|
return {
|
|
55
53
|
localDir,
|
|
56
|
-
notFoundListFile
|
|
54
|
+
notFoundListFile,
|
|
57
55
|
};
|
|
58
56
|
}
|
|
59
57
|
async initNotFoundList() {
|
|
@@ -77,8 +75,8 @@ let StaticController = class StaticController extends BaseApiController_1.BaseAp
|
|
|
77
75
|
}
|
|
78
76
|
async responseLocalFile(localFilePath, localHeaderPath, relativePath) {
|
|
79
77
|
const headers = {
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
'Cache-Control': 'public, max-age=31536000',
|
|
79
|
+
Expires: new Date(Date.now() + 31536000000).toUTCString(),
|
|
82
80
|
};
|
|
83
81
|
try {
|
|
84
82
|
// 检查本地文件是否存在.头文件
|
|
@@ -87,16 +85,17 @@ let StaticController = class StaticController extends BaseApiController_1.BaseAp
|
|
|
87
85
|
const headerDataStr = await fs.readFile(localHeaderPath, 'utf8');
|
|
88
86
|
const headerData = (0, functions_1.parseJsonObject)(headerDataStr);
|
|
89
87
|
if (headerData) {
|
|
90
|
-
headers[
|
|
91
|
-
headers[
|
|
92
|
-
headers[
|
|
93
|
-
headers[
|
|
94
|
-
headers[
|
|
95
|
-
headers[
|
|
88
|
+
headers['content-type'] = headerData['content-type'];
|
|
89
|
+
headers['content-length'] = headerData['content-length'];
|
|
90
|
+
headers['last-modified'] = headerData['last-modified'];
|
|
91
|
+
headers['etag'] = headerData['etag'];
|
|
92
|
+
headers['cache-control'] = headerData['cache-control'];
|
|
93
|
+
headers['accept-ranges'] = headerData['accept-ranges'];
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
97
|
catch (error) {
|
|
98
|
+
this.logDebug('[StaticController]responseLocalFile', error);
|
|
100
99
|
}
|
|
101
100
|
try {
|
|
102
101
|
// 检查本地文件是否存在
|
|
@@ -111,7 +110,7 @@ let StaticController = class StaticController extends BaseApiController_1.BaseAp
|
|
|
111
110
|
// stream.on = (...args)=>{
|
|
112
111
|
// return oldOn(...args)
|
|
113
112
|
// }
|
|
114
|
-
|
|
113
|
+
this.logInfo(`[StaticController]返回本地文件: ${relativePath}`);
|
|
115
114
|
this.ctx.status = 200;
|
|
116
115
|
this.ctx.set(headers);
|
|
117
116
|
this.ctx.body = stream;
|
|
@@ -124,11 +123,12 @@ let StaticController = class StaticController extends BaseApiController_1.BaseAp
|
|
|
124
123
|
return false;
|
|
125
124
|
}
|
|
126
125
|
async proxyStaticFile(ossName, relativePath) {
|
|
126
|
+
await this.initNotFoundList();
|
|
127
127
|
const { localDir } = this.getLocalPaths();
|
|
128
128
|
const PATH_CONFIG = getPathConfig(ossName);
|
|
129
129
|
// 构建本地路径和远程路径
|
|
130
|
-
const localFilePath = path.join(localDir,
|
|
131
|
-
const localHeaderPath = path.join(localDir,
|
|
130
|
+
const localFilePath = path.join(localDir, 'files', ossName, relativePath);
|
|
131
|
+
const localHeaderPath = path.join(localDir, 'headers', ossName, relativePath);
|
|
132
132
|
const remoteUrl = `${PATH_CONFIG.remoteBaseUrl}/${relativePath}`;
|
|
133
133
|
// 检查是否在404列表中
|
|
134
134
|
if (notFoundList.has(relativePath)) {
|
|
@@ -140,7 +140,7 @@ let StaticController = class StaticController extends BaseApiController_1.BaseAp
|
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
// 请求远程文件
|
|
143
|
-
|
|
143
|
+
this.logInfo(`[StaticController]请求远程文件: ${remoteUrl}`);
|
|
144
144
|
try {
|
|
145
145
|
const remoteRes = await this.httpsGet(remoteUrl);
|
|
146
146
|
// 处理远程响应状态码
|
|
@@ -156,26 +156,26 @@ let StaticController = class StaticController extends BaseApiController_1.BaseAp
|
|
|
156
156
|
// 记录404并返回
|
|
157
157
|
notFoundList.add(relativePath);
|
|
158
158
|
await this.saveNotFoundList();
|
|
159
|
-
|
|
159
|
+
this.logInfo(`[StaticController]远程文件不存在,已记录404: ${relativePath}`);
|
|
160
160
|
this.ctx.status = 404;
|
|
161
161
|
return this.ctx.render('500', { errorMsg: ' 远程文件不存在,已记录404' });
|
|
162
162
|
}
|
|
163
163
|
else {
|
|
164
164
|
// 其他状态码
|
|
165
|
-
const msg =
|
|
166
|
-
|
|
165
|
+
const msg = `[StaticController]远程服务器返回状态码: ${remoteRes.statusCode}`;
|
|
166
|
+
this.logInfo(msg);
|
|
167
167
|
this.ctx.status = 502;
|
|
168
168
|
return this.ctx.render('500', { errorMsg: msg });
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
catch (err) {
|
|
172
|
-
const msg =
|
|
173
|
-
|
|
172
|
+
const msg = `[StaticController]请求远程文件失败: ${err}`;
|
|
173
|
+
this.logError(msg);
|
|
174
174
|
this.ctx.status = 500;
|
|
175
175
|
return this.ctx.render('500', { errorMsg: msg });
|
|
176
176
|
}
|
|
177
177
|
this.ctx.status = 500;
|
|
178
|
-
return this.ctx.render('500', { errorMsg:
|
|
178
|
+
return this.ctx.render('500', { errorMsg: '未知异常' });
|
|
179
179
|
}
|
|
180
180
|
// 保存404列表
|
|
181
181
|
async saveNotFoundList() {
|
|
@@ -187,19 +187,21 @@ let StaticController = class StaticController extends BaseApiController_1.BaseAp
|
|
|
187
187
|
await fs.writeFile(notFoundListFile, JSON.stringify(Array.from(notFoundList), null), 'utf8');
|
|
188
188
|
}
|
|
189
189
|
catch (error) {
|
|
190
|
-
|
|
190
|
+
this.logError('[StaticController]保存404列表失败:', error);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
// 封装https请求为异步函数
|
|
194
194
|
async httpsGet(url) {
|
|
195
195
|
return new Promise((resolve, reject) => {
|
|
196
|
-
https
|
|
196
|
+
https
|
|
197
|
+
.get(url, res => {
|
|
197
198
|
resolve({
|
|
198
199
|
statusCode: res.statusCode || 500,
|
|
199
200
|
headers: res.headers,
|
|
200
|
-
body: res
|
|
201
|
+
body: res,
|
|
201
202
|
});
|
|
202
|
-
})
|
|
203
|
+
})
|
|
204
|
+
.on('error', err => {
|
|
203
205
|
reject(err);
|
|
204
206
|
});
|
|
205
207
|
});
|
|
@@ -222,17 +224,17 @@ let StaticController = class StaticController extends BaseApiController_1.BaseAp
|
|
|
222
224
|
// 使用管道将响应流写入文件
|
|
223
225
|
await new Promise((resolve, reject) => {
|
|
224
226
|
body.pipe(fileStream);
|
|
225
|
-
body.on('error',
|
|
227
|
+
body.on('error', err => {
|
|
226
228
|
reject(new Error(`读取响应流失败: ${err.message}`));
|
|
227
229
|
});
|
|
228
230
|
fileStream.on('finish', resolve);
|
|
229
|
-
fileStream.on('error',
|
|
231
|
+
fileStream.on('error', err => {
|
|
230
232
|
reject(new Error(`写入文件失败: ${err.message}`));
|
|
231
233
|
});
|
|
232
234
|
});
|
|
233
|
-
|
|
235
|
+
this.logInfo(`[StaticController]文件已成功写入1: ${localFilePath}`);
|
|
234
236
|
await fs.writeFile(localHeaderPath, JSON.stringify(httpsGetRes.headers), 'utf8');
|
|
235
|
-
|
|
237
|
+
this.logInfo(`[StaticController]文件已成功写入2: ${localHeaderPath}`);
|
|
236
238
|
}
|
|
237
239
|
catch (err) {
|
|
238
240
|
// 发生错误时删除可能存在的不完整文件
|
|
@@ -261,7 +263,7 @@ let StaticController = class StaticController extends BaseApiController_1.BaseAp
|
|
|
261
263
|
'.txt': 'text/plain',
|
|
262
264
|
'.pdf': 'application/pdf',
|
|
263
265
|
'.mp4': 'video/mp4',
|
|
264
|
-
'.ico': 'image/x-icon'
|
|
266
|
+
'.ico': 'image/x-icon',
|
|
265
267
|
};
|
|
266
268
|
return mimeTypes[extname] || 'application/octet-stream';
|
|
267
269
|
}
|
|
@@ -279,7 +281,6 @@ __decorate([
|
|
|
279
281
|
__metadata("design:returntype", Promise)
|
|
280
282
|
], StaticController.prototype, "proxyStaticFile", null);
|
|
281
283
|
StaticController = __decorate([
|
|
282
|
-
(0, core_1.Controller)('/ns/static')
|
|
283
|
-
__metadata("design:paramtypes", [])
|
|
284
|
+
(0, core_1.Controller)('/ns/static')
|
|
284
285
|
], StaticController);
|
|
285
286
|
exports.StaticController = StaticController;
|
|
@@ -3,7 +3,7 @@ import { Context } from '@midwayjs/koa';
|
|
|
3
3
|
import { CurdMixService } from '../service/curd/CurdMixService';
|
|
4
4
|
import { CommonResult } from '../libs/utils/common-dto';
|
|
5
5
|
export declare class HelpersApi {
|
|
6
|
-
ctx: Context;
|
|
6
|
+
protected ctx: Context;
|
|
7
7
|
private midwayWebRouterService;
|
|
8
8
|
protected curdMixService: CurdMixService;
|
|
9
9
|
getApiEnv(): Promise<{
|
|
@@ -31,15 +31,16 @@ let HomeController = class HomeController extends BaseApiController_1.BaseApiCon
|
|
|
31
31
|
}
|
|
32
32
|
const html_content = workbenchInfo.html_content || '未配置HTML模版';
|
|
33
33
|
const userInfo = this.getUserSessionInfo();
|
|
34
|
-
const fatcmscsrftoken = await crypto_utils_1.privateAES.time_encrypt_utf8_base64(
|
|
34
|
+
const fatcmscsrftoken = await crypto_utils_1.privateAES.time_encrypt_utf8_base64('' + Date.now());
|
|
35
35
|
const utils = (0, render_utils_1.createRenderUtils)({
|
|
36
36
|
ctx: this.ctx,
|
|
37
37
|
userInfo,
|
|
38
38
|
workbenchInfo,
|
|
39
39
|
package_assets: workbenchInfo.package_assets,
|
|
40
|
-
fatcmscsrftoken
|
|
40
|
+
fatcmscsrftoken,
|
|
41
41
|
});
|
|
42
|
-
|
|
42
|
+
const query = this.ctx.query || {};
|
|
43
|
+
return this.ctx.renderString(html_content, { workbenchInfo, userInfo, utils, query }, { viewEngine: 'ejs' });
|
|
43
44
|
}
|
|
44
45
|
async robots() {
|
|
45
46
|
return `User-agent: * \nDisallow: /ns/api/manage/`;
|
|
@@ -46,14 +46,14 @@ let AnyApiMangeApi = class AnyApiMangeApi extends BaseApiController_1.BaseApiCon
|
|
|
46
46
|
fixBodyData(this.ctx.request.body);
|
|
47
47
|
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_anyapi, keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
48
48
|
validateCfg: {
|
|
49
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
49
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
50
50
|
},
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
async deleteAnyApi() {
|
|
54
54
|
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_anyapi, keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
55
55
|
validateCfg: {
|
|
56
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
56
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
57
57
|
},
|
|
58
58
|
});
|
|
59
59
|
}
|
|
@@ -34,7 +34,7 @@ let AppLogMangeApi = class AppLogMangeApi extends BaseApiController_1.BaseApiCon
|
|
|
34
34
|
async updateAppLog() {
|
|
35
35
|
return this.executeSysSimpleSQL('sys_app_log', keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
36
36
|
validateCfg: {
|
|
37
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
37
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
38
38
|
'condition.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
39
39
|
},
|
|
40
40
|
});
|
|
@@ -42,7 +42,7 @@ let AppLogMangeApi = class AppLogMangeApi extends BaseApiController_1.BaseApiCon
|
|
|
42
42
|
async deleteAppLog() {
|
|
43
43
|
return this.executeSysSimpleSQL('sys_app_log', keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
44
44
|
validateCfg: {
|
|
45
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
45
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
46
46
|
'condition.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
47
47
|
},
|
|
48
48
|
});
|
|
@@ -34,7 +34,7 @@ let AppMangeApi = class AppMangeApi extends BaseApiController_1.BaseApiControlle
|
|
|
34
34
|
async updateApp() {
|
|
35
35
|
return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
36
36
|
validateCfg: {
|
|
37
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
37
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
38
38
|
'condition.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
39
39
|
},
|
|
40
40
|
});
|
|
@@ -42,7 +42,7 @@ let AppMangeApi = class AppMangeApi extends BaseApiController_1.BaseApiControlle
|
|
|
42
42
|
async deleteApp() {
|
|
43
43
|
return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
44
44
|
validateCfg: {
|
|
45
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
45
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
46
46
|
'condition.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
47
47
|
},
|
|
48
48
|
});
|
|
@@ -35,14 +35,14 @@ let AppPageMangeApi = class AppPageMangeApi extends BaseApiController_1.BaseApiC
|
|
|
35
35
|
async updateAppPage() {
|
|
36
36
|
return this.executeSysSimpleSQL('sys_app_page', keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
37
37
|
validateCfg: {
|
|
38
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
38
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
async deleteAppPage() {
|
|
43
43
|
return this.executeSysSimpleSQL('sys_app_page', keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
44
44
|
validateCfg: {
|
|
45
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
45
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -31,14 +31,14 @@ let AppSchemaHistoryApi = class AppSchemaHistoryApi extends BaseApiController_1.
|
|
|
31
31
|
async updateAppSchemaHistory() {
|
|
32
32
|
return this.executeSysSimpleSQL(tableName, keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
33
33
|
validateCfg: {
|
|
34
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
34
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
async deleteAppSchemaHistory() {
|
|
39
39
|
return this.executeSysSimpleSQL(tableName, keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
40
40
|
validateCfg: {
|
|
41
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
41
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -32,14 +32,14 @@ let CrudMethodsMangeApi = class CrudMethodsMangeApi extends BaseApiController_1.
|
|
|
32
32
|
async updateCrudMethod() {
|
|
33
33
|
return this.executeSysSimpleSQL('sys_crud_methods', keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
34
34
|
validateCfg: {
|
|
35
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
35
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
async deleteCrudMethod() {
|
|
40
40
|
return this.executeSysSimpleSQL('sys_crud_methods', keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
41
41
|
validateCfg: {
|
|
42
|
-
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.
|
|
42
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseApiController } from '../base/BaseApiController';
|
|
2
2
|
import { SqlDbType } from '../../libs/crud-pro/models/keys';
|
|
3
|
-
import { CommonResult } from
|
|
3
|
+
import { CommonResult } from '../../libs/utils/common-dto';
|
|
4
4
|
export declare class CrudStandardDesignApi extends BaseApiController {
|
|
5
5
|
private mysql2Config;
|
|
6
6
|
private postgres2Config;
|