1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- package com.persagy.nvr;
- import com.alibaba.fastjson.PropertyNamingStrategy;
- import com.alibaba.fastjson.annotation.JSONField;
- import com.alibaba.fastjson.annotation.JSONType;
- import com.alibaba.fastjson.parser.DefaultJSONParser;
- import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;
- import lombok.Data;
- import lombok.SneakyThrows;
- import sun.misc.BASE64Decoder;
- import java.lang.reflect.Type;
- /**
- * IPC配置列表 NvrServerUriList
- *
- * @author : ZhangWenTao
- * @version : 1.0
- * @since : 2022/6/27 11:00
- */
- @Data
- @JSONType(naming = PropertyNamingStrategy.SnakeCase)
- public class ReqSetServerUriInfo {
- /**
- * 当前添加的IPC在NVR上的通道ID
- */
- private int chid;
- /**
- * what 's type of device that video stream get from. 1 for IPC stream 2 for NVR stream
- */
- private int deviceType;
- /**
- * 协议类型, ONVIF为0
- */
- private int protocolType;
- /**
- * 设备名称
- */
- @JSONField(deserializeUsing = DeviceNameDeserializer.class)
- private String deviceName;
- /**
- * 192.168.0.123
- */
- private String ip;
- /**
- * port
- */
- private int port;
- /**
- * GB28181协议类型: 对应的国标id
- */
- private String sipGbId;
- /**
- * 在线状态 1-是 0-否
- */
- private String onlineStatus;
- public static class DeviceNameDeserializer implements ObjectDeserializer {
- @Override
- @SneakyThrows
- public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
- return (T) new String(new BASE64Decoder().decodeBuffer(String.valueOf(parser.parseKey())));
- }
- @Override
- public int getFastMatchToken() {
- return 0;
- }
- }
- }
|