package com.yuchen.saas.integration.feign.api.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @author
 * @create 2020/10/17 14:45
 */
public class NvrEnum {



    public enum ActionType {
        ADD("add", "新增"),
        MOD("mod", "修改"),
        DEl("del", "删除"),

        ;
        private String flag;
        private String describe;

        private ActionType(String flag, String describe) {
            this.flag = flag;
            this.describe = describe;
        }

        public static ActionType getActionType(String actType) {
            ActionType actionTypes[] = ActionType.values();
            if (StringUtils.isBlank(actType)) {
                return null;
            }
            for (ActionType a : actionTypes) {
                if (StringUtils.equals(a.getFlag(), actType)) {
                    return a;
                }
            }
            return null;
        }

        public String getDescribe() {
            return describe;
        }

        public String getFlag() {
            return flag;
        }
    }

    public enum CatType {
        GROUP("group", "设备分组"),

        CAM("cam", "摄像头设备"),

        ECAM("ecam","梯控摄像头"),
        ;
        private String flag;
        private String describe;

        private CatType(String flag, String describe) {
            this.flag = flag;
            this.describe = describe;
        }

        public static CatType getActionType(String catType) {
            CatType catTypes[] = CatType.values();
            if (StringUtils.isBlank(catType)) {
                return null;
            }
            for (CatType a : catTypes) {
                if (StringUtils.equals(a.getFlag(), catType)) {
                    return a;
                }
            }
            return null;
        }

        public String getDescribe() {
            return describe;
        }

        public String getFlag() {
            return flag;
        }
    }



}
