聊天:部分配置读表
This commit is contained in:
21
shared/pubUtils/dictionary/DicChatSystem.ts
Normal file
21
shared/pubUtils/dictionary/DicChatSystem.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// 聊天模板表
|
||||
import { readJsonFile } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicChatSystem {
|
||||
|
||||
// 模板 id
|
||||
readonly id: number;
|
||||
// 模板名称
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_CHAT_SYSTEM);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicChatSystem = new Map<number, DicChatSystem>();
|
||||
|
||||
arr.forEach(o => {
|
||||
dicChatSystem.set(o.id, o);
|
||||
});
|
||||
arr = undefined;
|
||||
Reference in New Issue
Block a user