红点:修改推送方式
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { MailModel, MailType } from './../db/Mail';
|
||||
import { DividendModel } from './../db/Dividend';
|
||||
import { LOT_CODE_LEN, AUCTION_STAGE, AUCTION_TIME, DIVIDEND_CODE_LEN, DIVIDEND_STATUS, LOT_STATUS, MAIL_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, STATUS, DIVIDENDWEEKENDRATE, DIVIDENDMAXRATIO, DIVIDENDPOSITIONMAXRATIO, ROLE_RECEIVE_STATUS, AUCTION_BID_STATUS } from './../consts';
|
||||
import { LOT_CODE_LEN, AUCTION_STAGE, AUCTION_TIME, DIVIDEND_CODE_LEN, DIVIDEND_STATUS, LOT_STATUS, MAIL_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, STATUS, DIVIDENDWEEKENDRATE, DIVIDENDMAXRATIO, DIVIDENDPOSITIONMAXRATIO, ROLE_RECEIVE_STATUS, AUCTION_BID_STATUS, DEBUG_MAGIC_WORD } from './../consts';
|
||||
import { DividendRec, ItemReward } from "../domain/dbGeneral";
|
||||
import { genCode, resResult } from '../pubUtils/util';
|
||||
import { LotModel, LotParam } from '../db/Lot';
|
||||
@@ -9,7 +9,7 @@ import { gameData, getGoodById } from '../pubUtils/data';
|
||||
import { DividendParam, DividendType } from '../db/Dividend';
|
||||
import { pushMail } from '../pubUtils/interface';
|
||||
import { getMailContent } from './mailService';
|
||||
import { pinus, BackendSession } from 'pinus';
|
||||
import { pinus, BackendSession, FrontendOrBackendSession } from 'pinus';
|
||||
import { participants } from './guildActivityService';
|
||||
import { Member } from '../domain/battleField/guildActivity';
|
||||
|
||||
@@ -33,13 +33,13 @@ export function auctionStage() {
|
||||
if (curTime > todayWorldEnd().getTime()) return AUCTION_STAGE.END;
|
||||
}
|
||||
|
||||
export async function debugAuctionLots(session: BackendSession, begin: Date) {
|
||||
export async function debugAuctionLots(session: FrontendOrBackendSession, begin: Date) {
|
||||
const serverId = session.get('serverId');
|
||||
const lots = await LotModel.findWorldLotsByBegin(serverId, begin);
|
||||
return lots;
|
||||
}
|
||||
|
||||
export async function officialAuctionLots(session: BackendSession, begin: Date) {
|
||||
export async function officialAuctionLots(session: FrontendOrBackendSession, begin: Date) {
|
||||
const serverId = session.get('serverId');
|
||||
const guildCode = session.get('guildCode');
|
||||
const stage = auctionStage();
|
||||
@@ -278,3 +278,17 @@ export async function sendUngotDividend(debug = false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取拍卖行数据
|
||||
* @param guildCode
|
||||
* @param session
|
||||
* @param magicWord
|
||||
*/
|
||||
export async function getAuction(guildCode: string, session: FrontendOrBackendSession, magicWord?: string) {
|
||||
const begin = todayGuildBegin();
|
||||
let lots = magicWord === DEBUG_MAGIC_WORD ? await debugAuctionLots(session, begin) : await officialAuctionLots(session, begin);
|
||||
|
||||
const dividends = await DividendModel.findGuildDividendsByBegin(guildCode, begin);
|
||||
return { lots, dividends };
|
||||
}
|
||||
Reference in New Issue
Block a user