package com.storlead.mail.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import okhttp3.internal.http2.ErrorCode;

@Getter
public enum SendStatus {

    SUCCESS("SUCCESS", "成功",0),
    FAILED("FAILED", "失败",0),
    PARTIAL_SUCCESS("PARTIAL_SUCCESS", "部分成功",0),
    SERVER_EXCEPTION_550("SERVER_EXCEPTION", "邮件发送失败，请确认发送的邮箱是否正确", 0),
    SERVER_LOGIN_FAIL("SERVER_LOGIN_FAIL", "登录失败，请确认账号密码", 401),
    MTP_SEND_FAILED_EXCEPTION_453("MTP_SEND_FAILED_EXCEPTION_453", "发送一场,请检查附件或邮件大小", 453),
            ;
    //MTPSendFailedException: 453  邮件超限

    /**
     * {@link EnumValue}标记数据库存的值是code
     */
    @EnumValue
    public String code;

    /**
     * {@link JsonValue} 标记json返回给前端显示的值是desc
     */
    @JsonValue
    public String desc;

    @EnumValue
    public Integer errorCode;

    SendStatus(String code, String desc,Integer errorCode) {
        this.code = code;
        this.desc = desc;
        this.errorCode = errorCode;

    }
}
