package com.ruoyi.usernotice.enums;

import com.ruoyi.common.enums.IIntegerEnum;

import java.util.Objects;

/**
 * 用户通知实体类型枚举 0票订单，1票退款单
 */
public enum UserNoticeEntityType implements IIntegerEnum {
    //
    VOTE_ORDER(0, "票订单"),
    VOTE_REFUND(1, "票退款单");
    ;


    private Integer code;

    private String msg;

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

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

    public void setCode(Integer code) {
        this.code = code;
    }

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

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static UserNoticeEntityType getByCode(int code, UserNoticeEntityType[] values) {
        for (UserNoticeEntityType value : values) {
            if (Objects.equals(code, value.getCode())) {
                return value;
            }
        }
        return null;
    }
}
