提交 40866b3e 编写于 作者: O o2sword

collect信息更新同时更新当前运行环境

上级 7cac4d11
...@@ -50,7 +50,7 @@ class ActionRegist extends BaseAction { ...@@ -50,7 +50,7 @@ class ActionRegist extends BaseAction {
Config.collect().setName(name); Config.collect().setName(name);
Config.collect().setPassword(password); Config.collect().setPassword(password);
Config.collect().save(); Config.collect().save();
Config.flush(); this.configFlush(effectivePerson);
/* 人员和应用市场同步 */ /* 人员和应用市场同步 */
ThisApplication.context().scheduleLocal(CollectPerson.class); ThisApplication.context().scheduleLocal(CollectPerson.class);
ThisApplication.context().scheduleLocal(CollectMarket.class); ThisApplication.context().scheduleLocal(CollectMarket.class);
......
package com.x.program.center.jaxrs.collect; package com.x.program.center.jaxrs.collect;
import com.x.program.center.ThisApplication;
import com.x.program.center.schedule.CollectMarket;
import com.x.program.center.schedule.CollectPerson;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -42,7 +45,7 @@ class ActionResetPassword extends BaseAction { ...@@ -42,7 +45,7 @@ class ActionResetPassword extends BaseAction {
if (BooleanUtils.isTrue(wo.getValue())) { if (BooleanUtils.isTrue(wo.getValue())) {
Config.collect().setPassword(password); Config.collect().setPassword(password);
Config.collect().save(); Config.collect().save();
Config.flush(); this.configFlush(effectivePerson);
} }
result.setData(wo); result.setData(wo);
return result; return result;
......
...@@ -32,7 +32,7 @@ class ActionUpdate extends BaseAction { ...@@ -32,7 +32,7 @@ class ActionUpdate extends BaseAction {
Config.collect().setName(wrapIn.getName()); Config.collect().setName(wrapIn.getName());
Config.collect().setPassword(wrapIn.getPassword()); Config.collect().setPassword(wrapIn.getPassword());
Config.collect().save(); Config.collect().save();
Config.flush(); this.configFlush(effectivePerson);
Wo wo = new Wo(); Wo wo = new Wo();
wo.setValue(true); wo.setValue(true);
result.setData(wo); result.setData(wo);
......
...@@ -48,7 +48,7 @@ class ActionUpdateUnit extends BaseAction { ...@@ -48,7 +48,7 @@ class ActionUpdateUnit extends BaseAction {
Config.collect().setKey(wi.getKey()); Config.collect().setKey(wi.getKey());
Config.collect().setSecret(wi.getSecret()); Config.collect().setSecret(wi.getSecret());
Config.collect().save(); Config.collect().save();
Config.flush(); this.configFlush(effectivePerson);
} }
result.setData(wo); result.setData(wo);
return result; return result;
......
...@@ -11,12 +11,15 @@ import com.x.base.core.project.bean.WrapCopierFactory; ...@@ -11,12 +11,15 @@ import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.config.Collect; import com.x.base.core.project.config.Collect;
import com.x.base.core.project.config.Config; import com.x.base.core.project.config.Config;
import com.x.base.core.project.connection.ActionResponse; import com.x.base.core.project.connection.ActionResponse;
import com.x.base.core.project.connection.CipherConnectionAction;
import com.x.base.core.project.connection.ConnectionAction; import com.x.base.core.project.connection.ConnectionAction;
import com.x.base.core.project.gson.XGsonBuilder; import com.x.base.core.project.gson.XGsonBuilder;
import com.x.base.core.project.http.ActionResult.Type; import com.x.base.core.project.http.ActionResult.Type;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.StandardJaxrsAction; import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import com.x.base.core.project.jaxrs.WrapBoolean; import com.x.base.core.project.jaxrs.WrapBoolean;
import com.x.base.core.project.tools.DefaultCharset; import com.x.base.core.project.tools.DefaultCharset;
import com.x.program.center.ThisApplication;
class BaseAction extends StandardJaxrsAction { class BaseAction extends StandardJaxrsAction {
...@@ -124,6 +127,19 @@ class BaseAction extends StandardJaxrsAction { ...@@ -124,6 +127,19 @@ class BaseAction extends StandardJaxrsAction {
return resp.getData(ReturnWoBoolean.class).getValue(); return resp.getData(ReturnWoBoolean.class).getValue();
} }
public void configFlush(EffectivePerson effectivePerson) throws Exception {
Config.flush();
ThisApplication.context().applications().values().forEach(o -> {
o.stream().forEach(app -> {
try {
CipherConnectionAction.get(effectivePerson.getDebugger(), app, "cache", "config", "flush");
} catch (Exception e) {
e.printStackTrace();
}
});
});
}
private static class ReturnWoBoolean extends WrapBoolean { private static class ReturnWoBoolean extends WrapBoolean {
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册