社稷大典 初始化提交

back_recharge
zhangshanxue 2020-10-25 18:24:34 +08:00
parent df0850d74b
commit f1d7511218
1 changed files with 12 additions and 5 deletions

View File

@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.dao.root;
import com.ljsd.GameApplication;
import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.logic.GlobleSystemLogic;
import com.ljsd.jieling.logic.dao.Question;
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
import org.springframework.data.annotation.Transient;
@ -20,16 +21,13 @@ public class GlobalSystemControl {
private Map<String, Question> questionMap = new ConcurrentHashMap<>();
private int questId;//本服开启的问卷id
private HashMap<Integer,Integer> activityOpenValue= new HashMap<>();
@Transient
private boolean dirty = false;
public static GlobalSystemControl getGlobalSystemControl() throws Exception {
GlobalSystemControl globalSystemControl = MongoUtil.getInstence().getMyMongoTemplate().findById(GameApplication.serverId, GlobalSystemControl.class);
if (globalSystemControl == null) {
globalSystemControl = new GlobalSystemControl(GameApplication.serverId);
}
return globalSystemControl;
return GlobleSystemLogic.getInstence().getGlobalSystemControl();
}
public GlobalSystemControl(int id) {
@ -54,6 +52,15 @@ public class GlobalSystemControl {
this.questId = questId;
}
public HashMap<Integer, Integer> getActivityOpenValue() {
this.dirty = true;
return activityOpenValue;
}
public void setActivityOpenValue(HashMap<Integer, Integer> activityOpenValue) {
this.activityOpenValue = activityOpenValue;
}
public Question getQuestionMap(String key) {
return questionMap.get(key);
}