package com.ruoyi.ss.complaint.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 意见反馈类型
 * @author wjh
 * 2024/3/18
 */
@AllArgsConstructor
@Getter
public enum ComplaintType {

    BUG("1", "功能异常"),
    ADVICE("2", "意见与建议"),
    OTHER("3", "其他");

    private final String type;
    private final String name;

    public static ComplaintType parse(String type) {
        for (ComplaintType obj : ComplaintType.values()) {
            if (Objects.equals(obj.getType(), type)) {
                return obj;
            }
        }
        throw new RuntimeException("不存在值为" + type + "的意见反馈类型");
    }
}
