活动:寻宝骑兵活动接口

This commit is contained in:
qiaoxin
2021-05-25 21:38:23 +08:00
parent bd78b30cee
commit ebeb22f630
9 changed files with 538 additions and 6 deletions
+26
View File
@@ -0,0 +1,26 @@
import ActivityShop from './ActivityShop';
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
/**
* 活动系统 - 寻宝猎人-商店
*/
@index({ roleId: 1 })
export default class Activity_Treasure_Hunt_Shop extends ActivityShop {
@prop({ required: true })
dayIndex: number; // 第几天
//根据活动id查询活动数据
public static async findTreasureData(serverId: number, activityId: number, roleId: string, roundIndex: number, dayIndex: number) {
let result: ActivityTreasureHuntShopModelType = await ActivityTreasureHuntShopModel.findOne({ roleId, activityId, roundIndex, dayIndex }).lean(true);
return result;
}
}
export const ActivityTreasureHuntShopModel = getModelForClass(Activity_Treasure_Hunt_Shop);
export interface ActivityTreasureHuntShopModelType extends Pick<DocumentType<Activity_Treasure_Hunt_Shop>, keyof Activity_Treasure_Hunt_Shop> { }
export type ActivityTreasureHuntShopModelTypeParam = Partial<ActivityTreasureHuntShopModelType>; // 将所有字段变成可选项