use of com.orion.ops.consts.app.TimedReleaseType in project orion-ops by lijiahangmax.
the class ApplicationReleaseController method submitAppRelease.
/**
* 提交发布
*/
@RequestMapping("/submit")
@EventLog(EventType.SUBMIT_RELEASE)
public Long submitAppRelease(@RequestBody ApplicationReleaseRequest request) {
Valid.notBlank(request.getTitle());
Valid.notNull(request.getAppId());
Valid.notNull(request.getProfileId());
Valid.notNull(request.getBuildId());
Valid.notEmpty(request.getMachineIdList());
TimedReleaseType timedReleaseType = Valid.notNull(TimedReleaseType.of(request.getTimedRelease()));
if (TimedReleaseType.TIMED.equals(timedReleaseType)) {
Date timedReleaseTime = Valid.notNull(request.getTimedReleaseTime());
Valid.isTrue(timedReleaseTime.compareTo(new Date()) > 0, MessageConst.TIMED_GREATER_THAN_NOW);
}
// 提交
Long id = applicationReleaseService.submitAppRelease(request);
// 提交任务
if (TimedReleaseType.TIMED.equals(timedReleaseType)) {
taskRegister.submit(TaskType.RELEASE, request.getTimedReleaseTime(), id);
}
return id;
}
Aggregations