PatchVersionService.java 1.69 KB
package com.brframework.webapppatch.service;

import com.brframework.commondb.core.EntityService;
import com.brframework.webapppatch.entity.PatchVersion;

/**
 * 版本
 * @author xu
 * @date 2019/11/14 10:29
 */
public interface PatchVersionService extends EntityService<PatchVersion, Long, Object> {

    /**
     * 创建新版本
     * @param os                系统
     * @param branch            分支
     * @param versionMessage    新版本信息
     * @param versionUrl        新版本下载地址
     * @param patchUrl          补丁包下载地址
     * @param bundleUrl         完成的bundle包
     * @param updateType        更新类型(1.重启后生效  2.立即生效)
     * @param updateStatus      更新状态(1.部署成功  2.灰度测试  3.发布 4.失败)
     */
    void createVersion(String os, String branch, String versionMessage,
                       String versionUrl, String patchUrl, String bundleUrl, Integer updateType,
                       Integer updateStatus);

    Integer getBranchMaxVersion(String os, String branch);

    /**
     * 版本进入灰度状态
     * @param id
     */
    void setVersionGray(Long id);

    /**
     * 版本发布
     * @param id
     */
    void setVersionRelease(Long id);

    /**
     * 版本失败
     * @param id
     */
    void setVersionDefeated(Long id);

    /**
     * 获取版本信息
     * 自动区分灰度
     * @param os          系统
     * @param branch      分支
     * @param username    用户名
     * @return
     */
    PatchVersion getVersion(String os, String branch, String username);


    /**
     * 通过分支清除版本
     * @param branch
     */
    void removeByBranch(String branch);

}