package com.sooka.sponest.monitor.dahua.enums;

import java.util.Arrays;
import java.util.Optional;
/**
 * 大华云台操作日志操作类型枚举
 */
public enum OperateTypeEnum {

    ZERO("0", "登录"),

    ONE("1", "查询"),

    TWO("2", "新增"),

    THREE("3", "修改"),

    FOUR("4", "删除"),

    FIVE("5", "布控"),

    SIX("6", "撤控"),

    SEVEN("7", "控制"),

    EIGHT("8", "注销"),

    NINE("9", "审核"),

    TEN("10", "导入"),

    ELEVEN("11", "导出"),

    TWELVE("12", "视频"),

    THIRTEEN("13", "云台控制"),

    FOURTEEN("14", "录像回放"),

    FIFTEEN("15", "录像下载"),

    SIXTEEN("16", "录像查询"),

    SEVENTEEN("17", "本地录像"),

    EIGHTEEN("18", "语音对讲"),

    NINETEEN("19", "锁定录像"),

    TWENTY("20", "解锁录像"),

    TWENTY_ONE("21", "下载"),

    TWENTY_TWO("22", "远程录像"),

    NINETY("90", "开启"),

    NINETY_ONE("91", "停止"),

    NINETY_TWO("92", "查看"),

    NINETY_THREE("93", "处理"),

    NINETY_FOUR("94", "锁定"),

    NINETY_FIVE("95", "解锁"),

    NINETY_SIX("96", "暂停"),

    NINETY_SEVEN("97", "分享");

    public String code;

    public String value;

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    OperateTypeEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValueByCode(String code) {
        Optional<OperateTypeEnum> result = Arrays.stream(OperateTypeEnum.values())
                .filter(e -> e.getCode().equals(code))
                .findFirst();
        return result.get().getValue();
    }

}
