diff --git a/src/main/java/com/yutou/tools/ToolsApplication.java b/src/main/java/com/yutou/tools/ToolsApplication.java index c1b6367..6804134 100644 --- a/src/main/java/com/yutou/tools/ToolsApplication.java +++ b/src/main/java/com/yutou/tools/ToolsApplication.java @@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ToolsApplication { - public static final String version="1.4.4.6"; + public static final String version="1.4.5"; public static void main(String[] args) { System.out.println("当前版本号:" + version); diff --git a/src/main/java/com/yutou/tools/bangumi/AnimMetaController.java b/src/main/java/com/yutou/tools/bangumi/AnimMetaController.java new file mode 100644 index 0000000..42081fd --- /dev/null +++ b/src/main/java/com/yutou/tools/bangumi/AnimMetaController.java @@ -0,0 +1,57 @@ +package com.yutou.tools.bangumi; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yutou.tools.nas.UpdateIp; +import com.yutou.tools.utils.HttpTools; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.nio.charset.StandardCharsets; + +@Controller +public class AnimMetaController { + @RequestMapping("/anim/meta/get.do") + @ResponseBody + public JSONArray getAnimMeta() { + String ret = HttpTools.get("http://" + UpdateIp.nas_ip + ":8000/tools/anim/items.do"); + JSONArray array = new JSONArray(); + if (ret != null) { + JSONArray metas = JSONArray.parseArray(ret); + for (Object _meta : metas) { + JSONObject meta = (JSONObject) _meta; + JSONObject item = new JSONObject(); + item.put("title", meta.getString("name")); + item.put("id", meta.getString("root")); + if (meta.getInteger("size") > 1) { + JSONArray _tmp = new JSONArray(); + for (Object _path : meta.getJSONArray("path")) { + JSONObject children = new JSONObject(); + JSONObject path = (JSONObject) _path; + children.put("title", path.getString("name")); + children.put("id", path.getString("path") == null ? meta.getString("root") : path.getString("path")); + _tmp.add(children); + item.put("children", _tmp); + } + } + array.add(item); + } + } + return array; + } + + @ResponseBody + @RequestMapping(value = "/anim/meta/set.do", method = RequestMethod.POST) + public JSONObject setAnimMeta(String path, String id) { + JSONObject item = new JSONObject(); + item.put("path", path); + item.put("id", id); + String ret = HttpTools.post("http://" + UpdateIp.nas_ip + ":8000/tools/anim/set.do", HttpTools.toUrlParams(item).getBytes(StandardCharsets.UTF_8)); + JSONObject json = new JSONObject(); + json.put("code", 0); + json.put("msg", ret); + return json; + } +} diff --git a/src/main/java/com/yutou/tools/utils/HttpTools.java b/src/main/java/com/yutou/tools/utils/HttpTools.java index 445cf01..ad8e603 100644 --- a/src/main/java/com/yutou/tools/utils/HttpTools.java +++ b/src/main/java/com/yutou/tools/utils/HttpTools.java @@ -10,6 +10,7 @@ import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.Set; @@ -109,16 +110,16 @@ public class HttpTools { return "/KUKU_APP(Android/#/cn.kuku.sdk/ttsdk17228/29401/A-2.9.4.01.KUSDK/868139039134314/fcddf839c8c135fa/F4:60:E2:AB:25:1A/460019406520644/+8618569400341/#/9/Redmi 6 Pro/xiaomi/1736/76fda4d6-cd6b-485f-987b-8d347b007f24/#/KUKU/Native/92972ea9651fbd2e)"; } - public String toUrlParams(JSONObject json) { + public static String toUrlParams(JSONObject json) { StringBuilder string = new StringBuilder(); Set keys = json.keySet(); for (String key : keys) { try { - string.append("&").append(key).append("=").append(URLEncoder.encode(json.getString(key), "UTF-8")); + string.append("&").append(key).append("=").append(URLEncoder.encode(json.getString(key), StandardCharsets.UTF_8)); } catch (Exception e) { e.printStackTrace(); try { - string.append("&").append(URLEncoder.encode(key, "UTF-8")).append("="); + string.append("&").append(URLEncoder.encode(key, StandardCharsets.UTF_8)).append("="); // string += "&" + key + "="; } catch (Exception e1) { string.append("&").append(key).append("="); diff --git a/web/css/my.css b/web/css/my.css new file mode 100644 index 0000000..c9e45bc --- /dev/null +++ b/web/css/my.css @@ -0,0 +1 @@ +.mybody{left: 200px;overflow:auto;} \ No newline at end of file diff --git a/web/html/body/nas/animMeta.html b/web/html/body/nas/animMeta.html new file mode 100644 index 0000000..65e4e93 --- /dev/null +++ b/web/html/body/nas/animMeta.html @@ -0,0 +1,64 @@ + + + + + + + 动画元数据设置 + + + + +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/web/html/body/nas/ip.html b/web/html/body/nas/ip.html index 9c88630..c78efcc 100644 --- a/web/html/body/nas/ip.html +++ b/web/html/body/nas/ip.html @@ -1,5 +1,5 @@ - + @@ -22,7 +22,7 @@