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

import lombok.Getter;

@Getter
public enum ConfigTaskContentTypeEnum {
    TEXT(0, "文案"),
    MINI_PROGRAM(1, "小程序"),

    other(999, "其他");

    // 0-文案 1-小程序
    private final int val;
    private final String description;

    ConfigTaskContentTypeEnum(int val, String description) {
        this.val = val;
        this.description = description;
    }

    public static ConfigTaskContentTypeEnum from(int val) {
        for (ConfigTaskContentTypeEnum typeEnum : ConfigTaskContentTypeEnum.values()) {
            if (typeEnum.getVal() == val) {
                return typeEnum;
            }
        }

        return other;
    }


}
