拍卖行:调整接口以便测试
This commit is contained in:
@@ -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 } from 'pinus';
|
||||
import { pinus, BackendSession } from 'pinus';
|
||||
import { participants } from './guildActivityService';
|
||||
import { Member } from '../domain/battleField/guildActivity';
|
||||
|
||||
@@ -33,6 +33,25 @@ export function auctionStage() {
|
||||
if (curTime > todayWorldEnd().getTime()) return AUCTION_STAGE.END;
|
||||
}
|
||||
|
||||
export async function debugAuctionLots(session: BackendSession, begin: Date) {
|
||||
const serverId = session.get('serverId');
|
||||
const lots = await LotModel.findWorldLotsByBegin(serverId, begin);
|
||||
return lots;
|
||||
}
|
||||
|
||||
export async function officialAuctionLots(session: BackendSession, begin: Date) {
|
||||
const serverId = session.get('serverId');
|
||||
const guildCode = session.get('guildCode');
|
||||
const stage = auctionStage();
|
||||
let lots = [];
|
||||
if (stage === AUCTION_STAGE.DEFAULT || stage === AUCTION_STAGE.GUILD) {
|
||||
lots = await LotModel.findGuildLotsByBegin(guildCode, begin);
|
||||
} else if (stage === AUCTION_STAGE.WORLD) {
|
||||
lots = await LotModel.findWorldLotsByBegin(serverId, begin);
|
||||
}
|
||||
return lots;
|
||||
}
|
||||
|
||||
export function auctionBegin() {
|
||||
return getNextTime(new Date(), AUCTION_TIME.GUILD_BEGIN_HOUR, AUCTION_TIME.GUILD_BEGIN_MIN);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user