25 lines
1018 B
TypeScript
25 lines
1018 B
TypeScript
import { readFileAndParse } from '../util'
|
||
import { FILENAME } from '../../consts'
|
||
|
||
export interface DicPushMessage {
|
||
id: number;
|
||
pushMsgType: string; // 推送类型标签,PUSH_MSG_TYPE
|
||
title: string; // 推送标题,30字以内
|
||
description: string; // 推送正文,100字以内,其他同上
|
||
playerType: number; // 推送玩家的类型,PLAYER_TYPE
|
||
clickType: string; // 点击通知之后的后续动作
|
||
url: string; // 玩家点击通知之后,如果clickType选了url填写网址,长度<=1024
|
||
intent: string; // 玩家点击通知之后,如果clickType选了intent填写应用特定页面,需要找客户端定制,长度<=1024
|
||
}
|
||
|
||
export const dicPushMessage = new Map<string, DicPushMessage>();
|
||
export function loadPushMessage() {
|
||
dicPushMessage.clear();
|
||
let arr = readFileAndParse(FILENAME.DIC_PUSH_MESSAGE);
|
||
|
||
arr.forEach(o => {
|
||
dicPushMessage.set(o.pushMsgType, o);
|
||
});
|
||
arr = undefined;
|
||
}
|