后台:获取邮件记录
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
import { Service } from 'egg';
|
||||
import { GMMailModel } from '@db/GMMail';
|
||||
import { STATUS } from '@consts';
|
||||
import { GMMailRecordModel } from '@db/GMMailRecord';
|
||||
import { RewardInter } from '@pubUtils/interface';
|
||||
|
||||
export default class Mail extends Service {
|
||||
|
||||
@@ -14,13 +16,21 @@ export default class Mail extends Service {
|
||||
});
|
||||
}
|
||||
|
||||
public async updateGMMail(_id: string, content: string, sendName: string, useTempTime: boolean, sendTime: number, endTime: number, continueHour: number) {
|
||||
public async updateGMMail(_id: string, content: string, sendName: string, useTempTime: boolean, sendTime: number, endTime: number, continueHour: number, goods: RewardInter[]) {
|
||||
const { ctx } = this;
|
||||
if(_id == 'new') {
|
||||
await GMMailModel.addMail({ content, sendName, useTempTime, sendTime, endTime, continueHour });
|
||||
await GMMailModel.addMail({ content, sendName, useTempTime, sendTime, endTime, continueHour, goods });
|
||||
} else {
|
||||
await GMMailModel.updateMailById(_id, { content, sendName, useTempTime, sendTime, endTime, continueHour });
|
||||
await GMMailModel.updateMailById(_id, { content, sendName, useTempTime, sendTime, endTime, continueHour, goods });
|
||||
}
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
public async getGMMailRecords(page: number, pageSize: number, sortField: string, sortOrder: string, form: {}) {
|
||||
const { ctx } = this;
|
||||
const list = await GMMailRecordModel.findByCondition(page, pageSize, sortField, sortOrder, form);
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS, {
|
||||
list
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user