package com.ylx.massage.enums;


import com.ylx.common.utils.StringUtils;
import lombok.Getter;
import org.apache.commons.compress.utils.Lists;

import java.util.ArrayList;
import java.util.List;

/**
 * @author jianlong
 * @date 2024-07-31 16:10
 */

@Getter
public enum ComplaintEnum {


    SZJS("1", "私自接受现金、转账等"),

    SYXF("2", "向客户索要小费"),

    YXLL("3", "言行举止恶劣"),

    HDD("4", "涉及黄、赌、毒，偷盗的行为"),

    OTHER("5", "其他类别");

    private final String code;
    private final String info;

    ComplaintEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public static List<Enumproject> getStatusEnum() {

        ArrayList<Enumproject> objects = Lists.newArrayList();
        for (ComplaintEnum value : ComplaintEnum.values()) {
            Enumproject enumproject = new Enumproject();
            enumproject.setInfo(value.getInfo());
            enumproject.setDesc(value.getCode());
            objects.add(enumproject);
        }
        return objects;
    }

    public static String getDescByCode(String code) {
        for (ComplaintEnum value : ComplaintEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getInfo();
            }
        }
        return StringUtils.EMPTY;
    }
}
