package com.ruoyi.enums.message;

import java.util.Arrays;

/**
 * 系统消息枚举
 * @Author liwenlong
 */
public enum AppMessageEnums {

    /**
     * 系统消息
     */
    APP_MESSAGE(1, "您有新的系统消息",""),

    /**
     * 平台认证
     */
    AUTH_MESSAGE_SUSESS(2, "平台认证","您的平台认证审核通过"),

    /**
     * 平台认证
     */
    AUTH_MESSAGE_FAIL(3, "平台认证","您的平台认证审核失败"),

    /**
     * 提现审核
     */
    WITHDRAWAL_SUCCESS(4, "提现审核","您的提现审核通过"),

    /**
     * 提现审核
     */
    WITHDRAWAL_FAIL(5, "提现审核","您的提现审核失败"),

    /**
     * 保证金提现审核
     */
    BOND_WITHDRAWAL_SUCCESS(6, "保证金退还审核","您的保证金退还审核通过"),

    /**
     * 保证金提现审核
     */
    BOND_WITHDRAWAL_FAIL(7, "保证金退还审核","您的保证金退还审核失败"),
    ;

    private Integer code;
    private String title;
    private final String content;

    public static String getTitle(Integer code) {
        return getAppMessageEnums(code).title;
    }

    public static String getContent(Integer code) {
        return getAppMessageEnums(code).content;
    }

    public static AppMessageEnums getAppMessageEnums(Integer code) {
        return Arrays.stream(AppMessageEnums.values()).filter(c->c.getCode().equals(code)).findFirst().get();
    }

    AppMessageEnums(Integer code, String title, String content) {
        this.code = code;
        this.title = title;
        this.content = content;
    }

    AppMessageEnums(String content) {
        this.content = content;
    }

    public Integer getCode() {
        return code;
    }

    public String getTitle() {
        return title;
    }


    public String getContent() {
        return content;
    }


}
