|
@@ -13,12 +13,7 @@ import com.ozs.common.utils.HttpClientUtil;
|
|
|
import com.ozs.common.utils.StringUtils;
|
|
|
import com.ozs.common.utils.http.HttpUtils;
|
|
|
import com.ozs.common.utils.stateSecrets.SM4Utils;
|
|
|
-import com.ozs.service.entity.BaseCameraManagement;
|
|
|
-import com.ozs.service.entity.BaseDeviceDynamicManagement;
|
|
|
-import com.ozs.service.entity.BaseUser;
|
|
|
-import com.ozs.service.entity.MsgAlarm;
|
|
|
-import com.ozs.service.entity.MsgAlarmFrequency;
|
|
|
-import com.ozs.service.entity.SvcAddress;
|
|
|
+import com.ozs.service.entity.*;
|
|
|
import com.ozs.service.entity.vo.BaseCameraVO;
|
|
|
import com.ozs.service.service.*;
|
|
|
import com.ozs.service.utils.PublishClient;
|
|
@@ -32,10 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -85,6 +77,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
private String wsUrl;
|
|
|
@Value("${base.recordUrl}")
|
|
|
private String recordUrl;
|
|
|
+ @Autowired
|
|
|
+ private CloudStateService cloudStateService;
|
|
|
|
|
|
/**
|
|
|
* 获取web访问令牌
|
|
@@ -345,6 +339,36 @@ public class GeoHazardMonitorTokenController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 中心端识别程序心跳接口
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/cloud/state")
|
|
|
+ public String cloudState(HttpServletRequest request){
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ String token = apiTokenUtils.getGeoHazardMonitorToken(request);
|
|
|
+ log.info("token:{}", token);
|
|
|
+ if (StringUtils.isNotEmpty(token)) {
|
|
|
+ CloudState cloudState = new CloudState();
|
|
|
+ cloudState.setCreateTime(new Date());
|
|
|
+ if (cloudStateService.save(cloudState)){
|
|
|
+ jsonObject.put("resultCode", 1);
|
|
|
+ jsonObject.put("message", "成功");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), "4370780c9a8c43e5");
|
|
|
+ }else {
|
|
|
+ jsonObject.put("resultCode", 0);
|
|
|
+ jsonObject.put("message", "新增数据失败");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), "4370780c9a8c43e5");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ jsonObject.put("resultCode", 2);
|
|
|
+ jsonObject.put("message", "token验证失败");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), "4370780c9a8c43e5");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 报警视频回放新
|
|
|
*
|