拍卖行:添加接口返回和测试框架,调整个别字段

This commit is contained in:
liangtongchuan
2021-03-17 14:52:15 +08:00
parent 023f7de8b9
commit 0dc4f18d2d
5 changed files with 140 additions and 10 deletions
+3 -2
View File
@@ -13,13 +13,14 @@ import { LotModel, LotParam } from '../db/Lot';
* @param {ItemReward[]} rewards
*/
export async function genAuction(guildCode: string, sourceType: number, sourceCode: string, serverId: number, rewards: ItemReward[]) {
const curTime = new Date();
const lots: LotParam[] = rewards.map(reward => {
const { id, count } = reward;
const code = genCode(LOT_CODE_LEN);
return {
auctionStage: AUCTION_STAGE.DEFAULT, sourceType,
sourceCode, serverId, guildCode, code, gid: id, count
// maxPrice, begin, end
sourceCode, serverId, guildCode, code, gid: id, count,
maxPrice: 100, begin: curTime, end: curTime, curPrice: 10, // ! 此行为临时数据
}
});
const result = await LotModel.createRecs(lots);