拍卖行:增加测试接口和用例
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { AUCTION_BID_STATUS } from './../../../consts/constModules/auctionConst';
|
||||
import { AUCTION_BID_STATUS, DIVIDEND_STATUS } from './../../../consts/constModules/auctionConst';
|
||||
import { DividendModel } from './../../../db/Dividend';
|
||||
import { Application, BackendSession, ChannelService } from "pinus";
|
||||
import { AUCTION_STAGE, DEBUG_MAGIC_WORD, STATUS, OFFER_RATIO, CURRENCY_BY_TYPE, CURRENCY_TYPE, DATA_NAME, LOT_STATUS } from "../../../consts";
|
||||
@@ -78,7 +78,7 @@ export class AuctionHandler {
|
||||
const { sid: buyerSid } = await getRoleOnlineInfo(buyerName);
|
||||
await addItems(curBuyer, buyerName, buyerSid, [{ id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.GOLD), count: curPrice }]);
|
||||
}
|
||||
// TODO 元宝返还纪录
|
||||
|
||||
if (maxFlag) {
|
||||
newPrice = maxPrice;
|
||||
await addItems(roleId, roleName, sid, [{ id: gid, count }]);
|
||||
@@ -159,20 +159,30 @@ export class AuctionHandler {
|
||||
}
|
||||
|
||||
// ! 测试接口
|
||||
async debugSetDividendReady(msg: { magicWord: string, sourceType: number}, session: BackendSession) {
|
||||
const { magicWord, sourceType } = msg;
|
||||
async debugSetDividendStatus(msg: { magicWord: string, sourceType: number, status: number }, session: BackendSession) {
|
||||
const { magicWord, sourceType, status } = msg;
|
||||
if (magicWord !== DEBUG_MAGIC_WORD) {
|
||||
return resResult(STATUS.TOKEN_ERR);
|
||||
}
|
||||
|
||||
const guildCode: string = session.get('guildCode');
|
||||
if (!guildCode) return resResult(STATUS.GUILD_NOT_FOUND)
|
||||
const dividend = await DividendModel.updateDividendReady(guildCode, sourceType);
|
||||
const dividend = await DividendModel.updateDividendStatus(guildCode, sourceType, status);
|
||||
return resResult(STATUS.SUCCESS, { dividend });
|
||||
}
|
||||
|
||||
// ! 测试接口
|
||||
async debugAddLots(msg: { magicWord: string, sourceType: number, sourceCode: string, rewards: ItemReward[]}, session: BackendSession) {
|
||||
async debugSetLotStage(msg: { magicWord: string, code: string, auctionStage: number }, session: BackendSession) {
|
||||
const { magicWord, code, auctionStage } = msg;
|
||||
if (magicWord !== DEBUG_MAGIC_WORD) {
|
||||
return resResult(STATUS.TOKEN_ERR);
|
||||
}
|
||||
const lot = await LotModel.updateLotStage(code, auctionStage);
|
||||
return resResult(STATUS.SUCCESS, { lot });
|
||||
}
|
||||
|
||||
// ! 测试接口
|
||||
async debugAddLots(msg: { magicWord: string, sourceType: number, sourceCode: string, rewards: ItemReward[] }, session: BackendSession) {
|
||||
const { magicWord, sourceType, sourceCode, rewards } = msg;
|
||||
if (magicWord !== DEBUG_MAGIC_WORD) {
|
||||
return resResult(STATUS.TOKEN_ERR);
|
||||
|
||||
Reference in New Issue
Block a user