ApplicationResponseVo.java 1.54 KB
package com.ruoyi.pojo.response;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author 20412
 */
@ApiModel("应用更新实体类")
@Data
public class ApplicationResponseVo {
    @ApiModelProperty("是否更新")
    Boolean updateFlag;
    @ApiModelProperty("是否强制更新")
    Boolean forceUpdate;
    @ApiModelProperty("更新版本号")
    Integer versionNum;
    @ApiModelProperty("更新apk的url")
    String apkUrl;
    private ApplicationResponseVo(){   }
    public ApplicationResponseVo appNoUpdate(Integer versionNum){
        this.updateFlag = false;
        this.forceUpdate = false;
        this.versionNum = versionNum;
        this.apkUrl = "";
        return this;
    }

    /**
     * 一般更新
     * @param versionNum
     * @param apkUrl
     * @return
     */
    public ApplicationResponseVo appNormalUpdate(Integer versionNum,String apkUrl){
        this.updateFlag = true;
        this.forceUpdate = false;
        this.versionNum = versionNum;
        this.apkUrl = apkUrl;
        return this;
    }

    /**
     * 强制更新
     * @param versionNum
     * @param apkUrl
     * @return
     */
    public ApplicationResponseVo appForceUpdate(Integer versionNum,String apkUrl){
        this.updateFlag = true;
        this.forceUpdate = true;
        this.versionNum = versionNum;
        this.apkUrl = apkUrl;
        return this;
    }
    public static ApplicationResponseVo ApplicationResponseVoBuild(){
        return new ApplicationResponseVo();
    }
}