后台:邮件审核人

This commit is contained in:
luying
2021-12-01 17:42:36 +08:00
parent fe372de419
commit eafc060093
14 changed files with 103 additions and 307 deletions
@@ -1,7 +1,6 @@
import { Application, ChannelService, HandlerService, } from 'pinus';
import { resResult } from '../../../pubUtils/util';
import { STATUS } from '../../../consts';
import { setGmMails, getGmMailById, getGmMails, getGmUseMails } from '../../../pubUtils/gmData/gmDataUtil';
import { mongoose } from '@typegoose/typegoose';
const { ObjectId } = mongoose.Types;
export default function (app: Application) {
@@ -94,72 +93,4 @@ export class GMRemote {
};
channel.pushMessage('onLeave', resResult(STATUS.SUCCESS, param));
}
public refreshGmMails(mails: [any]) {
setGmMails(mails);
}
/**
* 获得据上次刷新后,可以加入的邮件
* @param updatedMailAt
* @param serverId
*/
public getMailsByTime(updatedMailAt: number, serverId: number) {
let gmMails = getGmMails(updatedMailAt, serverId);
return gmMails;
}
// /**
// * 获得可以领取的邮件奖
// * @param serverId
// * @param groupMailRewards
// * @param mailRewards
// */
// public getUseMails(serverId: number, groupMailRewards: GroupMailType[], mailRewards: MailType[]) {
// let nowTime = nowSeconds();
// let mailGoods = [];
// let mails = [];
// let mailIds = [];
// let groupMailIds = [];
// groupMailRewards.map(({_id, goods, mailId, mailTemType})=>{
// if (mailTemType == MAIL_TEM_TYPE.GMTYPE) {//gm邮件检查是否有奖励以及是否可以领取
// let gmMail = getGmMailById(mailId, serverId, nowTime);
// if (!gmMail || !gmMail.goods.length|| gmMail.endTime < nowSeconds()) {
// return;
// }
// mailGoods.push(...gmMail.goods);
// } else {
// if (!goods.length)//系统邮件,检查是否有奖励
// return;
// mailGoods.push(...goods);
// }
// mails.push({id: _id, status: MAIL_STATUS.RECEIVED, mailType: MAIL_TYPE.GROUPMAIL});
// groupMailIds.push(_id);
// });
// mailRewards.map(({_id, goods, mailId, mailTemType})=>{
// if (mailTemType == MAIL_TEM_TYPE.GMTYPE) {//gm邮件检查是否有奖励以及是否可以领取
// let gmMail = getGmMailById(mailId, serverId, nowTime);
// if (!gmMail || !gmMail.goods.length|| gmMail.endTime < nowSeconds()) {
// return;
// }
// mailGoods.push(...gmMail.goods);
// } else {
// if (!goods.length)//系统邮件,检查是否有奖励
// return;
// mailGoods.push(...goods);
// }
// mails.push({id: _id, status: MAIL_STATUS.RECEIVED, mailType: MAIL_TYPE.SINGLEMAIL});
// mailIds.push(_id);
// });
// return {mailIds, groupMailIds, mails, mailGoods};
// }
/**
* 通过模板mailId获得gm邮件
* @param mailId
* @param serverId
* @param nowTime
*/
public getUseGmMailById(mailId: string, serverId: number, nowTime: number) {
let gmMail = getGmMailById(mailId, serverId, nowTime);
return gmMail;
}
}