midway-fatcms 0.0.1-beta.60 → 0.0.1-beta.61

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.
@@ -24,4 +24,8 @@ export declare class PublicApiController extends BaseApiController {
24
24
  * 获取配置的枚举项信息: 都是无需鉴权的
25
25
  */
26
26
  getEnumInfo(): Promise<CommonResult>;
27
+ /**
28
+ * 获取应用配置信息
29
+ */
30
+ getSysAppInfoByAppCode(): Promise<import("../../libs/crud-pro/models/ExecuteContext").ExecuteContext>;
27
31
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PublicApiController = void 0;
13
13
  const core_1 = require("@midwayjs/core");
14
14
  const _ = require("lodash");
15
+ const keys_1 = require("../../libs/crud-pro/models/keys");
15
16
  const BaseApiController_1 = require("../base/BaseApiController");
16
17
  const SystemTables_1 = require("../../models/SystemTables");
17
18
  const EnumInfoService_1 = require("../../service/EnumInfoService");
@@ -19,7 +20,7 @@ const common_dto_1 = require("../../libs/utils/common-dto");
19
20
  const functions_1 = require("../../libs/utils/functions");
20
21
  const WorkbenchService_1 = require("../../service/WorkbenchService");
21
22
  const SystemPerm_1 = require("../../models/SystemPerm");
22
- const keys_1 = require("../../libs/crud-pro/models/keys");
23
+ const keys_2 = require("../../libs/crud-pro/models/keys");
23
24
  /**
24
25
  * 公开的API,无需鉴权,所有人可以直接访问
25
26
  */
@@ -71,7 +72,7 @@ let PublicApiController = class PublicApiController extends BaseApiController_1.
71
72
  // 特殊的devops菜单
72
73
  map['devops'] = {
73
74
  menu_list: [],
74
- hasPermission: this.ctx.userSession.isAuthPass(keys_1.KeysOfAuthType.byRoleCode, [SystemPerm_1.SystemRoleCode.DevOpsWriter, SystemPerm_1.SystemRoleCode.DevOpsViewer, SystemPerm_1.SystemRoleCode.SuperAdmin]),
75
+ hasPermission: this.ctx.userSession.isAuthPass(keys_2.KeysOfAuthType.byRoleCode, [SystemPerm_1.SystemRoleCode.DevOpsWriter, SystemPerm_1.SystemRoleCode.DevOpsViewer, SystemPerm_1.SystemRoleCode.SuperAdmin]),
75
76
  };
76
77
  return common_dto_1.CommonResult.successRes(map);
77
78
  }
@@ -119,6 +120,16 @@ let PublicApiController = class PublicApiController extends BaseApiController_1.
119
120
  const enumInfos = await this.enumInfoService.queryEnumInfo(codeList, refreshCache);
120
121
  return common_dto_1.CommonResult.successRes(enumInfos);
121
122
  }
123
+ /**
124
+ * 获取应用配置信息
125
+ */
126
+ async getSysAppInfoByAppCode() {
127
+ return this.executeSysSimpleSQL('sys_app', keys_1.KeysOfSimpleSQL.SIMPLE_QUERY_ONE, {
128
+ validateCfg: {
129
+ 'condition.app_code': [keys_1.KeysOfValidators.REQUIRED, keys_1.KeysOfValidators.STRING],
130
+ },
131
+ });
132
+ }
122
133
  };
123
134
  __decorate([
124
135
  (0, core_1.Inject)(),
@@ -156,6 +167,12 @@ __decorate([
156
167
  __metadata("design:paramtypes", []),
157
168
  __metadata("design:returntype", Promise)
158
169
  ], PublicApiController.prototype, "getEnumInfo", null);
170
+ __decorate([
171
+ (0, core_1.Post)('/getSysAppInfoByAppCode'),
172
+ __metadata("design:type", Function),
173
+ __metadata("design:paramtypes", []),
174
+ __metadata("design:returntype", Promise)
175
+ ], PublicApiController.prototype, "getSysAppInfoByAppCode", null);
159
176
  PublicApiController = __decorate([
160
177
  (0, core_1.Controller)('/ns/gw/api/publicApi')
161
178
  ], PublicApiController);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "midway-fatcms",
3
- "version": "0.0.1-beta.60",
3
+ "version": "0.0.1-beta.61",
4
4
  "description": "This is a midway component sample",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -1,6 +1,7 @@
1
1
  import { Controller, Get, Inject, Post } from '@midwayjs/core';
2
2
  import { Context } from '@midwayjs/koa';
3
3
  import * as _ from 'lodash';
4
+ import { KeysOfSimpleSQL, KeysOfValidators } from '@/libs/crud-pro/models/keys';
4
5
  import { BaseApiController } from '../base/BaseApiController';
5
6
  import { SystemTables } from '@/models/SystemTables';
6
7
  import { EnumInfoService } from '@/service/EnumInfoService';
@@ -137,4 +138,20 @@ export class PublicApiController extends BaseApiController {
137
138
  const enumInfos = await this.enumInfoService.queryEnumInfo(codeList, refreshCache);
138
139
  return CommonResult.successRes(enumInfos);
139
140
  }
141
+
142
+
143
+
144
+ /**
145
+ * 获取应用配置信息
146
+ */
147
+ @Post('/getSysAppInfoByAppCode')
148
+ async getSysAppInfoByAppCode() {
149
+ return this.executeSysSimpleSQL('sys_app', KeysOfSimpleSQL.SIMPLE_QUERY_ONE, {
150
+ validateCfg: {
151
+ 'condition.app_code': [KeysOfValidators.REQUIRED, KeysOfValidators.STRING],
152
+ },
153
+ });
154
+ }
155
+
156
+
140
157
  }