| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hikvision.artemis.sdk.ArtemisHttpUtil; |
| | | import com.hikvision.artemis.sdk.config.ArtemisConfig; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.*; |
| | | |
| | | import static cn.gistack.sm.hk.constant.HkConstant.ARTEMIS_PATH; |
| | | import static cn.gistack.sm.hk.util.GetCameraUtils.GetCameraPreviewURL; |
| | | |
| | | public class GetCameraUtils { |
| | | |
| | | /** |
| | |
| | | * @param expand |
| | | * @return |
| | | */ |
| | | public static String GetCameraPreviewURL(Integer type,String url, String cameraIndexCode, String protocol,String expand) { |
| | | public static String GetCameraPreviewURL(Integer type,String url, String cameraIndexCode, String protocol,String expand,Integer streamType) { |
| | | /** |
| | | * 组装请求参数 |
| | | */ |
| | | JSONObject jsonBody = new JSONObject(); |
| | | jsonBody.put("cameraIndexCode", cameraIndexCode); |
| | | jsonBody.put("streamType", 0); |
| | | jsonBody.put("streamType",streamType); |
| | | jsonBody.put("protocol", protocol); |
| | | jsonBody.put("transmode", 1); |
| | | if (null!= expand && !expand.equals("")) { |
| | |
| | | * 组装请求参数 |
| | | */ |
| | | JSONObject jsonBody = new JSONObject(); |
| | | jsonBody.put("eventTypes", Arrays.stream(eventVO.getEventTypes().split(",")).mapToInt(Integer::parseInt).toArray()); |
| | | jsonBody.put("eventTypes", Arrays.stream(eventVO.getEventTypes().split(",")).mapToLong(Long::parseLong).toArray()); |
| | | jsonBody.put("eventDest", eventVO.getEventDest()); |
| | | if (null!=eventVO.getSubType()){ |
| | | jsonBody.put("subType", eventVO.getSubType()); |
| | |
| | | * @return |
| | | */ |
| | | public static String removeEventSubscriptionByEventTypes(EventVO eventVO, String url) { |
| | | int[] eventTypes = Arrays.stream(eventVO.getEventTypes().split(",")).mapToInt(Integer::parseInt).toArray(); |
| | | long[] eventTypes = Arrays.stream(eventVO.getEventTypes().split(",")).mapToLong(Long::parseLong).toArray(); |
| | | /** |
| | | * 组装请求参数 |
| | | */ |