ReqSetServerUriInfo.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package com.persagy.nvr;
  2. import com.alibaba.fastjson.PropertyNamingStrategy;
  3. import com.alibaba.fastjson.annotation.JSONField;
  4. import com.alibaba.fastjson.annotation.JSONType;
  5. import com.alibaba.fastjson.parser.DefaultJSONParser;
  6. import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;
  7. import lombok.Data;
  8. import lombok.SneakyThrows;
  9. import sun.misc.BASE64Decoder;
  10. import java.lang.reflect.Type;
  11. /**
  12. * IPC配置列表 NvrServerUriList
  13. *
  14. * @author : ZhangWenTao
  15. * @version : 1.0
  16. * @since : 2022/6/27 11:00
  17. */
  18. @Data
  19. @JSONType(naming = PropertyNamingStrategy.SnakeCase)
  20. public class ReqSetServerUriInfo {
  21. /**
  22. * 当前添加的IPC在NVR上的通道ID
  23. */
  24. private int chid;
  25. /**
  26. * what 's type of device that video stream get from. 1 for IPC stream 2 for NVR stream
  27. */
  28. private int deviceType;
  29. /**
  30. * 协议类型, ONVIF为0
  31. */
  32. private int protocolType;
  33. /**
  34. * 设备名称
  35. */
  36. @JSONField(deserializeUsing = DeviceNameDeserializer.class)
  37. private String deviceName;
  38. /**
  39. * 192.168.0.123
  40. */
  41. private String ip;
  42. /**
  43. * port
  44. */
  45. private int port;
  46. /**
  47. * GB28181协议类型: 对应的国标id
  48. */
  49. private String sipGbId;
  50. /**
  51. * 在线状态 1-是 0-否
  52. */
  53. private String onlineStatus;
  54. public static class DeviceNameDeserializer implements ObjectDeserializer {
  55. @Override
  56. @SneakyThrows
  57. public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
  58. return (T) new String(new BASE64Decoder().decodeBuffer(String.valueOf(parser.parseKey())));
  59. }
  60. @Override
  61. public int getFastMatchToken() {
  62. return 0;
  63. }
  64. }
  65. }