package com.sckw.stream.enums;

/**
 * @author zk
 * @description 短信模板
 * @date 2020/06/16 08:37:44
 */
public enum MessageEnum {
    /**SYSTEM 系统消息、BUSINESS业务消息、INDUSTRY行业消息**/
    XXXXXX("SYSTEM", "xxxxx", "xxxx", "xxxxxx","terminal"),
    XXXXXX1("BUSINESS", "xxxxx", "xxxx", "xxxxxx","terminal"),

    //认证通过
    AUDIT_PASS("SYSTEM","SYSTEM_ENT_APPR","认证通过通知","审核通过!您的资质已认证成功,危品汇欢迎您的入驻!","terminal,ios,android"),
    //委托单-指派成功
    RECEIVE_ASSIGN_ENTRUST("BUSINESS", "RECEIVE_ASSIGN_ENTRUST", "新委托单通知",
            "${firmName}委托承运：从${loadAddress}至${unloadAddress}，承运${supplyName}，委托量${weight}吨，运价${price}！","terminal,ios,android");

    /**
     * 消息分类
     */
    private String category;

    /**
     * 消息类型
     */
    private String type;

    /**
     * 消息标题
     */
    private String title;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 显示终端 terminal ios android
     */
    private String pushType;

    /**
     * @description 构造方法
     * @author zk
     * @date 2020/6/08 11:28
     * @param category 消息分类, type 消息类型, title 消息标题, content 消息内容
     * @return
     **/
    private MessageEnum(String category, String type, String title, String content, String pushType) {
        this.category = category;
        this.type = type;
        this.title = title;
        this.content = content;
        this.pushType = pushType;
    }

    public static String getCategoryByType(String type) {
        for (MessageEnum entityEnum : MessageEnum.values()) {
            if (entityEnum.getType().equals(type)) {
                return entityEnum.getCategory();
            }
        }
        return null;
    }

    public static String getTitleByType(String type) {
        for (MessageEnum entityEnum : MessageEnum.values()) {
            if (entityEnum.getType().equals(type)) {
                return entityEnum.getTitle();
            }
        }
        return null;
    }

    public static String getContentByType(String type) {
        for (MessageEnum entityEnum : MessageEnum.values()) {
            if (entityEnum.getType().equals(type)) {
                return entityEnum.getContent();
            }
        }
        return null;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getPushType() {
        return pushType;
    }

    public void setPushType(String pushType) {
        this.pushType = pushType;
    }
}
