拍卖行:增加测试接口和用例
This commit is contained in:
@@ -67,7 +67,7 @@ export default class Dividend extends BaseModel {
|
||||
}
|
||||
|
||||
public static async findReadyDividend(guildCode: string, sourceType: number) {
|
||||
const result: DividendType = await DividendModel.findOne({ guildCode, sourceType, status: DIVIDEND_STATUS.END }).select('-_id -__v').lean();
|
||||
const result: DividendType = await DividendModel.findOne({ guildCode, sourceType, status: DIVIDEND_STATUS.ING }).select('-_id -__v').lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -76,8 +76,8 @@ export default class Dividend extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async updateDividendReady(guildCode: string, sourceType: number) {
|
||||
const result: DividendType = await DividendModel.findOneAndUpdate({ guildCode, sourceType }, { status: DIVIDEND_STATUS.END }, { new: true }).select('-_id -__v').lean();
|
||||
public static async updateDividendStatus(guildCode: string, sourceType: number, status: number) {
|
||||
const result: DividendType = await DividendModel.findOneAndUpdate({ guildCode, sourceType }, { status }, { new: true }).select('-_id -__v').lean();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +102,11 @@ export default class Lot extends BaseModel {
|
||||
const results: LotType[] = await LotModel.find({ serverId, 'bidRoles.roleId': roleId }).select('-_id -__v').limit(count).lean();
|
||||
return results;
|
||||
}
|
||||
|
||||
public static async updateLotStage(code: string, auctionStage: number) {
|
||||
const result: LotType = await LotModel.findOneAndUpdate({ code }, { auctionStage }).select('-_id -__v').lean();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
export const LotModel = getModelForClass(Lot);
|
||||
|
||||
Reference in New Issue
Block a user