system中的platform改成非必填

This commit is contained in:
Xu Chang 2023-08-01 15:54:21 +08:00
parent 6853ec4fc2
commit 6fe0cb22fc
7 changed files with 10 additions and 11 deletions

View File

@ -7,7 +7,7 @@ export interface Schema extends EntityShape {
name: String<32>;
description: Text;
config: Config;
platform: Platform;
platform?: Platform;
folder: String<16>;
super?: Boolean;
style?: Style;

View File

@ -14,7 +14,7 @@ export declare type OpSchema = EntityShape & {
name: String<32>;
description: Text;
config: Config;
platformId: ForeignKey<"platform">;
platformId?: ForeignKey<"platform"> | null;
folder: String<16>;
super?: Boolean | null;
style?: Style | null;
@ -26,13 +26,13 @@ export declare type Schema = EntityShape & {
name: String<32>;
description: Text;
config: Config;
platformId: ForeignKey<"platform">;
platformId?: ForeignKey<"platform"> | null;
folder: String<16>;
super?: Boolean | null;
style?: Style | null;
entity?: String<32> | null;
entityId?: String<64> | null;
platform: Platform.Schema;
platform?: Platform.Schema | null;
application$system?: Array<Application.Schema>;
application$system$$aggr?: AggregationResult<Application.Schema>;
domain$system?: Array<Domain.Schema>;
@ -154,12 +154,12 @@ export declare type Selection<P extends Object = Projection> = SelectOperation<P
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "platformId">> & (({
platformId?: never;
platform: Platform.CreateSingleOperation;
platform?: Platform.CreateSingleOperation;
} | {
platformId: String<64>;
platform?: Platform.UpdateOperation;
} | {
platformId: String<64>;
platformId?: String<64>;
})) & ({
entity?: string;
entityId?: string;

View File

@ -20,7 +20,6 @@ exports.desc = {
type: "object"
},
platformId: {
notNull: true,
type: "ref",
ref: "platform"
},

View File

@ -33,7 +33,7 @@ function getConfig(context, service, origin) {
_b = system, systemConfig = _b.config, platform = _b.platform;
originConfig = systemConfig[service] && systemConfig[service][origin];
originCloudAccounts = originConfig && systemConfig.Account && systemConfig.Account[origin];
if (!originConfig) {
if (!originConfig && platform) {
platformConfig = platform.config;
originConfig =
platformConfig[service] && platformConfig[service][origin];

View File

@ -17,7 +17,7 @@ function sendSms(options, context) {
application = context.getApplication();
system = application.system;
_f = system, platform = _f.platform, systemConfig = _f.config;
platformConfig = platform.config;
platformConfig = (platform || {}).config;
accountConfigs = ((_a = systemConfig === null || systemConfig === void 0 ? void 0 : systemConfig.Account) === null || _a === void 0 ? void 0 : _a[origin]) || ((_b = platformConfig === null || platformConfig === void 0 ? void 0 : platformConfig.Account) === null || _b === void 0 ? void 0 : _b[origin]);
smsConfigs = ((_c = systemConfig === null || systemConfig === void 0 ? void 0 : systemConfig.Sms) === null || _c === void 0 ? void 0 : _c[origin]) || ((_d = platformConfig === null || platformConfig === void 0 ? void 0 : platformConfig.Sms) === null || _d === void 0 ? void 0 : _d[origin]);
if (!accountConfigs ||

View File

@ -46,7 +46,7 @@ export async function getConfig<
let originCloudAccounts =
originConfig && systemConfig.Account && systemConfig.Account[origin];
if (!originConfig) {
if (!originConfig && platform) {
const { config: platformConfig } = platform;
originConfig =
platformConfig[service] && (platformConfig[service] as any)[origin];

View File

@ -33,7 +33,7 @@ export async function sendSms<
const { system } = application!;
const { platform, config: systemConfig } = system!;
const { config: platformConfig } = platform;
const { config: platformConfig } = platform || {};
const accountConfigs =
systemConfig?.Account?.[origin] || platformConfig?.Account?.[origin];
const smsConfigs =