拍卖行:价格修改
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { DividendModel } from './../../../db/Dividend';
|
||||
import { Application, BackendSession, ChannelService, HandlerService, } from "pinus";
|
||||
import { AUCTION_STAGE, DEBUG_MAGIC_WORD, STATUS, OFFER_RATIO, CURRENCY_BY_TYPE, CURRENCY_TYPE, DATA_NAME, LOT_STATUS } from "../../../consts";
|
||||
import { AUCTION_STAGE, DEBUG_MAGIC_WORD, STATUS, CURRENCY_BY_TYPE, CURRENCY_TYPE, DATA_NAME, LOT_STATUS } from "../../../consts";
|
||||
import { LotModel } from "../../../db/Lot";
|
||||
import { ItemReward } from "../../../domain/dbGeneral";
|
||||
import { resResult } from "../../../pubUtils/util";
|
||||
@@ -15,6 +15,8 @@ import { openGuildRefine } from '../../../services/guildRefineService';
|
||||
import { unlockTrain } from '../../../services/guildTrainService';
|
||||
import { UserGuildModel } from '../../../db/UserGuild';
|
||||
import { UserGuildApplyModel } from '../../../db/UserGuildApply';
|
||||
import * as dicParam from '../../../pubUtils/dicParam';
|
||||
import { getAuctionRewardByPoolId } from '../../../pubUtils/data';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -67,7 +69,7 @@ export class AuctionHandler {
|
||||
res.releaseCallback();
|
||||
return resResult(STATUS.LOT_OFFER_SERIAL);
|
||||
}
|
||||
let newPrice = Math.floor(curPrice * OFFER_RATIO);
|
||||
let newPrice = Math.floor(curPrice * dicParam.GUILD_AUCTION.AUCTION_PRICE_RISE);
|
||||
let maxFlag = max;
|
||||
if (newPrice >= maxPrice) {
|
||||
newPrice = maxPrice;
|
||||
@@ -214,8 +216,8 @@ export class AuctionHandler {
|
||||
}
|
||||
|
||||
// ! 测试接口
|
||||
async debugAddLots(msg: { magicWord: string, sourceType: number, sourceCode: string, rewards: ItemReward[] }, session: BackendSession) {
|
||||
const { magicWord, sourceType, sourceCode, rewards } = msg;
|
||||
async debugAddLots(msg: { magicWord: string, sourceType: number, sourceCode: string, poolId: number }, session: BackendSession) {
|
||||
const { magicWord, sourceType, sourceCode, poolId } = msg;
|
||||
if (magicWord !== DEBUG_MAGIC_WORD) {
|
||||
return resResult(STATUS.TOKEN_ERR);
|
||||
}
|
||||
@@ -242,6 +244,8 @@ export class AuctionHandler {
|
||||
await UserGuildApplyModel.deleteApply(roleId); // 删除玩家所有对其他公会的申请
|
||||
}
|
||||
|
||||
let rewards = getAuctionRewardByPoolId(poolId);
|
||||
if(!rewards) return resResult(STATUS.WRONG_PARMS);
|
||||
const result = await genAuction(guildCode, sourceType, sourceCode, serverId, rewards);
|
||||
if (!result) {
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
|
||||
Reference in New Issue
Block a user