✨ feat(db): 添加 GVGCity 数据库表
This commit is contained in:
34
shared/db/GVGCity.ts
Normal file
34
shared/db/GVGCity.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import BaseModel from "./BaseModel";
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
|
||||
@index({ configId: -1 })
|
||||
// GVGCity 类,继承自 BaseModel
|
||||
export default class GVGCity extends BaseModel {
|
||||
@prop({ required: true, default: 1 })
|
||||
configId: number; // config唯一id
|
||||
|
||||
@prop({ required: true })
|
||||
cityId: number; // 城池id
|
||||
|
||||
@prop({ required: true })
|
||||
leagueCodes: string[]; // 联军
|
||||
|
||||
@prop({ required: false })
|
||||
guardLeague: string; // 占领的联军
|
||||
|
||||
@prop({ required: false })
|
||||
guardLeagueName: string; // 占领的联军
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
userCnt: number; // 城池人数
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
teamCnt: number; // 城池队伍数
|
||||
}
|
||||
|
||||
|
||||
export const GVGCityModel = getModelForClass(GVGCity);
|
||||
|
||||
export interface GVGCityType extends Pick<DocumentType<GVGCity>, keyof GVGCity> {
|
||||
id: number;
|
||||
};
|
||||
Reference in New Issue
Block a user