package com.ld.igds.protocol.snap;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
public class SnapCommand {
|
|
private final static SnapCommand instance = new SnapCommand();
|
|
private SnapCommand() {
|
}
|
|
public static SnapCommand getInstance() {
|
return instance;
|
}
|
|
|
/**
|
* 抓拍命令
|
*
|
* @param sn
|
* @param orderId
|
* @param url
|
* @return
|
*/
|
public String buildSnap(String sn, String orderId, String url) {
|
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("sn", sn);
|
jsonObject.put("functionId", SnapUtils.FUNC_ID_1);
|
jsonObject.put("orderId", orderId);
|
jsonObject.put("sn", sn);
|
|
JSONObject jsonContent = new JSONObject();
|
jsonContent.put("url", url);
|
|
jsonObject.put("content", jsonContent);
|
|
return SnapUtils.MSG_BEGIN + jsonObject.toJSONString() + SnapUtils.MSG_END;
|
}
|
|
}
|