use of com.orion.ops.service.api.SystemEnvService in project orion-ops by lijiahangmax.
the class SystemEnvServiceImpl method saveEnv.
@Override
@Transactional(rollbackFor = Exception.class)
public void saveEnv(Map<String, String> env) {
SystemEnvService self = SpringHolder.getBean(SystemEnvService.class);
// 倒排
List<Map.Entry<String, String>> entries = Lists.newList(env.entrySet());
int size = entries.size();
for (int i = size - 1; i >= 0; i--) {
// 更新
Map.Entry<String, String> entry = entries.get(i);
SystemEnvRequest request = new SystemEnvRequest();
request.setKey(entry.getKey());
request.setValue(entry.getValue());
self.addEnv(request);
}
// 设置日志参数
EventParamsHolder.addParam(EventKeys.COUNT, size);
}
Aggregations