package com.iailab.module.data.video.hikvision.utils; import java.util.HashMap; import java.util.Map; /** * 响应操作结果 *
 *  {
 *      errno: 错误码,
 *      errmsg:错误消息,
 *      data:  响应数据
 *  }
 * 
* *

* 错误码: *

*/ public class ResponseUtil { public static Object ok() { Map obj = new HashMap(); obj.put("errno", 0); obj.put("errmsg", "成功"); return obj; } public static Object ok(Object data) { Map obj = new HashMap(); obj.put("errno", 0); obj.put("errmsg", "成功"); obj.put("data", data); return obj; } public static Object fail() { Map obj = new HashMap(); obj.put("errno", -1); obj.put("errmsg", "错误"); return obj; } public static Object fail(String errmsg) { Map obj = new HashMap(); obj.put("errno", 1); obj.put("errmsg", "错误"); obj.put("data", errmsg); return obj; } }