From 38854993d0cfe79e54965839792b6c684d2b1211 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 27 Nov 2024 18:06:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=89=B9=E9=87=8F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/html/ui/createConfig.html | 14 +++++++------- Web/html/ui/userFollow.html | 2 +- Web/html/ui/userFollowLive.html | 2 +- .../com/yutou/biliapi/bean/live/FollowLive.java | 2 +- .../Controllers/LiveConfigController.java | 16 ++++++++++++---- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Web/html/ui/createConfig.html b/Web/html/ui/createConfig.html index adacb38..deb3d1b 100644 --- a/Web/html/ui/createConfig.html +++ b/Web/html/ui/createConfig.html @@ -32,13 +32,13 @@
- - - - - - - + + + + + + +
diff --git a/Web/html/ui/userFollow.html b/Web/html/ui/userFollow.html index c5f4730..7f086e8 100644 --- a/Web/html/ui/userFollow.html +++ b/Web/html/ui/userFollow.html @@ -46,7 +46,7 @@ elem: '#followList', url: '/live/config/follow?userId=' + userId, toolbar: '#toolbarDemo', - height: '350px', + height: 'full', totalRow: true, // 开启合计行 page: true, response: { diff --git a/Web/html/ui/userFollowLive.html b/Web/html/ui/userFollowLive.html index 56e4f57..6e8277f 100644 --- a/Web/html/ui/userFollowLive.html +++ b/Web/html/ui/userFollowLive.html @@ -38,7 +38,7 @@ elem: '#followList', url: '/live/config/followLive?userId=' + userId, toolbar: '#toolbarDemo', - height: '350px', + height: 'full', totalRow: false, // 开启合计行 page: false, response: { diff --git a/src/main/java/com/yutou/biliapi/bean/live/FollowLive.java b/src/main/java/com/yutou/biliapi/bean/live/FollowLive.java index 96711b6..b6d34dd 100644 --- a/src/main/java/com/yutou/biliapi/bean/live/FollowLive.java +++ b/src/main/java/com/yutou/biliapi/bean/live/FollowLive.java @@ -25,7 +25,7 @@ public class FollowLive extends BaseBean { private String roomId; @JSONField(name = "uid") - private int uid; + private String uid; @JSONField(name = "online") private int online; diff --git a/src/main/java/com/yutou/bilibili/Controllers/LiveConfigController.java b/src/main/java/com/yutou/bilibili/Controllers/LiveConfigController.java index 6413236..8b33ffa 100644 --- a/src/main/java/com/yutou/bilibili/Controllers/LiveConfigController.java +++ b/src/main/java/com/yutou/bilibili/Controllers/LiveConfigController.java @@ -140,13 +140,20 @@ public class LiveConfigController { @RequestMapping(value = "set/array", method = RequestMethod.POST) @ResponseBody public JSONObject addArrayConfig(@RequestBody JSONObject jsonObject) { - LiveConfigDatabaseBean bean = jsonObject.getJSONObject("config").to(LiveConfigDatabaseBean.class); + JSONObject config=jsonObject.getJSONObject("config"); + LiveConfigDatabaseBean bean = config.to(LiveConfigDatabaseBean.class); if (!bean.verifyLiveTimer()) { return ResultData.fail(ReturnCode.RC999.getCode(), "视频录制时间格式错误"); } if (!bean.verifyDanmuTimer()) { return ResultData.fail(ReturnCode.RC999.getCode(), "弹幕录制时间格式错误"); } + if("on".equals(config.getString("recordDanmu"))){ + bean.setRecordDanmu(true); + } + if("on".equals(config.getString("recordLive"))){ + bean.setRecordLive(true); + } JSONArray jsonArray = jsonObject.getJSONArray("array"); List list = jsonArray.stream().map(roomId -> configService.addConfig(roomId.toString(), bean)).toList(); int countNull = list.stream().filter(Objects::isNull).toList().size(); @@ -160,16 +167,17 @@ public class LiveConfigController { int countNull = list.stream().filter(it -> !it).toList().size(); return ResultData.success("成功删除" + (list.size() - countNull) + "个直播间"); } + @RequestMapping(value = "delete/all", method = RequestMethod.GET) @ResponseBody public JSONObject deleteAllConfig() { for (LiveConfigDatabaseBean bean : configService.getAllConfig()) { configService.deleteConfig(bean.getRoomId()); } - if(configService.getAllConfig().isEmpty()) { + if (configService.getAllConfig().isEmpty()) { return ResultData.success("成功删除"); - }else{ - return ResultData.fail(-1,"删除失败,剩余:"+configService.getAllConfig().size()+"个直播间"); + } else { + return ResultData.fail(-1, "删除失败,剩余:" + configService.getAllConfig().size() + "个直播间"); } }