package com.tzld.piaoquan.api.common.enums.contentplatform;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum BussinessTypeEnum {
    GZH_AUTO_REPLY("gzh_autoReply", "gongzhonghaozidonghuifu", "公众号自动回复"),
    FWH_PUSH("fwh_push", "fuwuhaodaiyunying", "服务号推送"),
    GZH_PUSH("gzh_push", "gongzhonghaotuisong", "公众号推送"),
    QW("qw", "qiweihezuo", "企微"),

    ;

    private final String val;
    private final String prefix;
    private final String description;

    BussinessTypeEnum(String val, String prefix, String description) {
        this.val = val;
        this.prefix = prefix;
        this.description = description;
    }

    public static BussinessTypeEnum from(String val) {
        for (BussinessTypeEnum typeEnum : BussinessTypeEnum.values()) {
            if (Objects.equals(typeEnum.getVal(), val)) {
                return typeEnum;
            }
        }
        return null;
    }


}
