Search in sources :

Example 1 with SystemConfigKey

use of com.orion.ops.consts.system.SystemConfigKey in project orion-ops by lijiahangmax.

the class SystemController method updateSystemOption.

/**
 * 修改系统配置项
 */
@RequestMapping("/update-system-option")
@EventLog(EventType.UPDATE_SYSTEM_OPTION)
@RequireRole(RoleType.ADMINISTRATOR)
public HttpWrapper<?> updateSystemOption(@RequestBody SystemOptionRequest request) {
    SystemConfigKey key = Valid.notNull(SystemConfigKey.of(request.getOption()));
    String value = key.getValue(Valid.notBlank(request.getValue()));
    systemService.updateSystemOption(key.getEnv(), value);
    return HttpWrapper.ok();
}
Also used : SystemConfigKey(com.orion.ops.consts.system.SystemConfigKey) EventLog(com.orion.ops.annotation.EventLog) RequireRole(com.orion.ops.annotation.RequireRole) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

EventLog (com.orion.ops.annotation.EventLog)1 RequireRole (com.orion.ops.annotation.RequireRole)1 SystemConfigKey (com.orion.ops.consts.system.SystemConfigKey)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1