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