package net.northking.cctp.scriptcase.enums;

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

public enum FileError implements PlatformError {
    FILE_SIZE_ERROR("文件不能为空"),
    SCREENSHOT_URL_IS_NULL("截图路径为空"),
    FILE_DOWNLOAD_ERROR("文件下载失败"),
    FILE_UPLOAD_FAIL("文件上传失败"),
    IPA_UPLOAD_FAIL("IPA包解析失败"),
    APK_UPLOAD_FAIL("APK包解析失败"),
    APP_FILE_TYPE_ERROR("文件格式不正确");

    private static final int START_CODE = 220000;

    private final Integer code;
    private final String msg;

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

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

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

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