From 228d1be133e0fd2f1f46a29af8bc9cbda3d18d74 Mon Sep 17 00:00:00 2001
From: liuhaonan <konodioda2333@vip.qq.com>
Date: 星期一, 14 三月 2022 17:11:31 +0800
Subject: [PATCH] 熙讯接口新增
---
ximon-admin/src/main/java/com/sandu/ximon/admin/utils/LightemitUtils.java | 44 ++++++++++++++++++++++++++------------------
1 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/utils/LightemitUtils.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/utils/LightemitUtils.java
index b01c089..460f387 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/utils/LightemitUtils.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/utils/LightemitUtils.java
@@ -15,6 +15,10 @@
import java.io.IOException;
+/**
+ * 鐔欒灞忓箷鎺у埗
+ */
+
@Component
public class LightemitUtils {
@Autowired
@@ -32,7 +36,7 @@
private OkHttpClient client = new OkHttpClient();
- public void init(){
+ public void init() {
//閲嶆柊鑾峰彇鍗曚緥
poleLightemitService = applicationContext.getBean(PoleLightemitService.class);
}
@@ -117,7 +121,7 @@
//璇锋眰
// poleLightemitService.updateRequestBody(ledCode, "");
String result = post(url, postBody);
- LogUtils.error("娓呭睆缁撴灉:"+result);
+ LogUtils.error("娓呭睆缁撴灉:" + result);
}
/**
@@ -138,12 +142,14 @@
//璇锋眰
String result = post(url, postBody);
}
+
/**
* html浼犺緭鑷砽ed灞�, 閫氳繃url鑾峰彇html
+ *
* @param ledCode
* @param username
*/
- public void postHtmlUseNginx(String ledCode, String username){
+ public void postHtmlUseNginx(String ledCode, String username) {
PostHtml postHtml = new PostHtml(nginxConfigBean.getUrl() + username + "_" + ledCode + ".html");
String postBody = new Gson().toJson(postHtml);
@@ -153,11 +159,12 @@
//淇濆瓨led鏁版嵁
poleLightemitService.updateRequestBody(ledCode, postBody);
//璇锋眰
- String result = post(url,postBody);
+ String result = post(url, postBody);
}
/**
* 瑙嗛浼犺緭鑷砽ed灞�
+ *
* @param screenWidth
* @param screenHeight
* @param filename
@@ -175,12 +182,12 @@
//led寮�鍙戞澘瑙嗛鍒楄〃璇锋眰body
SetPlayList setPlayList = new SetPlayList();
- setPlayList.list[0] = "/data/data/com.xixun.xy.conn/files/local/abc/"+filename;
+ setPlayList.list[0] = "/data/data/com.xixun.xy.conn/files/local/abc/" + filename;
// setPlayList.pathList[0] = "";
- try{
+ try {
setPlayList.width = Integer.valueOf(screenWidth);
setPlayList.height = Integer.valueOf(screenHeight);
- }catch (Exception e){
+ } catch (Exception e) {
return;
}
String postBody = new Gson().toJson(setPlayList);
@@ -192,12 +199,13 @@
/**
* led灞忓瓧骞曡缃�
+ *
* @param subTitleSet
* @param ledCode
*/
- public void subTitleSet(SubTitleSet subTitleSet, String ledCode, Boolean isSave){
- String postBody = new Gson().toJson(subTitleSet);
- if(isSave == true){
+ public void subTitleSet(SubTitleSet subTitleSet, String ledCode, Boolean isSave) {
+ String postBody = new Gson().toJson(subTitleSet);
+ if (isSave == true) {
poleLightemitService.updateRequestBody(ledCode, postBody);
}
this.post(realtimeServerBean.getCommand() + ledCode, postBody);
@@ -334,24 +342,24 @@
//璇锋眰
String result = post(realtimeServerBean.getCommand() + ledCode, postBody);
- LogUtils.error("璁剧疆缁撴灉:-------------------"+result);
+ LogUtils.error("璁剧疆缁撴灉:-------------------" + result);
}
-// 鑾峰彇led闊抽噺
- public String getVoiume(String ledCode){
+ // 鑾峰彇led闊抽噺
+ public String getVoiume(String ledCode) {
GetVolume getVolume = new GetVolume();
String postBody = new Gson().toJson(getVolume);
//璇锋眰
- String result = post(realtimeServerBean.getCommand() + ledCode,postBody);
+ String result = post(realtimeServerBean.getCommand() + ledCode, postBody);
//璇锋眰
- if(StringUtils.isNotBlank(result)){
- try{
+ if (StringUtils.isNotBlank(result)) {
+ try {
return JSONObject.parseObject(result).get("result").toString();
- }catch (Exception e){
+ } catch (Exception e) {
return "0";
}
- }else{
+ } else {
return "0";
}
}
--
Gitblit v1.9.3