package com.sz.platform.enums;

import com.sz.core.common.enums.ErrorPrefixEnum;
import com.sz.core.common.enums.ResponseEnumTemplate;

/**
 * 异常枚举类 适用于Admin模块的 操作
 */
public enum AdminResponseEnum implements ResponseEnumTemplate<AdminResponseEnum> {

    // @formatter:off
    MENU_NAME_EXISTS(1001, "Menu路由名称已存在"),
    DEVICE_OFFLINE(1002, "设备为离线状态无法刷新"),
    DEVICE_ADD_PROXY_FAIL(1003, "添加拉流代理失败"),
    DEVICE_PTZ_CONTROL_FAIL(1004, "设备PTZ控制失败"),
    CHANNEL_PRESET_FAIL(1005, "当前预置位被设置为守望位，请先关闭或者修改守望位"),
    OPERATION_FAIL(1006, "操作失败");

    ;
    // @formatter:on

    /**
     * 返回码
     */
    private final int code;

    /**
     * 返回消息
     */
    private final String message;

    AdminResponseEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public ErrorPrefixEnum getCodePrefixEnum() {
        return ErrorPrefixEnum.ADMIN;
    }
}