midway-fatcms 0.0.1-beta.4 → 0.0.1-beta.41
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/Transaction.d.ts +1 -0
- package/dist/libs/crud-pro/models/Transaction.js +7 -0
- 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/base64.d.ts +9 -0
- package/dist/libs/utils/base64.js +42 -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.d.ts +1 -0
- package/dist/service/proxyapi/ProxyApiService.js +43 -9
- package/dist/views/404_app.html +31 -31
- package/dist/views/404_workbench.html +34 -34
- package/package.json +28 -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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Context } from '@midwayjs/koa';
|
|
2
2
|
import { CurdProService } from './CurdProService';
|
|
3
|
-
import {
|
|
3
|
+
import { HandleExecuteContextType, IExecuteContextHandler } from '../../libs/crud-pro/models/ExecuteContext';
|
|
4
4
|
export declare class CurdMixBySysConfigService implements IExecuteContextHandler {
|
|
5
5
|
ctx: Context;
|
|
6
6
|
protected curdProService: CurdProService;
|
|
7
|
-
handleExecuteContextPrepare(executeContext:
|
|
8
|
-
handleExecuteContext(executeContext:
|
|
7
|
+
handleExecuteContextPrepare(executeContext: HandleExecuteContextType): Promise<void>;
|
|
8
|
+
handleExecuteContext(executeContext: HandleExecuteContextType): Promise<void>;
|
|
9
9
|
}
|
|
@@ -18,10 +18,12 @@ const SystemTables_1 = require("../../models/SystemTables");
|
|
|
18
18
|
const keys_1 = require("../../libs/crud-pro/models/keys");
|
|
19
19
|
const MultiKeyMap_1 = require("../../libs/crud-pro/utils/MultiKeyMap");
|
|
20
20
|
const parseConfig_1 = require("../../libs/utils/parseConfig");
|
|
21
|
+
const global_config_1 = require("../../libs/global-config/global-config");
|
|
21
22
|
const dictMixUtils = new CurdMixUtils_1.CrudMixUtils(CurdMixUtils_1.RelatedType.sysCfgEnum);
|
|
22
23
|
const TMP_CTX_KEY = _.uniqueId('CurdMixBySysConfigService');
|
|
23
24
|
let CurdMixBySysConfigService = class CurdMixBySysConfigService {
|
|
24
25
|
async handleExecuteContextPrepare(executeContext) {
|
|
26
|
+
const { SystemDbName, SystemDbType } = global_config_1.GLOBAL_STATIC_CONFIG.getConfig();
|
|
25
27
|
const codes = dictMixUtils.pickColumnRelationCodes(executeContext);
|
|
26
28
|
if (!codes || codes.length === 0) {
|
|
27
29
|
return;
|
|
@@ -31,8 +33,8 @@ let CurdMixBySysConfigService = class CurdMixBySysConfigService {
|
|
|
31
33
|
}, {
|
|
32
34
|
sqlTable: SystemTables_1.SystemTables.sys_configs,
|
|
33
35
|
sqlSimpleName: keys_1.KeysOfSimpleSQL.SIMPLE_QUERY,
|
|
34
|
-
sqlDatabase:
|
|
35
|
-
|
|
36
|
+
sqlDatabase: SystemDbName,
|
|
37
|
+
sqlDbType: SystemDbType,
|
|
36
38
|
});
|
|
37
39
|
const rows = res1.getResRows();
|
|
38
40
|
const multiKeyMap = new MultiKeyMap_1.MultiKeyMap();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Context } from '@midwayjs/koa';
|
|
2
2
|
import { CurdProService } from './CurdProService';
|
|
3
|
-
import {
|
|
3
|
+
import { HandleExecuteContextType, IExecuteContextHandler } from '../../libs/crud-pro/models/ExecuteContext';
|
|
4
4
|
export declare class CurdMixByWorkbenchService implements IExecuteContextHandler {
|
|
5
5
|
ctx: Context;
|
|
6
6
|
protected curdProService: CurdProService;
|
|
7
7
|
private loadWorkbenchListMap;
|
|
8
|
-
handleExecuteContextPrepare(executeContext:
|
|
9
|
-
handleExecuteContext(executeContext:
|
|
8
|
+
handleExecuteContextPrepare(executeContext: HandleExecuteContextType): Promise<void>;
|
|
9
|
+
handleExecuteContext(executeContext: HandleExecuteContextType): Promise<void>;
|
|
10
10
|
}
|
|
@@ -18,6 +18,7 @@ const CurdMixUtils_1 = require("./CurdMixUtils");
|
|
|
18
18
|
const SystemTables_1 = require("../../models/SystemTables");
|
|
19
19
|
const keys_1 = require("../../libs/crud-pro/models/keys");
|
|
20
20
|
const MixinUtils_1 = require("../../libs/crud-pro/utils/MixinUtils");
|
|
21
|
+
const global_config_1 = require("../../libs/global-config/global-config");
|
|
21
22
|
const lruCache = new lru_cache_1.LRUCache({
|
|
22
23
|
max: 500,
|
|
23
24
|
ttl: 1000 * 60 * 5,
|
|
@@ -27,6 +28,7 @@ const workbenchMixUtils = new CurdMixUtils_1.CrudMixUtils(CurdMixUtils_1.Related
|
|
|
27
28
|
const TMP_CTX_KEY = _.uniqueId('CurdMixByWorkbenchService');
|
|
28
29
|
let CurdMixByWorkbenchService = class CurdMixByWorkbenchService {
|
|
29
30
|
async loadWorkbenchListMap() {
|
|
31
|
+
const { SystemDbName, SystemDbType } = global_config_1.GLOBAL_STATIC_CONFIG.getConfig();
|
|
30
32
|
let workbenchListMap = lruCache.get('workbenchListMap');
|
|
31
33
|
if (!workbenchListMap) {
|
|
32
34
|
const reqJson = {
|
|
@@ -36,8 +38,8 @@ let CurdMixByWorkbenchService = class CurdMixByWorkbenchService {
|
|
|
36
38
|
const res = await this.curdProService.executeCrudByCfg(reqJson, {
|
|
37
39
|
sqlTable: SystemTables_1.SystemTables.sys_workbench,
|
|
38
40
|
sqlSimpleName: keys_1.KeysOfSimpleSQL.SIMPLE_QUERY,
|
|
39
|
-
sqlDatabase:
|
|
40
|
-
|
|
41
|
+
sqlDatabase: SystemDbName,
|
|
42
|
+
sqlDbType: SystemDbType,
|
|
41
43
|
});
|
|
42
44
|
const workbenchList = res.getResRows();
|
|
43
45
|
workbenchListMap = MixinUtils_1.MixinUtils.toNewMap(workbenchList, (obj) => obj.workbench_code);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { IRequestCfgModel, IRequestModel, ISqlCfgModel } from '../../libs/crud-pro/interfaces';
|
|
1
|
+
import { ColumnRelation, IRequestCfgModel, IRequestModel, ISqlCfgModel } from '../../libs/crud-pro/interfaces';
|
|
2
2
|
import { IRequestCfgModel2 } from '../../models/bizmodels';
|
|
3
|
-
import { SqlDbType } from
|
|
3
|
+
import { SqlDbType } from '../../libs/crud-pro/models/keys';
|
|
4
|
+
export interface ILinkColumnRelationParam {
|
|
5
|
+
columnsRelations: ColumnRelation[];
|
|
6
|
+
}
|
|
4
7
|
export declare class CurdMixService {
|
|
5
8
|
private curdProService;
|
|
6
9
|
private curdMixByDictService;
|
|
@@ -10,8 +13,15 @@ export declare class CurdMixService {
|
|
|
10
13
|
private curdMixByLinkToCustomService;
|
|
11
14
|
private prepare;
|
|
12
15
|
executeCrudByCfg(reqJson: IRequestModel, cfgModel: IRequestCfgModel2): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
13
|
-
getBbUtil(
|
|
16
|
+
getBbUtil(sqlDatabase: string, sqlDbType: SqlDbType, sqlTable?: string): import("./CrudProQuick").CrudProQuick;
|
|
14
17
|
executeSQL(sqlCfgModel: ISqlCfgModel): Promise<any>;
|
|
15
18
|
executeCrud(reqJson: IRequestModel): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
16
19
|
getCachedCfgByMethod(method: string): Promise<IRequestCfgModel>;
|
|
20
|
+
/**
|
|
21
|
+
* 根据配置的关联关系,直接关联数据
|
|
22
|
+
* @param rows
|
|
23
|
+
* @param param
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
linkColumnRelationDatas(rows: any[], param: ILinkColumnRelationParam): Promise<void>;
|
|
17
27
|
}
|
|
@@ -30,9 +30,9 @@ let CurdMixService = class CurdMixService {
|
|
|
30
30
|
this.prepare();
|
|
31
31
|
return this.curdProService.executeCrudByCfg(reqJson, cfgModel);
|
|
32
32
|
}
|
|
33
|
-
getBbUtil(
|
|
33
|
+
getBbUtil(sqlDatabase, sqlDbType, sqlTable) {
|
|
34
34
|
this.prepare();
|
|
35
|
-
return this.curdProService.getBbUtil(
|
|
35
|
+
return this.curdProService.getBbUtil(sqlDatabase, sqlDbType, sqlTable);
|
|
36
36
|
}
|
|
37
37
|
async executeSQL(sqlCfgModel) {
|
|
38
38
|
this.prepare();
|
|
@@ -45,6 +45,30 @@ let CurdMixService = class CurdMixService {
|
|
|
45
45
|
async getCachedCfgByMethod(method) {
|
|
46
46
|
return this.curdProService.getCachedCfgByMethod(method);
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* 根据配置的关联关系,直接关联数据
|
|
50
|
+
* @param rows
|
|
51
|
+
* @param param
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
async linkColumnRelationDatas(rows, param) {
|
|
55
|
+
if (!Array.isArray(rows) || rows.length === 0) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.prepare();
|
|
59
|
+
const exeCtx = {
|
|
60
|
+
rows,
|
|
61
|
+
columnsRelation: param.columnsRelations,
|
|
62
|
+
isCustomContext: true,
|
|
63
|
+
};
|
|
64
|
+
const responseCfgHandlers = this.curdProService.getResponseCfgHandlers();
|
|
65
|
+
const handlers = Object.values(responseCfgHandlers);
|
|
66
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
67
|
+
const handler = handlers[i];
|
|
68
|
+
await handler.handleExecuteContextPrepare(exeCtx);
|
|
69
|
+
await handler.handleExecuteContext(exeCtx);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
48
72
|
};
|
|
49
73
|
__decorate([
|
|
50
74
|
(0, core_1.Inject)(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColumnRelation } from '../../libs/crud-pro/interfaces';
|
|
2
|
-
import {
|
|
2
|
+
import { HandleExecuteContextType } from '../../libs/crud-pro/models/ExecuteContext';
|
|
3
3
|
import { MultiKeyMap } from '../../libs/crud-pro/utils/MultiKeyMap';
|
|
4
4
|
declare enum RelatedType {
|
|
5
5
|
dict = "dict",
|
|
@@ -13,9 +13,25 @@ declare class CrudMixUtils {
|
|
|
13
13
|
private readonly relatedType;
|
|
14
14
|
constructor(relatedType: RelatedType);
|
|
15
15
|
private getColumnsRelation;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
/**
|
|
17
|
+
* 从执行上下文,获取所有的关联关系
|
|
18
|
+
* @param exeCtxType
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
pickColumnRelations(exeCtxType: HandleExecuteContextType): ColumnRelation[];
|
|
22
|
+
/**
|
|
23
|
+
* 从执行上下文,获取所有的关联关系的代码
|
|
24
|
+
* @param exeCtx
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
pickColumnRelationCodes(exeCtx: HandleExecuteContextType): string[];
|
|
28
|
+
/**
|
|
29
|
+
* 遍历每一行,每一个关联列
|
|
30
|
+
* @param exeCtxType
|
|
31
|
+
* @param func
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
forEachRowAndColumnsRelation(exeCtxType: HandleExecuteContextType, func: FuncRowColumnRelation): void;
|
|
19
35
|
copyColumnRelationToRow(row: any, multiKeyMap: MultiKeyMap, columnRelation: ColumnRelation): void;
|
|
20
36
|
/**
|
|
21
37
|
* 无relatedCode模式
|
|
@@ -24,5 +40,12 @@ declare class CrudMixUtils {
|
|
|
24
40
|
* @param columnRelation
|
|
25
41
|
*/
|
|
26
42
|
copyColumnRelationToRowNoRelatedCode(row: any, map: Map<string, any>, columnRelation: ColumnRelation): void;
|
|
43
|
+
/**
|
|
44
|
+
* 专门COPY用户信息到row上面。无relatedCode模式
|
|
45
|
+
* @param row
|
|
46
|
+
* @param map
|
|
47
|
+
* @param columnRelation
|
|
48
|
+
*/
|
|
49
|
+
copyUserInfoToRowNoRelatedCode(row: any, map: Map<string, any>, columnRelation: ColumnRelation): void;
|
|
27
50
|
}
|
|
28
51
|
export { CrudMixUtils, RelatedType, FuncRowColumnRelation };
|
|
@@ -24,6 +24,11 @@ function getColumnsRelationAll(sqlCfg, cfgModel) {
|
|
|
24
24
|
}
|
|
25
25
|
return [];
|
|
26
26
|
}
|
|
27
|
+
const forEachColumnsRelation = (row, columnsRelation, func) => {
|
|
28
|
+
for (let i = 0; i < columnsRelation.length; i++) {
|
|
29
|
+
func(row, columnsRelation[i]);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
27
32
|
function copyBySingleSourceValue(row, sourceValue, targetColumns, getValue) {
|
|
28
33
|
// const codeObject = map.get(sourceValue);
|
|
29
34
|
const codeObject = getValue(sourceValue);
|
|
@@ -33,53 +38,60 @@ function copyBySingleSourceValue(row, sourceValue, targetColumns, getValue) {
|
|
|
33
38
|
if (Array.isArray(targetColumns)) {
|
|
34
39
|
for (let i = 0; i < targetColumns.length; i++) {
|
|
35
40
|
const targetColumn = targetColumns[i];
|
|
36
|
-
const toStr = targetColumn.to.replace('[$ARRAY_INDEX]',
|
|
37
|
-
if (targetColumn.from ===
|
|
41
|
+
const toStr = targetColumn.to.replace('[$ARRAY_INDEX]', '');
|
|
42
|
+
if (targetColumn.from === '*') {
|
|
38
43
|
_.set(row, toStr, codeObject);
|
|
39
44
|
}
|
|
40
45
|
else {
|
|
41
46
|
const dictAttrValue = _.get(codeObject, targetColumn.from);
|
|
42
|
-
if (typeof dictAttrValue !==
|
|
47
|
+
if (typeof dictAttrValue !== 'undefined' && dictAttrValue !== null) {
|
|
43
48
|
_.set(row, toStr, dictAttrValue);
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
|
-
function
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const dictAttrValue = _.get(codeObject, targetColumn.from);
|
|
70
|
-
if (typeof dictAttrValue !== "undefined" && dictAttrValue !== null) {
|
|
71
|
-
const toStr = targetColumn.to.replace('$ARRAY_INDEX', `${codeIndex}`);
|
|
72
|
-
_.set(row, toStr, dictAttrValue);
|
|
73
|
-
isSetArray = true;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
54
|
+
function copyByArraySourceValueInner(row, codes, targetColumns, getValue, resultObj) {
|
|
55
|
+
for (let codeIndex = 0; codeIndex < codes.length; codeIndex++) {
|
|
56
|
+
const code = codes[codeIndex];
|
|
57
|
+
// const codeObject = map.get(code);
|
|
58
|
+
const codeObject = getValue(code);
|
|
59
|
+
if (codeObject) {
|
|
60
|
+
if (Array.isArray(targetColumns)) {
|
|
61
|
+
for (let i = 0; i < targetColumns.length; i++) {
|
|
62
|
+
const targetColumn = targetColumns[i];
|
|
63
|
+
if (targetColumn.from === '*') {
|
|
64
|
+
const toStr = targetColumn.to.replace('$ARRAY_INDEX', `${codeIndex}`);
|
|
65
|
+
_.set(row, toStr, codeObject);
|
|
66
|
+
resultObj.isSetArray = true;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const dictAttrValue = _.get(codeObject, targetColumn.from);
|
|
70
|
+
if (typeof dictAttrValue !== 'undefined' && dictAttrValue !== null) {
|
|
71
|
+
const toStr = targetColumn.to.replace('$ARRAY_INDEX', `${codeIndex}`);
|
|
72
|
+
_.set(row, toStr, dictAttrValue);
|
|
73
|
+
resultObj.isSetArray = true;
|
|
76
74
|
}
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
|
-
|
|
80
|
+
}
|
|
81
|
+
function copyByArraySourceValue(row, sourceValue, targetColumns, getValue) {
|
|
82
|
+
const resultObj = { isSetArray: false };
|
|
83
|
+
// 支持关联JSON数组。使用 字符串存储的类型
|
|
84
|
+
if (typeof sourceValue === 'string' && sourceValue.startsWith('[') && sourceValue.endsWith(']')) {
|
|
85
|
+
const codes = (0, functions_1.parseJsonObject)(sourceValue);
|
|
86
|
+
if (Array.isArray(codes)) {
|
|
87
|
+
copyByArraySourceValueInner(row, codes, targetColumns, getValue, resultObj);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else if (Array.isArray(sourceValue)) {
|
|
91
|
+
// 直接使用JSON或者postgres的数组存储的类型
|
|
92
|
+
copyByArraySourceValueInner(row, sourceValue, targetColumns, getValue, resultObj);
|
|
93
|
+
}
|
|
94
|
+
return resultObj.isSetArray;
|
|
83
95
|
}
|
|
84
96
|
class CrudMixUtils {
|
|
85
97
|
constructor(relatedType) {
|
|
@@ -90,8 +102,21 @@ class CrudMixUtils {
|
|
|
90
102
|
const relatedType = this.relatedType;
|
|
91
103
|
return ss.filter(s => s.relatedType === relatedType);
|
|
92
104
|
}
|
|
93
|
-
|
|
105
|
+
/**
|
|
106
|
+
* 从执行上下文,获取所有的关联关系
|
|
107
|
+
* @param exeCtxType
|
|
108
|
+
* @returns
|
|
109
|
+
*/
|
|
110
|
+
pickColumnRelations(exeCtxType) {
|
|
111
|
+
// 自定义的关联关系
|
|
112
|
+
const customExeCtx = exeCtxType;
|
|
113
|
+
if (customExeCtx.isCustomContext) {
|
|
114
|
+
const customExeCtx = exeCtxType;
|
|
115
|
+
return customExeCtx.columnsRelation;
|
|
116
|
+
}
|
|
117
|
+
// 默认的执行上下文
|
|
94
118
|
const relationResult = [];
|
|
119
|
+
const exeCtx = exeCtxType;
|
|
95
120
|
const cfgModel = exeCtx.getCfgModel();
|
|
96
121
|
const sqlModels = exeCtx.getSqlCfgModels();
|
|
97
122
|
if (Array.isArray(sqlModels) && sqlModels.length > 0) {
|
|
@@ -113,6 +138,11 @@ class CrudMixUtils {
|
|
|
113
138
|
return `${obj.relatedCode}_${obj.relatedType}_${obj.sourceColumn}_${JSON.stringify(obj.targetColumns)}`;
|
|
114
139
|
});
|
|
115
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* 从执行上下文,获取所有的关联关系的代码
|
|
143
|
+
* @param exeCtx
|
|
144
|
+
* @returns
|
|
145
|
+
*/
|
|
116
146
|
pickColumnRelationCodes(exeCtx) {
|
|
117
147
|
const relationResult = this.pickColumnRelations(exeCtx);
|
|
118
148
|
const codes = relationResult.map(e => e.relatedCode);
|
|
@@ -121,15 +151,29 @@ class CrudMixUtils {
|
|
|
121
151
|
}
|
|
122
152
|
return [...new Set(codes)]; // 去重
|
|
123
153
|
}
|
|
124
|
-
|
|
154
|
+
/**
|
|
155
|
+
* 遍历每一行,每一个关联列
|
|
156
|
+
* @param exeCtxType
|
|
157
|
+
* @param func
|
|
158
|
+
* @returns
|
|
159
|
+
*/
|
|
160
|
+
forEachRowAndColumnsRelation(exeCtxType, func) {
|
|
161
|
+
// 自定义的关联关系
|
|
162
|
+
const customExeCtx = exeCtxType;
|
|
163
|
+
if (customExeCtx.isCustomContext) {
|
|
164
|
+
const rows = customExeCtx.rows || [];
|
|
165
|
+
const columnsRelation = customExeCtx.columnsRelation;
|
|
166
|
+
for (let index = 0; index < rows.length; index++) {
|
|
167
|
+
const row = rows[index];
|
|
168
|
+
forEachColumnsRelation(row, columnsRelation, func);
|
|
169
|
+
}
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
// 默认的执行上下文
|
|
173
|
+
const exeCtx = exeCtxType;
|
|
125
174
|
const sqlCfgList = exeCtx.getSqlCfgModels();
|
|
126
175
|
const resModel = exeCtx.getResModel();
|
|
127
176
|
const cfgModel = exeCtx.getCfgModel();
|
|
128
|
-
const forEachColumnsRelation = (row, columnsRelation) => {
|
|
129
|
-
for (let i = 0; i < columnsRelation.length; i++) {
|
|
130
|
-
func(row, columnsRelation[i]);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
177
|
for (let i = 0; i < sqlCfgList.length; i++) {
|
|
134
178
|
const sqlCfg = sqlCfgList[i];
|
|
135
179
|
// 只有Select语句需要
|
|
@@ -140,12 +184,12 @@ class CrudMixUtils {
|
|
|
140
184
|
if (Array.isArray(resValue) && isNotEmpty(resValue)) {
|
|
141
185
|
// 多行查询时
|
|
142
186
|
for (const row of resValue) {
|
|
143
|
-
forEachColumnsRelation(row, columnsRelation);
|
|
187
|
+
forEachColumnsRelation(row, columnsRelation, func);
|
|
144
188
|
}
|
|
145
189
|
}
|
|
146
190
|
else if (typeof resValue === 'object' && isNotEmpty(resValue)) {
|
|
147
191
|
// 单行查询时
|
|
148
|
-
forEachColumnsRelation(resValue, columnsRelation);
|
|
192
|
+
forEachColumnsRelation(resValue, columnsRelation, func);
|
|
149
193
|
}
|
|
150
194
|
}
|
|
151
195
|
}
|
|
@@ -187,7 +231,37 @@ class CrudMixUtils {
|
|
|
187
231
|
if (!map) {
|
|
188
232
|
return null;
|
|
189
233
|
}
|
|
190
|
-
if (typeof map.get ===
|
|
234
|
+
if (typeof map.get === 'function') {
|
|
235
|
+
return map.get(`${code}`);
|
|
236
|
+
}
|
|
237
|
+
return map[code];
|
|
238
|
+
};
|
|
239
|
+
const isSetArray = copyByArraySourceValue(row, sourceValue, targetColumns, getValue);
|
|
240
|
+
if (!isSetArray) {
|
|
241
|
+
copyBySingleSourceValue(row, sourceValue, targetColumns, getValue);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* 专门COPY用户信息到row上面。无relatedCode模式
|
|
246
|
+
* @param row
|
|
247
|
+
* @param map
|
|
248
|
+
* @param columnRelation
|
|
249
|
+
*/
|
|
250
|
+
copyUserInfoToRowNoRelatedCode(row, map, columnRelation) {
|
|
251
|
+
const { targetColumns } = columnRelation;
|
|
252
|
+
if (!targetColumns) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const tmpSourceColumn = '__fatcmsUserAccountId__';
|
|
256
|
+
const sourceValue = _.get(row, tmpSourceColumn);
|
|
257
|
+
if (!sourceValue) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const getValue = (code) => {
|
|
261
|
+
if (!map) {
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
if (typeof map.get === 'function') {
|
|
191
265
|
return map.get(`${code}`);
|
|
192
266
|
}
|
|
193
267
|
return map[code];
|
|
@@ -5,14 +5,7 @@ import { ExecuteContext, IExecuteContextHandler } from '../../libs/crud-pro/mode
|
|
|
5
5
|
import { RelatedType } from './CurdMixUtils';
|
|
6
6
|
import { BaseService } from '../base/BaseService';
|
|
7
7
|
import { IRequestCfgModel2 } from '../../models/bizmodels';
|
|
8
|
-
|
|
9
|
-
private readonly sqlDatabase;
|
|
10
|
-
private readonly sqlDdType;
|
|
11
|
-
private readonly curdProService;
|
|
12
|
-
constructor(sqlDatabase: string, sqlDdType: SqlDbType, curdProService: CurdProService);
|
|
13
|
-
getOne(reqJson: IRequestModel, sqlTable: string): Promise<any>;
|
|
14
|
-
getList(reqJson: IRequestModel, sqlTable: string): Promise<any[]>;
|
|
15
|
-
}
|
|
8
|
+
import { CrudProQuick } from '../../service/curd/CrudProQuick';
|
|
16
9
|
export declare class CurdProService extends BaseService {
|
|
17
10
|
protected ctx: Context;
|
|
18
11
|
private mysql2Config;
|
|
@@ -21,6 +14,7 @@ export declare class CurdProService extends BaseService {
|
|
|
21
14
|
private crudProCfg;
|
|
22
15
|
private responseCfgHandlers;
|
|
23
16
|
setResponseCfgHandlers(key: RelatedType, handler: IExecuteContextHandler): void;
|
|
17
|
+
getResponseCfgHandlers(): Record<RelatedType, IExecuteContextHandler>;
|
|
24
18
|
/**
|
|
25
19
|
* Execute级别:每次调用都会产生新的
|
|
26
20
|
* @private
|
|
@@ -33,7 +27,6 @@ export declare class CurdProService extends BaseService {
|
|
|
33
27
|
executeCrud(reqJson: IRequestModel): Promise<ExecuteContext>;
|
|
34
28
|
executeSQL(sqlCfgModel: ISqlCfgModel): Promise<any>;
|
|
35
29
|
executeCrudByCfg(reqJson: IRequestModel, cfgModel: IRequestCfgModel2): Promise<ExecuteContext>;
|
|
36
|
-
|
|
37
|
-
getBbUtil(database: string, sqlDdType: SqlDbType): DBUtils;
|
|
30
|
+
getBbUtil(sqlDatabase: string, sqlDbType: SqlDbType, sqlTable?: string): CrudProQuick;
|
|
38
31
|
getCachedCfgByMethod(method: string): Promise<IRequestCfgModel>;
|
|
39
32
|
}
|