package com.gic.haoban.manage.api.enums.content;

import java.util.Objects;

public enum InteractRecordChannelSourceType {

    OTHER(0, "其他"),
    FRIEND_CIRCLE(1, "朋友圈"),
    CUSTOMER_GROUP(2, "客户群"),
    CHAT_WINDOW(3, "对话框");

    private final Integer code;
    private final String description;

    InteractRecordChannelSourceType(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static InteractRecordChannelSourceType fromCode(Integer code) {
        for (InteractRecordChannelSourceType source : values()) {
            if (Objects.equals(source.code,code)) {
                return source;
            }
        }
        return OTHER;
    }
}
