package net.northking.cctp.scriptcase.enums;

import net.northking.cctp.common.exception.PlatformError;

public enum MobileError implements PlatformError {
    //公共模块
    FILE_SIZE_LIMIT_EXCEEDED("文件大小超过限制"),
    FILE_TYPE_ERROR("文件类型错误"),
    GET_FILE_STREAM_ERROR("获取文件流失败"),
    DATA_FORMAT_ERROR("数据格式错误"),
    //--------------APP模块
    APP_IS_NULL("APP信息为空"),
    APP_IS_EXIST("上传失败,【{0}{1}】已存在！"),
    APP_DOWNLOAD_ERROR("APP下载失败"),
    APP_FILE_IS_ERROR("上传文件受损，上传失败"),
    APP_FILE_NOT_EXIST("APP文件不存在"),
    APP_DELETE_ERROR("APP删除失败"),
    APP_RESOLUTION_ERROR("APP文件解析有误"),
    APP_ICON_GET_ERROR("APP图标获取失败"),
    APP_SIZE_PASS_LIMIT("APP大小超过500M"),
    APP_TYPE_IS_ERROR("APP类型不对");


    private static final int START_CODE = 220000;

    private final Integer code;
    private final String msg;

    MobileError(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    MobileError(String msg) {
        this.code = ordinal() + START_CODE;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }


}
