拍卖行:添加接口返回和测试框架,调整个别字段
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user