Search in sources :

Example 1 with BuildExtraModule

use of io.jpom.build.BuildExtraModule in project Jpom by dromara.

the class BuildInfoManageController method reRelease.

/**
 * 重新发布
 *
 * @param logId logId
 * @return json
 */
@RequestMapping(value = "/build/manage/reRelease", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
@Feature(method = MethodFeature.EXECUTE)
public String reRelease(@ValidatorConfig(@ValidatorItem(value = ValidatorRule.NOT_BLANK, msg = "没有数据")) String logId) {
    BuildHistoryLog buildHistoryLog = dbBuildHistoryLogService.getByKey(logId, getRequest());
    Objects.requireNonNull(buildHistoryLog, "没有对应构建记录.");
    BuildInfoModel item = buildInfoService.getByKey(buildHistoryLog.getBuildDataId());
    Objects.requireNonNull(item, "没有对应数据");
    String e = buildExecuteService.checkStatus(item.getStatus());
    Assert.isNull(e, () -> e);
    UserModel userModel = getUser();
    BuildExtraModule buildExtraModule = BuildExtraModule.build(buildHistoryLog);
    // new BuildExtraModule();
    // buildExtraModule.updateValue(buildHistoryLog);
    ReleaseManage manage = ReleaseManage.builder().buildExtraModule(buildExtraModule).logId(buildHistoryLog.getId()).userModel(userModel).buildId(buildHistoryLog.getBuildNumberId()).buildExecuteService(buildExecuteService).build();
    // ReleaseManage releaseManage = new ReleaseManage(buildHistoryLog, userModel);
    // 标记发布中
    // releaseManage.updateStatus(BuildStatus.PubIng);
    ThreadUtil.execute(manage);
    return JsonMessage.getString(200, "重新发布中");
}
Also used : UserModel(io.jpom.model.data.UserModel) BuildHistoryLog(io.jpom.model.log.BuildHistoryLog) ReleaseManage(io.jpom.build.ReleaseManage) BuildExtraModule(io.jpom.build.BuildExtraModule) BuildInfoModel(io.jpom.model.data.BuildInfoModel) Feature(io.jpom.permission.Feature) MethodFeature(io.jpom.permission.MethodFeature) ClassFeature(io.jpom.permission.ClassFeature) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

BuildExtraModule (io.jpom.build.BuildExtraModule)1 ReleaseManage (io.jpom.build.ReleaseManage)1 BuildInfoModel (io.jpom.model.data.BuildInfoModel)1 UserModel (io.jpom.model.data.UserModel)1 BuildHistoryLog (io.jpom.model.log.BuildHistoryLog)1 ClassFeature (io.jpom.permission.ClassFeature)1 Feature (io.jpom.permission.Feature)1 MethodFeature (io.jpom.permission.MethodFeature)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1