Search in sources :

Example 6 with EventLog

use of com.orion.ops.annotation.EventLog in project orion-ops by lijiahangmax.

the class SftpController method transferPackage.

/**
 * 传输打包 全部已完成未删除的文件
 */
@RequestMapping("/transfer/{sessionToken}/{packageType}/package")
@EventLog(EventType.SFTP_PACKAGE)
public void transferPackage(@PathVariable("sessionToken") String sessionToken, @PathVariable("packageType") Integer packageType) {
    SftpPackageType sftpPackageType = Valid.notNull(SftpPackageType.of(packageType));
    sftpService.transferPackage(sessionToken, sftpPackageType);
}
Also used : SftpPackageType(com.orion.ops.consts.sftp.SftpPackageType) EventLog(com.orion.ops.annotation.EventLog)

Example 7 with EventLog

use of com.orion.ops.annotation.EventLog 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)

Example 8 with EventLog

use of com.orion.ops.annotation.EventLog in project orion-ops by lijiahangmax.

the class ApplicationReleaseController method auditAppRelease.

/**
 * 发布审核
 */
@RequestMapping("/audit")
@RequireRole(RoleType.ADMINISTRATOR)
@EventLog(EventType.AUDIT_RELEASE)
public Integer auditAppRelease(@RequestBody ApplicationReleaseAuditRequest request) {
    Valid.notNull(request.getId());
    AuditStatus status = Valid.notNull(AuditStatus.of(request.getStatus()));
    if (AuditStatus.REJECT.equals(status)) {
        Valid.notBlank(request.getReason());
    }
    return applicationReleaseService.auditAppRelease(request);
}
Also used : AuditStatus(com.orion.ops.consts.AuditStatus) EventLog(com.orion.ops.annotation.EventLog) RequireRole(com.orion.ops.annotation.RequireRole) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 9 with EventLog

use of com.orion.ops.annotation.EventLog in project orion-ops by lijiahangmax.

the class ApplicationReleaseController method setTimedRelease.

/**
 * 设置定时发布
 */
@RequestMapping("/set-timed")
@EventLog(EventType.SET_TIMED_RELEASE)
public HttpWrapper<?> setTimedRelease(@RequestBody ApplicationReleaseRequest request) {
    Long id = Valid.notNull(request.getId());
    Date timedReleaseTime = Valid.notNull(request.getTimedReleaseTime());
    Valid.isTrue(timedReleaseTime.compareTo(new Date()) > 0, MessageConst.TIMED_GREATER_THAN_NOW);
    applicationReleaseService.setTimedRelease(id, timedReleaseTime);
    return HttpWrapper.ok();
}
Also used : Date(java.util.Date) EventLog(com.orion.ops.annotation.EventLog) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 10 with EventLog

use of com.orion.ops.annotation.EventLog in project orion-ops by lijiahangmax.

the class ApplicationVcsController method addAppVcs.

/**
 * 添加版本仓库
 */
@RequestMapping("/add")
@EventLog(EventType.ADD_VCS)
public Long addAppVcs(@RequestBody ApplicationVcsRequest request) {
    Valid.allNotBlank(request.getName(), request.getUrl());
    VcsAuthType authType = Valid.notNull(VcsAuthType.of(request.getAuthType()));
    if (VcsAuthType.TOKEN.equals(authType)) {
        Valid.notNull(VcsTokenType.of(request.getTokenType()));
        Valid.notBlank(request.getPrivateToken());
    }
    return applicationVcsService.addAppVcs(request);
}
Also used : VcsAuthType(com.orion.ops.consts.app.VcsAuthType) EventLog(com.orion.ops.annotation.EventLog) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

EventLog (com.orion.ops.annotation.EventLog)10 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)8 RequireRole (com.orion.ops.annotation.RequireRole)3 Date (java.util.Date)2 AuditStatus (com.orion.ops.consts.AuditStatus)1 TimedReleaseType (com.orion.ops.consts.app.TimedReleaseType)1 VcsAuthType (com.orion.ops.consts.app.VcsAuthType)1 EnvViewType (com.orion.ops.consts.env.EnvViewType)1 MachineAuthType (com.orion.ops.consts.machine.MachineAuthType)1 SftpPackageType (com.orion.ops.consts.sftp.SftpPackageType)1 SystemCleanType (com.orion.ops.consts.system.SystemCleanType)1 SystemConfigKey (com.orion.ops.consts.system.SystemConfigKey)1 Path (java.nio.file.Path)1 MultipartFile (org.springframework.web.multipart.MultipartFile)1