midway-fatcms 0.0.9 → 0.0.11
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/dist/config/config.default.js +2 -4
- package/dist/configuration.d.ts +10 -4
- package/dist/configuration.js +57 -12
- package/dist/controller/base/BaseApiController.d.ts +20 -1
- package/dist/controller/base/BaseApiController.js +128 -2
- package/dist/controller/gateway/AsyncTaskController.d.ts +1 -0
- package/dist/controller/gateway/AsyncTaskController.js +40 -2
- package/dist/controller/helpers.controller.d.ts +5 -4
- package/dist/controller/helpers.controller.js +33 -15
- package/dist/controller/home.controller.d.ts +3 -0
- package/dist/controller/home.controller.js +13 -1
- package/dist/controller/manage/AccountRoleManageApi.d.ts +10 -0
- package/dist/controller/manage/AccountRoleManageApi.js +103 -0
- package/dist/controller/manage/AnyApiMangeApi.js +9 -2
- package/dist/controller/manage/AppLogMangeApi.js +9 -2
- package/dist/controller/manage/AppMangeApi.d.ts +0 -2
- package/dist/controller/manage/AppMangeApi.js +14 -18
- package/dist/controller/manage/AppPageMangeApi.js +9 -2
- package/dist/controller/manage/ConfigChangelogManageApi.d.ts +9 -0
- package/dist/controller/manage/ConfigChangelogManageApi.js +80 -0
- package/dist/controller/manage/CrudMethodsMangeApi.js +14 -5
- package/dist/controller/manage/DataDictManageApi.d.ts +2 -3
- package/dist/controller/manage/DataDictManageApi.js +35 -31
- package/dist/controller/manage/DeployManageApi.d.ts +0 -3
- package/dist/controller/manage/DeployManageApi.js +6 -33
- package/dist/controller/manage/DocLibManageApi.js +5 -0
- package/dist/controller/manage/DocManageApi.js +5 -0
- package/dist/controller/manage/FlowConfigManageApi.d.ts +0 -2
- package/dist/controller/manage/FlowConfigManageApi.js +5 -16
- package/dist/controller/manage/FuncManageApi.d.ts +10 -0
- package/dist/controller/manage/FuncManageApi.js +87 -0
- package/dist/controller/manage/MenuManageApi.d.ts +0 -1
- package/dist/controller/manage/MenuManageApi.js +10 -14
- package/dist/controller/manage/ProxyApiMangeApi.js +5 -3
- package/dist/controller/manage/RoleFuncManageApi.d.ts +10 -0
- package/dist/controller/manage/RoleFuncManageApi.js +102 -0
- package/dist/controller/manage/RoleManageApi.d.ts +10 -0
- package/dist/controller/manage/RoleManageApi.js +87 -0
- package/dist/controller/manage/SysConfigMangeApi.d.ts +0 -1
- package/dist/controller/manage/SysConfigMangeApi.js +13 -13
- package/dist/controller/manage/UserAccountManageApi.d.ts +0 -1
- package/dist/controller/manage/UserAccountManageApi.js +7 -15
- package/dist/controller/manage/WorkbenchMangeApi.d.ts +0 -1
- package/dist/controller/manage/WorkbenchMangeApi.js +17 -22
- package/dist/controller/render/AppRenderController.d.ts +3 -0
- package/dist/controller/render/AppRenderController.js +13 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/interface.d.ts +2 -1
- package/dist/libs/crud-pro/CrudPro.d.ts +19 -0
- package/dist/libs/crud-pro/CrudPro.js +50 -1
- package/dist/libs/crud-pro/exceptions.d.ts +9 -1
- package/dist/libs/crud-pro/exceptions.js +9 -1
- package/dist/libs/crud-pro/interfaces.d.ts +84 -47
- package/dist/libs/crud-pro/interfaces.js +2 -2
- package/dist/libs/crud-pro/models/CrudResult.d.ts +14 -1
- package/dist/libs/crud-pro/models/CrudResult.js +9 -1
- package/dist/libs/crud-pro/models/RequestCfgModel.d.ts +1 -0
- package/dist/libs/crud-pro/models/RequestModel.d.ts +2 -2
- package/dist/libs/crud-pro/services/CrudProCachedCfgService.d.ts +7 -0
- package/dist/libs/crud-pro/services/CrudProCachedCfgService.js +13 -2
- package/dist/libs/crud-pro/services/CrudProDataTypeConvertService.d.ts +28 -101
- package/dist/libs/crud-pro/services/CrudProDataTypeConvertService.js +258 -151
- package/dist/libs/crud-pro/services/CrudProOriginToExecuteSql.js +18 -8
- package/dist/libs/crud-pro/services/CrudProTableMetaService.js +2 -1
- package/dist/libs/crud-pro/utils/CrudMonitor.d.ts +20 -0
- package/dist/libs/crud-pro/utils/CrudMonitor.js +40 -0
- package/dist/libs/crud-pro/utils/MemoryRefreshCache.d.ts +4 -0
- package/dist/libs/crud-pro/utils/MemoryRefreshCache.js +10 -1
- package/dist/libs/crud-pro/utils/MixinUtils.js +27 -14
- package/dist/libs/crud-pro/utils/SqlFuncUtils.d.ts +187 -2
- package/dist/libs/crud-pro/utils/SqlFuncUtils.js +204 -12
- package/dist/libs/crud-pro/utils/pool/MySQLUtils.js +9 -1
- package/dist/libs/crud-pro-quick/CrudProQuick.d.ts +22 -13
- package/dist/libs/crud-pro-quick/CrudProQuick.js +54 -26
- package/dist/middleware/cacherefresh.middleware.d.ts +47 -0
- package/dist/middleware/cacherefresh.middleware.js +74 -0
- package/dist/models/CacheRefreshCategory.d.ts +23 -0
- package/dist/models/CacheRefreshCategory.js +27 -0
- package/dist/models/FlowModel.d.ts +4 -3
- package/dist/models/RedisKeys.d.ts +1 -4
- package/dist/models/RedisKeys.js +1 -4
- package/dist/models/SystemPerm.d.ts +8 -1
- package/dist/models/SystemPerm.js +7 -0
- package/dist/models/SystemTables.d.ts +1 -0
- package/dist/models/SystemTables.js +1 -0
- package/dist/schedule/runSchedule.js +1 -1
- package/dist/schedule/scheduleNames.d.ts +2 -6
- package/dist/schedule/scheduleNames.js +3 -7
- package/dist/service/AuthService.js +1 -1
- package/dist/service/ConfigChangelogService.d.ts +69 -0
- package/dist/service/ConfigChangelogService.js +196 -0
- package/dist/service/SysAppService.js +10 -7
- package/dist/service/SysConfigService.js +6 -4
- package/dist/service/SysDictDataService.js +6 -4
- package/dist/service/SysMenuService.js +7 -5
- package/dist/service/UserSessionService.js +6 -4
- package/dist/service/WorkbenchService.js +7 -5
- package/dist/service/anyapi/AnyApiService.js +1 -1
- package/dist/service/base/cache/CacheServiceFactory.d.ts +37 -6
- package/dist/service/base/cache/CacheServiceFactory.js +52 -30
- package/dist/service/base/cache-refresh/CacheRefreshHub.d.ts +33 -0
- package/dist/service/base/cache-refresh/CacheRefreshHub.js +54 -0
- package/dist/service/base/cache-refresh/CacheRefreshHubScheduleService.d.ts +11 -0
- package/dist/service/base/cache-refresh/CacheRefreshHubScheduleService.js +26 -0
- package/dist/service/base/cache-refresh/CacheRefreshRedisSubscriber.d.ts +30 -0
- package/dist/service/base/cache-refresh/CacheRefreshRedisSubscriber.js +108 -0
- package/dist/service/crudstd/CrudStdService.d.ts +2 -3
- package/dist/service/crudstd/CrudStdService.js +0 -1
- package/dist/service/curd/CurdMixByDictService.js +1 -1
- package/dist/service/curd/CurdMixByLinkToCustomService.js +3 -8
- package/dist/service/curd/CurdMixBySysConfigService.js +1 -1
- package/dist/service/curd/CurdMixByWorkbenchService.js +7 -5
- package/dist/service/curd/CurdProService.d.ts +2 -0
- package/dist/service/curd/CurdProService.js +11 -0
- package/dist/service/flow/FlowConfigService.js +6 -4
- package/dist/service/proxyapi/ProxyApiLoadService.d.ts +3 -3
- package/dist/service/proxyapi/ProxyApiLoadService.js +7 -5
- package/dist/service/proxyapi/RouteTrie.d.ts +6 -1
- package/dist/service/proxyapi/RouteTrie.js +9 -1
- package/package.json +2 -2
- package/{.qoder/skills → skills}/midway-fatcms/02-crud-quick.md +99 -9
- package/{.qoder/skills → skills}/midway-fatcms/05-configuration.md +24 -16
- package/{.qoder/skills → skills}/midway-fatcms/07-examples.md +93 -0
- package/skills/midway-fatcms/08-sqlfunc-expressions.md +484 -0
- package/skills/midway-fatcms/09-native-sql.md +301 -0
- package/{.qoder/skills → skills}/midway-fatcms/SKILL.md +3 -0
- package/src/config/config.default.ts +2 -4
- package/src/configuration.ts +66 -13
- package/src/controller/base/BaseApiController.ts +159 -3
- package/src/controller/gateway/AsyncTaskController.ts +43 -2
- package/src/controller/helpers.controller.ts +35 -13
- package/src/controller/home.controller.ts +15 -1
- package/src/controller/manage/AccountRoleManageApi.ts +68 -0
- package/src/controller/manage/AnyApiMangeApi.ts +9 -2
- package/src/controller/manage/AppLogMangeApi.ts +9 -2
- package/src/controller/manage/AppMangeApi.ts +14 -18
- package/src/controller/manage/AppPageMangeApi.ts +9 -2
- package/src/controller/manage/ConfigChangelogManageApi.ts +52 -0
- package/src/controller/manage/CrudMethodsMangeApi.ts +14 -5
- package/src/controller/manage/DataDictManageApi.ts +35 -42
- package/src/controller/manage/DeployManageApi.ts +6 -25
- package/src/controller/manage/DocLibManageApi.ts +5 -0
- package/src/controller/manage/DocManageApi.ts +5 -0
- package/src/controller/manage/FlowConfigManageApi.ts +5 -19
- package/src/controller/manage/FuncManageApi.ts +52 -0
- package/src/controller/manage/MenuManageApi.ts +10 -18
- package/src/controller/manage/ProxyApiMangeApi.ts +5 -3
- package/src/controller/manage/RoleFuncManageApi.ts +67 -0
- package/src/controller/manage/RoleManageApi.ts +52 -0
- package/src/controller/manage/SysConfigMangeApi.ts +13 -12
- package/src/controller/manage/UserAccountManageApi.ts +8 -16
- package/src/controller/manage/WorkbenchMangeApi.ts +17 -26
- package/src/controller/render/AppRenderController.ts +19 -3
- package/src/index.ts +7 -0
- package/src/interface.ts +2 -1
- package/src/libs/crud-pro/CrudPro.ts +52 -2
- package/src/libs/crud-pro/exceptions.ts +10 -1
- package/src/libs/crud-pro/interfaces.ts +183 -135
- package/src/libs/crud-pro/models/CrudResult.ts +21 -0
- package/src/libs/crud-pro/models/RequestCfgModel.ts +1 -0
- package/src/libs/crud-pro/models/RequestModel.ts +2 -2
- package/src/libs/crud-pro/services/CrudProCachedCfgService.ts +12 -1
- package/src/libs/crud-pro/services/CrudProDataTypeConvertService.ts +266 -167
- package/src/libs/crud-pro/services/CrudProOriginToExecuteSql.ts +18 -8
- package/src/libs/crud-pro/services/CrudProTableMetaService.ts +3 -1
- package/src/libs/crud-pro/utils/CrudMonitor.ts +54 -1
- package/src/libs/crud-pro/utils/MemoryRefreshCache.ts +11 -1
- package/src/libs/crud-pro/utils/MixinUtils.ts +28 -14
- package/src/libs/crud-pro/utils/SqlFuncUtils.ts +405 -15
- package/src/libs/crud-pro/utils/pool/MySQLUtils.ts +9 -1
- package/src/libs/crud-pro-quick/CrudProQuick.ts +57 -27
- package/src/middleware/cacherefresh.middleware.ts +80 -0
- package/src/models/CacheRefreshCategory.ts +24 -0
- package/src/models/FlowModel.ts +8 -3
- package/src/models/RedisKeys.ts +1 -4
- package/src/models/SystemPerm.ts +9 -1
- package/src/models/SystemTables.ts +1 -0
- package/src/schedule/runSchedule.ts +1 -1
- package/src/schedule/scheduleNames.ts +3 -7
- package/src/service/AuthService.ts +1 -1
- package/src/service/ConfigChangelogService.ts +235 -0
- package/src/service/SysAppService.ts +7 -5
- package/src/service/SysConfigService.ts +3 -2
- package/src/service/SysDictDataService.ts +3 -2
- package/src/service/SysMenuService.ts +4 -3
- package/src/service/UserSessionService.ts +4 -3
- package/src/service/WorkbenchService.ts +4 -3
- package/src/service/anyapi/AnyApiService.ts +1 -1
- package/src/service/base/cache/CacheServiceFactory.ts +84 -46
- package/src/service/base/cache-refresh/CacheRefreshHub.ts +57 -0
- package/src/service/base/cache-refresh/CacheRefreshHubScheduleService.ts +17 -0
- package/src/service/base/cache-refresh/CacheRefreshRedisSubscriber.ts +115 -0
- package/src/service/crudstd/CrudStdService.ts +1 -2
- package/src/service/curd/CurdMixByDictService.ts +1 -1
- package/src/service/curd/CurdMixByLinkToCustomService.ts +3 -8
- package/src/service/curd/CurdMixBySysConfigService.ts +1 -1
- package/src/service/curd/CurdMixByWorkbenchService.ts +4 -3
- package/src/service/curd/CurdProService.ts +17 -0
- package/src/service/flow/FlowConfigService.ts +3 -2
- package/src/service/proxyapi/ProxyApiLoadService.ts +9 -8
- package/src/service/proxyapi/RouteTrie.ts +10 -1
- package/dist/service/TableMetaCacheRedisSubscriber.d.ts +0 -31
- package/dist/service/TableMetaCacheRedisSubscriber.js +0 -98
- package/src/service/TableMetaCacheRedisSubscriber.ts +0 -105
- /package/{.qoder/skills → skills}/midway-fatcms/01-quick-start.md +0 -0
- /package/{.qoder/skills → skills}/midway-fatcms/03-crud-sharding.md +0 -0
- /package/{.qoder/skills → skills}/midway-fatcms/04-condition-operators.md +0 -0
- /package/{.qoder/skills → skills}/midway-fatcms/06-builtin-functions.md +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AccountRoleManageApi = void 0;
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
|
+
const keys_1 = require("../../libs/crud-pro/models/keys");
|
|
15
|
+
const BaseApiController_1 = require("../base/BaseApiController");
|
|
16
|
+
const permission_middleware_1 = require("../../middleware/permission.middleware");
|
|
17
|
+
const cacherefresh_middleware_1 = require("../../middleware/cacherefresh.middleware");
|
|
18
|
+
const bizmodels_1 = require("../../models/bizmodels");
|
|
19
|
+
const SystemPerm_1 = require("../../models/SystemPerm");
|
|
20
|
+
const CurdMixUtils_1 = require("../../service/curd/CurdMixUtils");
|
|
21
|
+
let AccountRoleManageApi = class AccountRoleManageApi extends BaseApiController_1.BaseApiController {
|
|
22
|
+
async getAccountRoleList() {
|
|
23
|
+
return this.executeSysSimpleSQL('sys_perm_user_role', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE, {
|
|
24
|
+
columnsRelation: [
|
|
25
|
+
{
|
|
26
|
+
relatedType: CurdMixUtils_1.RelatedType.accountBasic,
|
|
27
|
+
sourceColumn: 'account_id',
|
|
28
|
+
targetColumns: [], // 默认: account_id_user.nick_name / .avatar / .account_id
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
relatedType: CurdMixUtils_1.RelatedType.linkToCustom,
|
|
32
|
+
relatedCode: 'fatcms~~~sys_perm_role~~~role_code,role_name,id',
|
|
33
|
+
sourceColumn: 'role_code',
|
|
34
|
+
targetColumns: [], // 默认: role_code_info = { role_code, role_name }
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async getAccountRoleOne() {
|
|
40
|
+
return this.executeSysSimpleSQL('sys_perm_user_role', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE);
|
|
41
|
+
}
|
|
42
|
+
async createAccountRole() {
|
|
43
|
+
return this.executeSysSimpleSQL('sys_perm_user_role', keys_1.KeysOfSimpleSQL.SIMPLE_INSERT, {
|
|
44
|
+
validateCfg: {
|
|
45
|
+
'data.account_id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
46
|
+
'data.role_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
47
|
+
'data.status': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
async updateAccountRole() {
|
|
52
|
+
return this.executeSysSimpleSQL('sys_perm_user_role', keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
53
|
+
validateCfg: {
|
|
54
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async deleteAccountRole() {
|
|
59
|
+
return this.executeSysSimpleSQL('sys_perm_user_role', keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
60
|
+
validateCfg: {
|
|
61
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, core_1.Inject)(),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], AccountRoleManageApi.prototype, "ctx", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, core_1.Post)('/getAccountRoleList'),
|
|
72
|
+
__metadata("design:type", Function),
|
|
73
|
+
__metadata("design:paramtypes", []),
|
|
74
|
+
__metadata("design:returntype", Promise)
|
|
75
|
+
], AccountRoleManageApi.prototype, "getAccountRoleList", null);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, core_1.Post)('/getAccountRoleOne'),
|
|
78
|
+
__metadata("design:type", Function),
|
|
79
|
+
__metadata("design:paramtypes", []),
|
|
80
|
+
__metadata("design:returntype", Promise)
|
|
81
|
+
], AccountRoleManageApi.prototype, "getAccountRoleOne", null);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, core_1.Post)('/createAccountRole', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AccountRoleManageWrite), (0, cacherefresh_middleware_1.refreshCache)(bizmodels_1.CacheNameEnum.CurdMixByAccount)] }),
|
|
84
|
+
__metadata("design:type", Function),
|
|
85
|
+
__metadata("design:paramtypes", []),
|
|
86
|
+
__metadata("design:returntype", Promise)
|
|
87
|
+
], AccountRoleManageApi.prototype, "createAccountRole", null);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, core_1.Post)('/updateAccountRole', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AccountRoleManageWrite), (0, cacherefresh_middleware_1.refreshCache)(bizmodels_1.CacheNameEnum.CurdMixByAccount)] }),
|
|
90
|
+
__metadata("design:type", Function),
|
|
91
|
+
__metadata("design:paramtypes", []),
|
|
92
|
+
__metadata("design:returntype", Promise)
|
|
93
|
+
], AccountRoleManageApi.prototype, "updateAccountRole", null);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, core_1.Post)('/deleteAccountRole', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AccountRoleManageWrite), (0, cacherefresh_middleware_1.refreshCache)(bizmodels_1.CacheNameEnum.CurdMixByAccount)] }),
|
|
96
|
+
__metadata("design:type", Function),
|
|
97
|
+
__metadata("design:paramtypes", []),
|
|
98
|
+
__metadata("design:returntype", Promise)
|
|
99
|
+
], AccountRoleManageApi.prototype, "deleteAccountRole", null);
|
|
100
|
+
AccountRoleManageApi = __decorate([
|
|
101
|
+
(0, core_1.Controller)('/ns/api/manage/accountRole', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AccountRoleManageRead)] })
|
|
102
|
+
], AccountRoleManageApi);
|
|
103
|
+
exports.AccountRoleManageApi = AccountRoleManageApi;
|
|
@@ -27,14 +27,19 @@ function fixBodyData(body) {
|
|
|
27
27
|
}
|
|
28
28
|
let AnyApiMangeApi = class AnyApiMangeApi extends BaseApiController_1.BaseApiController {
|
|
29
29
|
async getAnyApiList() {
|
|
30
|
-
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_anyapi, keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE
|
|
30
|
+
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_anyapi, keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE, {
|
|
31
|
+
enableSoftDelete: true,
|
|
32
|
+
});
|
|
31
33
|
}
|
|
32
34
|
async getAnyApiOne() {
|
|
33
|
-
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_anyapi, keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE
|
|
35
|
+
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_anyapi, keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE, {
|
|
36
|
+
enableSoftDelete: true,
|
|
37
|
+
});
|
|
34
38
|
}
|
|
35
39
|
async createAnyApi() {
|
|
36
40
|
fixBodyData(this.ctx.request.body);
|
|
37
41
|
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_anyapi, keys_1.KeysOfSimpleSQL.SIMPLE_INSERT, {
|
|
42
|
+
enableSoftDelete: true,
|
|
38
43
|
validateCfg: {
|
|
39
44
|
'data.method': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
40
45
|
'data.method_name': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
@@ -45,6 +50,7 @@ let AnyApiMangeApi = class AnyApiMangeApi extends BaseApiController_1.BaseApiCon
|
|
|
45
50
|
async updateAnyApi() {
|
|
46
51
|
fixBodyData(this.ctx.request.body);
|
|
47
52
|
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_anyapi, keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
53
|
+
enableSoftDelete: true,
|
|
48
54
|
validateCfg: {
|
|
49
55
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
50
56
|
},
|
|
@@ -52,6 +58,7 @@ let AnyApiMangeApi = class AnyApiMangeApi extends BaseApiController_1.BaseApiCon
|
|
|
52
58
|
}
|
|
53
59
|
async deleteAnyApi() {
|
|
54
60
|
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_anyapi, keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
61
|
+
enableSoftDelete: true,
|
|
55
62
|
validateCfg: {
|
|
56
63
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
57
64
|
},
|
|
@@ -17,13 +17,18 @@ const permission_middleware_1 = require("../../middleware/permission.middleware"
|
|
|
17
17
|
const SystemPerm_1 = require("../../models/SystemPerm");
|
|
18
18
|
let AppLogMangeApi = class AppLogMangeApi extends BaseApiController_1.BaseApiController {
|
|
19
19
|
async getAppLogList() {
|
|
20
|
-
return this.executeSysSimpleSQL('sys_app_log', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE
|
|
20
|
+
return this.executeSysSimpleSQL('sys_app_log', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE, {
|
|
21
|
+
enableSoftDelete: true,
|
|
22
|
+
});
|
|
21
23
|
}
|
|
22
24
|
async getAppLogOne() {
|
|
23
|
-
return this.executeSysSimpleSQL('sys_app_log', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE
|
|
25
|
+
return this.executeSysSimpleSQL('sys_app_log', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE, {
|
|
26
|
+
enableSoftDelete: true,
|
|
27
|
+
});
|
|
24
28
|
}
|
|
25
29
|
async createAppLog() {
|
|
26
30
|
return this.executeSysSimpleSQL('sys_app_log', keys_1.KeysOfSimpleSQL.SIMPLE_INSERT, {
|
|
31
|
+
enableSoftDelete: true,
|
|
27
32
|
validateCfg: {
|
|
28
33
|
'data.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
29
34
|
'data.app_name': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
@@ -33,6 +38,7 @@ let AppLogMangeApi = class AppLogMangeApi extends BaseApiController_1.BaseApiCon
|
|
|
33
38
|
}
|
|
34
39
|
async updateAppLog() {
|
|
35
40
|
return this.executeSysSimpleSQL('sys_app_log', keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
41
|
+
enableSoftDelete: true,
|
|
36
42
|
validateCfg: {
|
|
37
43
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
38
44
|
'condition.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
@@ -41,6 +47,7 @@ let AppLogMangeApi = class AppLogMangeApi extends BaseApiController_1.BaseApiCon
|
|
|
41
47
|
}
|
|
42
48
|
async deleteAppLog() {
|
|
43
49
|
return this.executeSysSimpleSQL('sys_app_log', keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
50
|
+
enableSoftDelete: true,
|
|
44
51
|
validateCfg: {
|
|
45
52
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
46
53
|
'condition.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Context } from '@midwayjs/koa';
|
|
2
2
|
import { BaseApiController } from '../base/BaseApiController';
|
|
3
|
-
import { SysAppService } from "../../service/SysAppService";
|
|
4
3
|
export declare class AppMangeApi extends BaseApiController {
|
|
5
4
|
protected ctx: Context;
|
|
6
|
-
protected sysAppService: SysAppService;
|
|
7
5
|
getAppList(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
8
6
|
getAppOne(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
9
7
|
createApp(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
@@ -15,16 +15,22 @@ const keys_1 = require("../../libs/crud-pro/models/keys");
|
|
|
15
15
|
const BaseApiController_1 = require("../base/BaseApiController");
|
|
16
16
|
const permission_middleware_1 = require("../../middleware/permission.middleware");
|
|
17
17
|
const SystemPerm_1 = require("../../models/SystemPerm");
|
|
18
|
-
const
|
|
18
|
+
const cacherefresh_middleware_1 = require("../../middleware/cacherefresh.middleware");
|
|
19
|
+
const bizmodels_1 = require("../../models/bizmodels");
|
|
19
20
|
let AppMangeApi = class AppMangeApi extends BaseApiController_1.BaseApiController {
|
|
20
21
|
async getAppList() {
|
|
21
|
-
return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE
|
|
22
|
+
return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE, {
|
|
23
|
+
enableSoftDelete: true,
|
|
24
|
+
});
|
|
22
25
|
}
|
|
23
26
|
async getAppOne() {
|
|
24
|
-
return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE
|
|
27
|
+
return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE, {
|
|
28
|
+
enableSoftDelete: true,
|
|
29
|
+
});
|
|
25
30
|
}
|
|
26
31
|
async createApp() {
|
|
27
32
|
return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_INSERT, {
|
|
33
|
+
enableSoftDelete: true,
|
|
28
34
|
validateCfg: {
|
|
29
35
|
'data.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
30
36
|
'data.app_name': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
@@ -33,11 +39,8 @@ let AppMangeApi = class AppMangeApi extends BaseApiController_1.BaseApiControlle
|
|
|
33
39
|
});
|
|
34
40
|
}
|
|
35
41
|
async updateApp() {
|
|
36
|
-
var _a;
|
|
37
|
-
const body = this.ctx.request.body;
|
|
38
|
-
const appCode = (_a = body === null || body === void 0 ? void 0 : body.condition) === null || _a === void 0 ? void 0 : _a.app_code;
|
|
39
|
-
await this.sysAppService.removeSysAppOneCache(appCode);
|
|
40
42
|
return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
43
|
+
enableSoftDelete: true,
|
|
41
44
|
validateCfg: {
|
|
42
45
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
43
46
|
'condition.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
@@ -45,11 +48,8 @@ let AppMangeApi = class AppMangeApi extends BaseApiController_1.BaseApiControlle
|
|
|
45
48
|
});
|
|
46
49
|
}
|
|
47
50
|
async deleteApp() {
|
|
48
|
-
var _a;
|
|
49
|
-
const body = this.ctx.request.body;
|
|
50
|
-
const appCode = (_a = body === null || body === void 0 ? void 0 : body.condition) === null || _a === void 0 ? void 0 : _a.app_code;
|
|
51
|
-
await this.sysAppService.removeSysAppOneCache(appCode);
|
|
52
51
|
return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
52
|
+
enableSoftDelete: true,
|
|
53
53
|
validateCfg: {
|
|
54
54
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
55
55
|
'condition.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
@@ -61,10 +61,6 @@ __decorate([
|
|
|
61
61
|
(0, core_1.Inject)(),
|
|
62
62
|
__metadata("design:type", Object)
|
|
63
63
|
], AppMangeApi.prototype, "ctx", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, core_1.Inject)(),
|
|
66
|
-
__metadata("design:type", SysAppService_1.SysAppService)
|
|
67
|
-
], AppMangeApi.prototype, "sysAppService", void 0);
|
|
68
64
|
__decorate([
|
|
69
65
|
(0, core_1.Post)('/getAppList'),
|
|
70
66
|
__metadata("design:type", Function),
|
|
@@ -78,19 +74,19 @@ __decorate([
|
|
|
78
74
|
__metadata("design:returntype", Promise)
|
|
79
75
|
], AppMangeApi.prototype, "getAppOne", null);
|
|
80
76
|
__decorate([
|
|
81
|
-
(0, core_1.Post)('/createApp', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AppMangeWrite)] }),
|
|
77
|
+
(0, core_1.Post)('/createApp', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AppMangeWrite), (0, cacherefresh_middleware_1.refreshCache)([bizmodels_1.CacheNameEnum.GetSysAppOne, bizmodels_1.CacheNameEnum.GetSysAppPageOne])] }),
|
|
82
78
|
__metadata("design:type", Function),
|
|
83
79
|
__metadata("design:paramtypes", []),
|
|
84
80
|
__metadata("design:returntype", Promise)
|
|
85
81
|
], AppMangeApi.prototype, "createApp", null);
|
|
86
82
|
__decorate([
|
|
87
|
-
(0, core_1.Post)('/updateApp', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AppMangeWrite)] }),
|
|
83
|
+
(0, core_1.Post)('/updateApp', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AppMangeWrite), (0, cacherefresh_middleware_1.refreshCache)([bizmodels_1.CacheNameEnum.GetSysAppOne, bizmodels_1.CacheNameEnum.GetSysAppPageOne])] }),
|
|
88
84
|
__metadata("design:type", Function),
|
|
89
85
|
__metadata("design:paramtypes", []),
|
|
90
86
|
__metadata("design:returntype", Promise)
|
|
91
87
|
], AppMangeApi.prototype, "updateApp", null);
|
|
92
88
|
__decorate([
|
|
93
|
-
(0, core_1.Post)('/deleteApp', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AppMangeWrite)] }),
|
|
89
|
+
(0, core_1.Post)('/deleteApp', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.AppMangeWrite), (0, cacherefresh_middleware_1.refreshCache)([bizmodels_1.CacheNameEnum.GetSysAppOne, bizmodels_1.CacheNameEnum.GetSysAppPageOne])] }),
|
|
94
90
|
__metadata("design:type", Function),
|
|
95
91
|
__metadata("design:paramtypes", []),
|
|
96
92
|
__metadata("design:returntype", Promise)
|
|
@@ -17,13 +17,18 @@ const permission_middleware_1 = require("../../middleware/permission.middleware"
|
|
|
17
17
|
const SystemPerm_1 = require("../../models/SystemPerm");
|
|
18
18
|
let AppPageMangeApi = class AppPageMangeApi extends BaseApiController_1.BaseApiController {
|
|
19
19
|
async getAppPageList() {
|
|
20
|
-
return this.executeSysSimpleSQL('sys_app_page', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE
|
|
20
|
+
return this.executeSysSimpleSQL('sys_app_page', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE, {
|
|
21
|
+
enableSoftDelete: true,
|
|
22
|
+
});
|
|
21
23
|
}
|
|
22
24
|
async getAppPageOne() {
|
|
23
|
-
return this.executeSysSimpleSQL('sys_app_page', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE
|
|
25
|
+
return this.executeSysSimpleSQL('sys_app_page', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE, {
|
|
26
|
+
enableSoftDelete: true,
|
|
27
|
+
});
|
|
24
28
|
}
|
|
25
29
|
async createAppPage() {
|
|
26
30
|
return this.executeSysSimpleSQL('sys_app_page', keys_1.KeysOfSimpleSQL.SIMPLE_INSERT, {
|
|
31
|
+
enableSoftDelete: true,
|
|
27
32
|
validateCfg: {
|
|
28
33
|
'data.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
29
34
|
'data.app_name': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
@@ -34,6 +39,7 @@ let AppPageMangeApi = class AppPageMangeApi extends BaseApiController_1.BaseApiC
|
|
|
34
39
|
}
|
|
35
40
|
async updateAppPage() {
|
|
36
41
|
return this.executeSysSimpleSQL('sys_app_page', keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
42
|
+
enableSoftDelete: true,
|
|
37
43
|
validateCfg: {
|
|
38
44
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
39
45
|
},
|
|
@@ -41,6 +47,7 @@ let AppPageMangeApi = class AppPageMangeApi extends BaseApiController_1.BaseApiC
|
|
|
41
47
|
}
|
|
42
48
|
async deleteAppPage() {
|
|
43
49
|
return this.executeSysSimpleSQL('sys_app_page', keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
50
|
+
enableSoftDelete: true,
|
|
44
51
|
validateCfg: {
|
|
45
52
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
46
53
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Context } from '@midwayjs/koa';
|
|
2
|
+
import { BaseApiController } from '../base/BaseApiController';
|
|
3
|
+
export declare class ConfigChangelogManageApi extends BaseApiController {
|
|
4
|
+
protected ctx: Context;
|
|
5
|
+
getChangelogList(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
6
|
+
getChangelogOne(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
7
|
+
updateChangelog(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
8
|
+
deleteChangelog(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ConfigChangelogManageApi = void 0;
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
|
+
const keys_1 = require("../../libs/crud-pro/models/keys");
|
|
15
|
+
const BaseApiController_1 = require("../base/BaseApiController");
|
|
16
|
+
const permission_middleware_1 = require("../../middleware/permission.middleware");
|
|
17
|
+
const SystemPerm_1 = require("../../models/SystemPerm");
|
|
18
|
+
const SystemTables_1 = require("../../models/SystemTables");
|
|
19
|
+
let ConfigChangelogManageApi = class ConfigChangelogManageApi extends BaseApiController_1.BaseApiController {
|
|
20
|
+
async getChangelogList() {
|
|
21
|
+
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_config_changelog, keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE, {
|
|
22
|
+
enableSoftDelete: true,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async getChangelogOne() {
|
|
26
|
+
return this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_config_changelog, keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE, {
|
|
27
|
+
enableSoftDelete: true,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async updateChangelog() {
|
|
31
|
+
const result = await this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_config_changelog, keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
32
|
+
enableSoftDelete: true,
|
|
33
|
+
validateCfg: {
|
|
34
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
async deleteChangelog() {
|
|
40
|
+
const result = await this.executeSysSimpleSQL(SystemTables_1.SystemTables.sys_config_changelog, keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
41
|
+
enableSoftDelete: true,
|
|
42
|
+
validateCfg: {
|
|
43
|
+
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, core_1.Inject)(),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], ConfigChangelogManageApi.prototype, "ctx", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, core_1.Post)('/getChangelogList'),
|
|
55
|
+
__metadata("design:type", Function),
|
|
56
|
+
__metadata("design:paramtypes", []),
|
|
57
|
+
__metadata("design:returntype", Promise)
|
|
58
|
+
], ConfigChangelogManageApi.prototype, "getChangelogList", null);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, core_1.Post)('/getChangelogOne'),
|
|
61
|
+
__metadata("design:type", Function),
|
|
62
|
+
__metadata("design:paramtypes", []),
|
|
63
|
+
__metadata("design:returntype", Promise)
|
|
64
|
+
], ConfigChangelogManageApi.prototype, "getChangelogOne", null);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, core_1.Post)('/updateChangelog', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.ConfigChangelogWrite)] }),
|
|
67
|
+
__metadata("design:type", Function),
|
|
68
|
+
__metadata("design:paramtypes", []),
|
|
69
|
+
__metadata("design:returntype", Promise)
|
|
70
|
+
], ConfigChangelogManageApi.prototype, "updateChangelog", null);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, core_1.Post)('/deleteChangelog', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.ConfigChangelogWrite)] }),
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", []),
|
|
75
|
+
__metadata("design:returntype", Promise)
|
|
76
|
+
], ConfigChangelogManageApi.prototype, "deleteChangelog", null);
|
|
77
|
+
ConfigChangelogManageApi = __decorate([
|
|
78
|
+
(0, core_1.Controller)('/ns/api/manage/configChangelog', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.ConfigChangelogRead)] })
|
|
79
|
+
], ConfigChangelogManageApi);
|
|
80
|
+
exports.ConfigChangelogManageApi = ConfigChangelogManageApi;
|
|
@@ -14,16 +14,23 @@ const core_1 = require("@midwayjs/core");
|
|
|
14
14
|
const keys_1 = require("../../libs/crud-pro/models/keys");
|
|
15
15
|
const BaseApiController_1 = require("../base/BaseApiController");
|
|
16
16
|
const permission_middleware_1 = require("../../middleware/permission.middleware");
|
|
17
|
+
const cacherefresh_middleware_1 = require("../../middleware/cacherefresh.middleware");
|
|
18
|
+
const CacheRefreshCategory_1 = require("../../models/CacheRefreshCategory");
|
|
17
19
|
const SystemPerm_1 = require("../../models/SystemPerm");
|
|
18
20
|
let CrudMethodsMangeApi = class CrudMethodsMangeApi extends BaseApiController_1.BaseApiController {
|
|
19
21
|
async getCrudMethodList() {
|
|
20
|
-
return this.executeSysSimpleSQL('sys_crud_methods', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE
|
|
22
|
+
return this.executeSysSimpleSQL('sys_crud_methods', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_PAGE, {
|
|
23
|
+
enableSoftDelete: true,
|
|
24
|
+
});
|
|
21
25
|
}
|
|
22
26
|
async getCrudMethodOne() {
|
|
23
|
-
return this.executeSysSimpleSQL('sys_crud_methods', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE
|
|
27
|
+
return this.executeSysSimpleSQL('sys_crud_methods', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE, {
|
|
28
|
+
enableSoftDelete: true,
|
|
29
|
+
});
|
|
24
30
|
}
|
|
25
31
|
async createCrudMethod() {
|
|
26
32
|
return this.executeSysSimpleSQL('sys_crud_methods', keys_1.KeysOfSimpleSQL.SIMPLE_INSERT, {
|
|
33
|
+
enableSoftDelete: true,
|
|
27
34
|
validateCfg: {
|
|
28
35
|
'data.method': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
|
|
29
36
|
},
|
|
@@ -31,6 +38,7 @@ let CrudMethodsMangeApi = class CrudMethodsMangeApi extends BaseApiController_1.
|
|
|
31
38
|
}
|
|
32
39
|
async updateCrudMethod() {
|
|
33
40
|
return this.executeSysSimpleSQL('sys_crud_methods', keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE, {
|
|
41
|
+
enableSoftDelete: true,
|
|
34
42
|
validateCfg: {
|
|
35
43
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
36
44
|
},
|
|
@@ -38,6 +46,7 @@ let CrudMethodsMangeApi = class CrudMethodsMangeApi extends BaseApiController_1.
|
|
|
38
46
|
}
|
|
39
47
|
async deleteCrudMethod() {
|
|
40
48
|
return this.executeSysSimpleSQL('sys_crud_methods', keys_1.KeysOfSimpleSQL.SIMPLE_DELETE, {
|
|
49
|
+
enableSoftDelete: true,
|
|
41
50
|
validateCfg: {
|
|
42
51
|
'condition.id': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.NUMERIC],
|
|
43
52
|
},
|
|
@@ -61,19 +70,19 @@ __decorate([
|
|
|
61
70
|
__metadata("design:returntype", Promise)
|
|
62
71
|
], CrudMethodsMangeApi.prototype, "getCrudMethodOne", null);
|
|
63
72
|
__decorate([
|
|
64
|
-
(0, core_1.Post)('/createCrudMethod', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.CrudMethodApiWrite)] }),
|
|
73
|
+
(0, core_1.Post)('/createCrudMethod', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.CrudMethodApiWrite), (0, cacherefresh_middleware_1.refreshCategory)(CacheRefreshCategory_1.CacheRefreshCategory.CrudMethodConfig)] }),
|
|
65
74
|
__metadata("design:type", Function),
|
|
66
75
|
__metadata("design:paramtypes", []),
|
|
67
76
|
__metadata("design:returntype", Promise)
|
|
68
77
|
], CrudMethodsMangeApi.prototype, "createCrudMethod", null);
|
|
69
78
|
__decorate([
|
|
70
|
-
(0, core_1.Post)('/updateCrudMethod', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.CrudMethodApiWrite)] }),
|
|
79
|
+
(0, core_1.Post)('/updateCrudMethod', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.CrudMethodApiWrite), (0, cacherefresh_middleware_1.refreshCategory)(CacheRefreshCategory_1.CacheRefreshCategory.CrudMethodConfig)] }),
|
|
71
80
|
__metadata("design:type", Function),
|
|
72
81
|
__metadata("design:paramtypes", []),
|
|
73
82
|
__metadata("design:returntype", Promise)
|
|
74
83
|
], CrudMethodsMangeApi.prototype, "updateCrudMethod", null);
|
|
75
84
|
__decorate([
|
|
76
|
-
(0, core_1.Post)('/deleteCrudMethod', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.CrudMethodApiWrite)] }),
|
|
85
|
+
(0, core_1.Post)('/deleteCrudMethod', { middleware: [(0, permission_middleware_1.checkPermission)(SystemPerm_1.SystemFuncCode.CrudMethodApiWrite), (0, cacherefresh_middleware_1.refreshCategory)(CacheRefreshCategory_1.CacheRefreshCategory.CrudMethodConfig)] }),
|
|
77
86
|
__metadata("design:type", Function),
|
|
78
87
|
__metadata("design:paramtypes", []),
|
|
79
88
|
__metadata("design:returntype", Promise)
|
|
@@ -3,7 +3,6 @@ import { BaseApiController } from '../base/BaseApiController';
|
|
|
3
3
|
import { CommonResult } from "../../libs/utils/common-dto";
|
|
4
4
|
export declare class DataDictManageApi extends BaseApiController {
|
|
5
5
|
protected ctx: Context;
|
|
6
|
-
private sysDictDataService;
|
|
7
6
|
getDataDictList(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
8
7
|
getDataDictOne(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
9
8
|
createDataDict(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
@@ -12,6 +11,6 @@ export declare class DataDictManageApi extends BaseApiController {
|
|
|
12
11
|
getDataDictItemList(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
13
12
|
getDataDictItemOne(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
14
13
|
createDataDictItem(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext | CommonResult>;
|
|
15
|
-
updateDataDictItem(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext
|
|
16
|
-
deleteDataDictItem(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext
|
|
14
|
+
updateDataDictItem(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
15
|
+
deleteDataDictItem(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
|
|
17
16
|
}
|