package com.unis.crk.mq.constant;

/**
 * 操作类型-增删改
 *
 * @author ybw
 * @version V1.0
 * @className BizType
 * @date 2024/5/9
 **/
public enum BizOperateType {

    INSERT("insert", "新增"),
    UPDATE("update", "修改"),
    DELETE("delete", "删除");

    private String code;
    private String desc;

    BizOperateType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static  BizOperateType getBizOperateTypeByDesc(String desc) {
       if ( INSERT.desc.equals(desc)){
           return INSERT;
       }
       if ( UPDATE.desc.equals(desc)){
           return UPDATE;
       }
       if (DELETE.desc.equals(desc)){
           return DELETE;
       }
         return  null;
    }
}
