修复windows下路径的问题,添加设置项,完善翻译

This commit is contained in:
undefined committed 2020-07-16 12:27:29 +08:00
1 parent 5980080302
commit 6ad41dc2ae
29 files changed
+368 -278

No files matched your search

+8 -5
View File
@@ -5,14 +5,17 @@ import * as db from '../service/db';
const coll = db.collection('message');
export const FLAG_UNREAD = 1;
export const FLAG_NOTIFICATION = 2;
export const FLAG_ALERT = 2;
export async function send(from: number, to: number, content: string, flag: number): Promise<Mdoc> {
export async function send(
from: number, to: number,
content: string, flag: number = FLAG_UNREAD,
): Promise<Mdoc> {
const res = await coll.insertOne({
from, to, content, flag: FLAG_UNREAD | flag,
from, to, content, flag,
});
return {
from, to, content, _id: res.insertedId, flag: FLAG_UNREAD | flag,
from, to, content, _id: res.insertedId, flag,
};
}
@@ -60,7 +63,7 @@ export function ensureIndexes() {
global.Hydro.model.message = {
FLAG_UNREAD,
FLAG_NOTIFICATION,
FLAG_ALERT,
count,
get,