Search in sources :

Example 1 with MachineAuthType

use of com.orion.ops.consts.machine.MachineAuthType in project orion-ops by lijiahangmax.

the class MachineInfoController method add.

/**
 * 添加
 */
@RequestMapping("/add")
@EventLog(EventType.ADD_MACHINE)
public Long add(@RequestBody MachineInfoRequest request) {
    this.check(request);
    MachineAuthType machineAuthTypeEnum = Valid.notNull(MachineAuthType.of(request.getAuthType()));
    if (MachineAuthType.PASSWORD.equals(machineAuthTypeEnum)) {
        Valid.notBlank(request.getPassword());
    }
    return machineInfoService.addMachine(request);
}
Also used : MachineAuthType(com.orion.ops.consts.machine.MachineAuthType) EventLog(com.orion.ops.annotation.EventLog) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

EventLog (com.orion.ops.annotation.EventLog)1 MachineAuthType (com.orion.ops.consts.machine.MachineAuthType)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1