fixwechatmpjump
This commit is contained in:
parent
862a1b0ca4
commit
449789da55
|
|
@ -14,8 +14,25 @@ export async function wechatMpJump(params, context) {
|
|||
dontCollect: true,
|
||||
});
|
||||
assert(application);
|
||||
const { type, config } = application;
|
||||
assert(type === 'wechatMp');
|
||||
const { systemId } = application;
|
||||
const { type } = application;
|
||||
let application2;
|
||||
if (type === 'wechatMp') {
|
||||
application2 = application;
|
||||
}
|
||||
else {
|
||||
[application2] = await context.select('application', {
|
||||
data: cloneDeep(applicationProjection),
|
||||
filter: {
|
||||
systemId,
|
||||
type: 'wechatMp',
|
||||
},
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
}
|
||||
assert(application2);
|
||||
const { config } = application2;
|
||||
const config2 = config;
|
||||
const { appId, appSecret } = config2;
|
||||
const wechatInstance = WechatSDK.getInstance(appId, 'wechatMp', appSecret);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, false, {
|
||||
type: "login" | "bind";
|
||||
type: "bind" | "login";
|
||||
url: string;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ type Jump_wxa = {
|
|||
};
|
||||
export interface Schema extends EntityShape {
|
||||
message?: Message;
|
||||
jump_wxa: Jump_wxa;
|
||||
openlink: String<256>;
|
||||
expireType: Int<1>;
|
||||
jump_wxa?: Jump_wxa;
|
||||
openlink?: String<256>;
|
||||
expireType?: Int<1>;
|
||||
expireInterval?: Int<2>;
|
||||
expiresAt?: Datetime;
|
||||
expired: Boolean;
|
||||
expired?: Boolean;
|
||||
}
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -15,22 +15,22 @@ type Jump_wxa = {
|
|||
};
|
||||
export type OpSchema = EntityShape & {
|
||||
messageId?: ForeignKey<"message"> | null;
|
||||
jump_wxa: Jump_wxa;
|
||||
openlink: String<256>;
|
||||
expireType: Int<1>;
|
||||
jump_wxa?: Jump_wxa | null;
|
||||
openlink?: String<256> | null;
|
||||
expireType?: Int<1> | null;
|
||||
expireInterval?: Int<2> | null;
|
||||
expiresAt?: Datetime | null;
|
||||
expired: Boolean;
|
||||
expired?: Boolean | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
messageId?: ForeignKey<"message"> | null;
|
||||
jump_wxa: Jump_wxa;
|
||||
openlink: String<256>;
|
||||
expireType: Int<1>;
|
||||
jump_wxa?: Jump_wxa | null;
|
||||
openlink?: String<256> | null;
|
||||
expireType?: Int<1> | null;
|
||||
expireInterval?: Int<2> | null;
|
||||
expiresAt?: Datetime | null;
|
||||
expired: Boolean;
|
||||
expired?: Boolean | null;
|
||||
message?: Message.Schema | null;
|
||||
modiEntity$entity?: Array<ModiEntity.Schema>;
|
||||
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
|
||||
|
|
|
|||
|
|
@ -6,18 +6,15 @@ export const desc = {
|
|||
ref: "message"
|
||||
},
|
||||
jump_wxa: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
openlink: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 256
|
||||
}
|
||||
},
|
||||
expireType: {
|
||||
notNull: true,
|
||||
type: "int",
|
||||
params: {
|
||||
width: 1,
|
||||
|
|
@ -35,7 +32,6 @@ export const desc = {
|
|||
type: "datetime"
|
||||
},
|
||||
expired: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
||||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -12,11 +12,19 @@ const triggers = [
|
|||
const { jump_wxa, expiresAt, expireType, expireInterval } = wechatMpJumpData;
|
||||
const applicationId = context.getApplicationId();
|
||||
assert(applicationId);
|
||||
const openlink = await wechatMpJump({ applicationId, jump_wxa: jump_wxa, expiresAt: expiresAt, expireType, expireInterval: expireInterval }, context);
|
||||
const openlink = await wechatMpJump({ applicationId, jump_wxa: jump_wxa, expiresAt: expiresAt, expireType: expireType, expireInterval: expireInterval }, context);
|
||||
Object.assign(wechatMpJumpData, {
|
||||
openlink
|
||||
});
|
||||
};
|
||||
if (data instanceof Array) {
|
||||
for (const ele of data) {
|
||||
await fn(ele);
|
||||
}
|
||||
}
|
||||
else {
|
||||
await fn(data);
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -17,8 +17,25 @@ async function wechatMpJump(params, context) {
|
|||
dontCollect: true,
|
||||
});
|
||||
(0, assert_1.assert)(application);
|
||||
const { type, config } = application;
|
||||
(0, assert_1.assert)(type === 'wechatMp');
|
||||
const { systemId } = application;
|
||||
const { type } = application;
|
||||
let application2;
|
||||
if (type === 'wechatMp') {
|
||||
application2 = application;
|
||||
}
|
||||
else {
|
||||
[application2] = await context.select('application', {
|
||||
data: (0, lodash_1.cloneDeep)(Projection_1.applicationProjection),
|
||||
filter: {
|
||||
systemId,
|
||||
type: 'wechatMp',
|
||||
},
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
}
|
||||
(0, assert_1.assert)(application2);
|
||||
const { config } = application2;
|
||||
const config2 = config;
|
||||
const { appId, appSecret } = config2;
|
||||
const wechatInstance = oak_external_sdk_1.WechatSDK.getInstance(appId, 'wechatMp', appSecret);
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ type Jump_wxa = {
|
|||
};
|
||||
export interface Schema extends EntityShape {
|
||||
message?: Message;
|
||||
jump_wxa: Jump_wxa;
|
||||
openlink: String<256>;
|
||||
expireType: Int<1>;
|
||||
jump_wxa?: Jump_wxa;
|
||||
openlink?: String<256>;
|
||||
expireType?: Int<1>;
|
||||
expireInterval?: Int<2>;
|
||||
expiresAt?: Datetime;
|
||||
expired: Boolean;
|
||||
expired?: Boolean;
|
||||
}
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -15,22 +15,22 @@ type Jump_wxa = {
|
|||
};
|
||||
export type OpSchema = EntityShape & {
|
||||
messageId?: ForeignKey<"message"> | null;
|
||||
jump_wxa: Jump_wxa;
|
||||
openlink: String<256>;
|
||||
expireType: Int<1>;
|
||||
jump_wxa?: Jump_wxa | null;
|
||||
openlink?: String<256> | null;
|
||||
expireType?: Int<1> | null;
|
||||
expireInterval?: Int<2> | null;
|
||||
expiresAt?: Datetime | null;
|
||||
expired: Boolean;
|
||||
expired?: Boolean | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
messageId?: ForeignKey<"message"> | null;
|
||||
jump_wxa: Jump_wxa;
|
||||
openlink: String<256>;
|
||||
expireType: Int<1>;
|
||||
jump_wxa?: Jump_wxa | null;
|
||||
openlink?: String<256> | null;
|
||||
expireType?: Int<1> | null;
|
||||
expireInterval?: Int<2> | null;
|
||||
expiresAt?: Datetime | null;
|
||||
expired: Boolean;
|
||||
expired?: Boolean | null;
|
||||
message?: Message.Schema | null;
|
||||
modiEntity$entity?: Array<ModiEntity.Schema>;
|
||||
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
|
||||
|
|
|
|||
|
|
@ -9,18 +9,15 @@ exports.desc = {
|
|||
ref: "message"
|
||||
},
|
||||
jump_wxa: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
openlink: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 256
|
||||
}
|
||||
},
|
||||
expireType: {
|
||||
notNull: true,
|
||||
type: "int",
|
||||
params: {
|
||||
width: 1,
|
||||
|
|
@ -38,7 +35,6 @@ exports.desc = {
|
|||
type: "datetime"
|
||||
},
|
||||
expired: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
||||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -14,11 +14,19 @@ const triggers = [
|
|||
const { jump_wxa, expiresAt, expireType, expireInterval } = wechatMpJumpData;
|
||||
const applicationId = context.getApplicationId();
|
||||
(0, assert_1.assert)(applicationId);
|
||||
const openlink = await (0, wechatMpJump_1.wechatMpJump)({ applicationId, jump_wxa: jump_wxa, expiresAt: expiresAt, expireType, expireInterval: expireInterval }, context);
|
||||
const { openlink } = await (0, wechatMpJump_1.wechatMpJump)({ applicationId, jump_wxa: jump_wxa, expiresAt: expiresAt, expireType: expireType, expireInterval: expireInterval }, context);
|
||||
Object.assign(wechatMpJumpData, {
|
||||
openlink
|
||||
});
|
||||
};
|
||||
if (data instanceof Array) {
|
||||
for (const ele of data) {
|
||||
await fn(ele);
|
||||
}
|
||||
}
|
||||
else {
|
||||
await fn(data);
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -43,9 +43,28 @@ export async function wechatMpJump<
|
|||
}
|
||||
);
|
||||
assert(application);
|
||||
const { type, config } = application!;
|
||||
assert(type === 'wechatMp');
|
||||
|
||||
const { systemId } = application;
|
||||
const { type } = application!;
|
||||
let application2;
|
||||
if (type === 'wechatMp') {
|
||||
application2 = application;
|
||||
} else {
|
||||
[application2] = await context.select(
|
||||
'application',
|
||||
{
|
||||
data: cloneDeep(applicationProjection),
|
||||
filter: {
|
||||
systemId,
|
||||
type: 'wechatMp',
|
||||
},
|
||||
},
|
||||
{
|
||||
dontCollect: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
assert(application2);
|
||||
const { config } = application2;
|
||||
const config2 = config as WechatMpConfig;
|
||||
const { appId, appSecret } = config2;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ type Jump_wxa = {
|
|||
};
|
||||
export interface Schema extends EntityShape {
|
||||
message?: Message;
|
||||
jump_wxa: Jump_wxa;
|
||||
openlink: String<256>;
|
||||
expireType: Int<1>;//到期失效的 scheme 码失效类型,失效时间:0,失效间隔天数:1 ,默认0
|
||||
jump_wxa?: Jump_wxa;
|
||||
openlink?: String<256>;
|
||||
expireType?: Int<1>;//到期失效的 scheme 码失效类型,失效时间:0,失效间隔天数:1 ,默认0
|
||||
expireInterval?: Int<2>;//expire_type 为 1 时必填,失效的间隔天数
|
||||
expiresAt?: Datetime;//expire_type 为 0 时必填,失效的时间
|
||||
expired: Boolean;
|
||||
expired?: Boolean;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,22 +18,22 @@ type Jump_wxa = {
|
|||
};
|
||||
export type OpSchema = EntityShape & {
|
||||
messageId?: ForeignKey<"message"> | null;
|
||||
jump_wxa: Jump_wxa;
|
||||
openlink: String<256>;
|
||||
expireType: Int<1>;
|
||||
jump_wxa?: Jump_wxa | null;
|
||||
openlink?: String<256> | null;
|
||||
expireType?: Int<1> | null;
|
||||
expireInterval?: Int<2> | null;
|
||||
expiresAt?: Datetime | null;
|
||||
expired: Boolean;
|
||||
expired?: Boolean | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
messageId?: ForeignKey<"message"> | null;
|
||||
jump_wxa: Jump_wxa;
|
||||
openlink: String<256>;
|
||||
expireType: Int<1>;
|
||||
jump_wxa?: Jump_wxa | null;
|
||||
openlink?: String<256> | null;
|
||||
expireType?: Int<1> | null;
|
||||
expireInterval?: Int<2> | null;
|
||||
expiresAt?: Datetime | null;
|
||||
expired: Boolean;
|
||||
expired?: Boolean | null;
|
||||
message?: Message.Schema | null;
|
||||
modiEntity$entity?: Array<ModiEntity.Schema>;
|
||||
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
|
||||
|
|
|
|||
|
|
@ -8,18 +8,15 @@ export const desc: StorageDesc<OpSchema> = {
|
|||
ref: "message"
|
||||
},
|
||||
jump_wxa: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
openlink: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 256
|
||||
}
|
||||
},
|
||||
expireType: {
|
||||
notNull: true,
|
||||
type: "int",
|
||||
params: {
|
||||
width: 1,
|
||||
|
|
@ -37,7 +34,6 @@ export const desc: StorageDesc<OpSchema> = {
|
|||
type: "datetime"
|
||||
},
|
||||
expired: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,11 +22,18 @@ const triggers: Trigger<EntityDict, 'wechatMpJump', BackendRuntimeContext<Entity
|
|||
const { jump_wxa, expiresAt, expireType, expireInterval } = wechatMpJumpData;
|
||||
const applicationId = context.getApplicationId();
|
||||
assert(applicationId);
|
||||
const openlink = await wechatMpJump({ applicationId, jump_wxa: jump_wxa!, expiresAt: expiresAt as number, expireType, expireInterval: expireInterval as number }, context);
|
||||
const openlink = await wechatMpJump({ applicationId, jump_wxa: jump_wxa!, expiresAt: expiresAt as number, expireType: expireType as number, expireInterval: expireInterval as number }, context);
|
||||
Object.assign(wechatMpJumpData, {
|
||||
openlink
|
||||
});
|
||||
};
|
||||
if (data instanceof Array) {
|
||||
for (const ele of data) {
|
||||
await fn(ele);
|
||||
}
|
||||
} else {
|
||||
await fn(data);
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
} as CreateTrigger<EntityDict, 'wechatMpJump', BackendRuntimeContext<EntityDict>>,
|
||||
|
|
|
|||
Loading…
Reference in New Issue