use of com.orion.ops.consts.env.EnvViewType in project orion-ops by lijiahangmax.
the class ApplicationEnvController method viewSave.
/**
* 视图保存
*/
@RequestMapping("/view-save")
public Integer viewSave(@RequestBody ApplicationEnvRequest request) {
Long appId = Valid.notNull(request.getAppId());
Long profileId = Valid.notNull(request.getProfileId());
EnvViewType viewType = Valid.notNull(EnvViewType.of(request.getViewType()));
String value = Valid.notBlank(request.getValue());
try {
MutableLinkedHashMap<String, String> result = viewType.toMap(value);
applicationEnvService.saveEnv(appId, profileId, result);
return result.size();
} catch (Exception e) {
throw Exceptions.argument(MessageConst.PARSE_ERROR, e);
}
}
Aggregations