| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.Gson; |
| | | import com.sandu.ximon.admin.config.NginxConfigBean; |
| | | import com.sandu.ximon.admin.config.RealtimeServerBean; |
| | | import com.sandu.ximon.admin.service.PoleLightemitService; |
| | | import com.sandu.ximon.admin.utils.request.*; |
| | |
| | | PoleLightemitService poleLightemitService; |
| | | @Autowired |
| | | ApplicationContext applicationContext; |
| | | @Autowired |
| | | NginxConfigBean nginxConfigBean; |
| | | //body封装编码 |
| | | private final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); |
| | | |
| | |
| | | String result = post(url, postBody); |
| | | } |
| | | |
| | | /** |
| | | * html传输至led屏, 通过url获取html |
| | | * |
| | | * @param ledCode |
| | | * @param username |
| | | */ |
| | | public void postHtmlUseNginx(String ledCode, String username) { |
| | | |
| | | PostHtml postHtml = new PostHtml(nginxConfigBean.getUrl() + username + "_" + ledCode + ".html"); |
| | | String postBody = new Gson().toJson(postHtml); |
| | | |
| | | //请求地址 |
| | | String url = realtimeServerBean.getCommand() + ledCode; |
| | | //保存led数据 |
| | | poleLightemitService.updateRequestBody(ledCode, postBody); |
| | | //请求 |
| | | String result = post(url, postBody); |
| | | } |
| | | |
| | | /** |
| | | * 视频传输至led屏 |
| | |
| | | |
| | | /** |
| | | * 发送最新的数据 |
| | | * |
| | | * @param lightemitControlCode |
| | | */ |
| | | public void sendLastCommand(String lightemitControlCode) { |