修改一些字段
This commit is contained in:
@@ -63,9 +63,9 @@ export class GuildHandler {
|
||||
name: "name",
|
||||
icon: 1,
|
||||
lv: 0,
|
||||
peopleNum: 0,
|
||||
memberCnt: 0,
|
||||
leader: "leader",
|
||||
ceCondition: 0,
|
||||
ceLimit: 0,
|
||||
quitTime: 0,
|
||||
hasApply: true
|
||||
}];
|
||||
|
||||
@@ -71,11 +71,11 @@ describe('军团测试', function() {
|
||||
expect(res.data).to.have.deep.property('rank').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('lv').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('fund').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('peopleNum').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('manageNum').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('memberCnt').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('managerCnt').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('activeDaily').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('activeWeekly').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('ceCondition').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('ceLimit').that.is.an('number');
|
||||
expect(res.data).to.have.deep.property('isAuto').that.is.an('boolean');
|
||||
|
||||
expect(res.data).to.have.deep.property('leader').that.is.an('object');
|
||||
@@ -116,7 +116,7 @@ describe('军团测试', function() {
|
||||
expect(list).to.have.deep.property('lv').that.is.a('number');
|
||||
expect(list).to.have.deep.property('peopleNum').that.is.a('number');
|
||||
expect(list).to.have.deep.property('leader').that.is.a('string');
|
||||
expect(list).to.have.deep.property('ceCondition').that.is.a('number');
|
||||
expect(list).to.have.deep.property('ceLimit').that.is.a('number');
|
||||
expect(list).to.have.deep.property('quitTime').that.is.a('number');
|
||||
expect(list).to.have.deep.property('hasApply').that.is.a('boolean');
|
||||
});
|
||||
|
||||
@@ -26,8 +26,11 @@ export default class Guild extends BaseModel {
|
||||
@prop({ required: true, default: 1 })
|
||||
lv: number;
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
peopleNum: number;
|
||||
@prop({ required: true, default: 1 })
|
||||
memberCnt: number;
|
||||
|
||||
@prop({ required: true, default: 1 })
|
||||
managerCnt: number;
|
||||
|
||||
@prop({ required: true })
|
||||
leader: Ref<Role>;
|
||||
@@ -36,7 +39,7 @@ export default class Guild extends BaseModel {
|
||||
isAuto: boolean;
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
ceCondition: number;
|
||||
ceLimit: number;
|
||||
|
||||
@prop({ required: true, default: '' })
|
||||
notice: string;
|
||||
@@ -74,7 +77,7 @@ export default class Guild extends BaseModel {
|
||||
delete update._id;
|
||||
const code = genCode(6);
|
||||
const result: GuildType = await GuildModel.findOneAndUpdate({ code }, update, { upsert: true, new: true })
|
||||
.select('code name icon notice introduce lv fund peopleNum manageNum activeDaily activeWeekly ceCondition isAuto leader structure')
|
||||
.select('code name icon notice introduce lv fund memberCnt managerCnt activeDaily activeWeekly ceLimit isAuto leader structure')
|
||||
.populate('leader', 'name sHid headHid lv updatedAt', 'Role')
|
||||
.lean();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user