下发邮件格式修正
This commit is contained in:
@@ -32,7 +32,7 @@ export class ConnectorRemote {
|
|||||||
let sid = pinus.app.getServerId();
|
let sid = pinus.app.getServerId();
|
||||||
if (!!sid) {
|
if (!!sid) {
|
||||||
let uids = [{uid, sid}];
|
let uids = [{uid, sid}];
|
||||||
this.channelService.pushMessageByUids(route, data, uids);
|
this.channelService.pushMessageByUids(route, resResult(STATUS.SUCCESS, {mails:data}), uids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-7
@@ -1,8 +1,10 @@
|
|||||||
import BaseModel from './BaseModel';
|
import BaseModel from './BaseModel';
|
||||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||||
import { RewardInter } from '../pubUtils/interface';
|
|
||||||
import { nowSeconds } from '../pubUtils/timeUtil';
|
import { nowSeconds } from '../pubUtils/timeUtil';
|
||||||
|
class RewardInter {
|
||||||
|
id: number;
|
||||||
|
count: number;
|
||||||
|
}
|
||||||
@index({ roleId: 1 })
|
@index({ roleId: 1 })
|
||||||
|
|
||||||
export default class Mail extends BaseModel {
|
export default class Mail extends BaseModel {
|
||||||
@@ -12,9 +14,9 @@ export default class Mail extends BaseModel {
|
|||||||
@prop({ required: true })
|
@prop({ required: true })
|
||||||
mailId: number;
|
mailId: number;
|
||||||
|
|
||||||
@prop({ required: true })
|
@prop({ required: true, type:RewardInter, default: [], _id: false})
|
||||||
goods: Array<RewardInter>;
|
goods: RewardInter[];
|
||||||
|
|
||||||
@prop({ required: true, default: nowSeconds() })
|
@prop({ required: true, default: nowSeconds() })
|
||||||
sendTime: number;
|
sendTime: number;
|
||||||
|
|
||||||
@@ -28,8 +30,8 @@ export default class Mail extends BaseModel {
|
|||||||
public static async addMail(params:{roleId: string, goods: Array<RewardInter>, sendName: string, mailId: number, sendTime?: number}) {
|
public static async addMail(params:{roleId: string, goods: Array<RewardInter>, sendName: string, mailId: number, sendTime?: number}) {
|
||||||
const doc = new MailModel();
|
const doc = new MailModel();
|
||||||
const mail = Object.assign(doc.toJSON(), params);
|
const mail = Object.assign(doc.toJSON(), params);
|
||||||
const mailInfo: MailType = await MailModel.create(mail);
|
await MailModel.create(mail);
|
||||||
return mailInfo;
|
return mail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user