use of com.orion.ops.consts.env.EnvViewType in project orion-ops by lijiahangmax.
the class ApplicationEnvController method view.
/**
* 视图
*/
@RequestMapping("/view")
public String view(@RequestBody ApplicationEnvRequest request) {
Valid.notNull(request.getAppId());
Valid.notNull(request.getProfileId());
EnvViewType viewType = Valid.notNull(EnvViewType.of(request.getViewType()));
request.setLimit(Const.N_100000);
// 查询列表
Map<String, String> env = Maps.newLinkedMap();
applicationEnvService.listAppEnv(request).forEach(e -> env.put(e.getKey(), e.getValue()));
return viewType.toValue(env);
}
use of com.orion.ops.consts.env.EnvViewType in project orion-ops by lijiahangmax.
the class SystemEnvController method viewSave.
/**
* 视图保存
*/
@RequestMapping("/view-save")
@EventLog(EventType.SAVE_SYSTEM_ENV)
public Integer viewSave(@RequestBody SystemEnvRequest request) {
String value = Valid.notBlank(request.getValue());
EnvViewType viewType = Valid.notNull(EnvViewType.of(request.getViewType()));
try {
MutableLinkedHashMap<String, String> result = viewType.toMap(value);
systemEnvService.saveEnv(result);
return result.size();
} catch (Exception e) {
throw Exceptions.argument(MessageConst.PARSE_ERROR, e);
}
}
use of com.orion.ops.consts.env.EnvViewType in project orion-ops by lijiahangmax.
the class MachineEnvController method view.
/**
* 视图
*/
@RequestMapping("/view")
public String view(@RequestBody MachineEnvRequest request) {
Valid.notNull(request.getMachineId());
EnvViewType viewType = Valid.notNull(EnvViewType.of(request.getViewType()));
request.setLimit(Const.N_100000);
// 查询列表
Map<String, String> env = Maps.newLinkedMap();
machineEnvService.listEnv(request).forEach(e -> env.put(e.getKey(), e.getValue()));
return viewType.toValue(env);
}
use of com.orion.ops.consts.env.EnvViewType in project orion-ops by lijiahangmax.
the class MachineEnvController method viewSave.
/**
* 视图保存
*/
@RequestMapping("/view-save")
public Integer viewSave(@RequestBody MachineEnvRequest request) {
Long machineId = Valid.notNull(request.getMachineId());
String value = Valid.notBlank(request.getValue());
EnvViewType viewType = Valid.notNull(EnvViewType.of(request.getViewType()));
try {
MutableLinkedHashMap<String, String> result = viewType.toMap(value);
machineEnvService.saveEnv(machineId, result);
return result.size();
} catch (Exception e) {
throw Exceptions.argument(MessageConst.PARSE_ERROR, e);
}
}
use of com.orion.ops.consts.env.EnvViewType in project orion-ops by lijiahangmax.
the class SystemEnvController method view.
/**
* 视图
*/
@RequestMapping("/view")
public String view(@RequestBody SystemEnvRequest request) {
EnvViewType viewType = Valid.notNull(EnvViewType.of(request.getViewType()));
request.setLimit(Const.N_100000);
// 查询列表
Map<String, String> env = Maps.newLinkedMap();
systemEnvService.listEnv(request).forEach(e -> env.put(e.getKey(), e.getValue()));
return viewType.toValue(env);
}
Aggregations