Przeglądaj źródła

直播间总台 直播间审核

yuhongqi 4 dni temu
rodzic
commit
b802545e25

+ 12 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveController.java

@@ -24,8 +24,7 @@ import java.util.Map;
  */
 @RestController
 @RequestMapping("/live/live")
-public class LiveController extends BaseController
-{
+public class LiveController extends BaseController {
     @Autowired
     private ILiveService liveService;
 
@@ -34,8 +33,7 @@ public class LiveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('live:live:list')")
     @GetMapping("/list")
-    public TableDataInfo list(Live live)
-    {
+    public TableDataInfo list(Live live) {
         startPage();
         List<Live> list = liveService.selectLiveList(live);
         return getDataTable(list);
@@ -47,8 +45,7 @@ public class LiveController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:live:export')")
     @Log(title = "直播", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(Live live)
-    {
+    public AjaxResult export(Live live) {
         List<Live> list = liveService.selectLiveList(live);
         ExcelUtil<Live> util = new ExcelUtil<Live>(Live.class);
         return util.exportExcel(list, "直播数据");
@@ -59,8 +56,7 @@ public class LiveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('live:live:query')")
     @GetMapping(value = "/{liveId}")
-    public AjaxResult getInfo(@PathVariable("liveId") Long liveId)
-    {
+    public AjaxResult getInfo(@PathVariable("liveId") Long liveId) {
         return AjaxResult.success(liveService.selectLiveByLiveId(liveId));
     }
 
@@ -70,8 +66,7 @@ public class LiveController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:live:add')")
     @Log(title = "直播", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody Live live)
-    {
+    public AjaxResult add(@RequestBody Live live) {
         return toAjax(liveService.insertLive(live));
     }
 
@@ -81,8 +76,7 @@ public class LiveController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:live:edit')")
     @Log(title = "直播", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody Live live)
-    {
+    public AjaxResult edit(@RequestBody Live live) {
         return toAjax(liveService.updateLive(live));
     }
 
@@ -91,9 +85,8 @@ public class LiveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('live:live:remove')")
     @Log(title = "直播", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{liveIds}")
-    public AjaxResult remove(@PathVariable Long[] liveIds)
-    {
+    @DeleteMapping("/{liveIds}")
+    public AjaxResult remove(@PathVariable Long[] liveIds) {
         return toAjax(liveService.deleteLiveByLiveIds(liveIds));
     }
 
@@ -102,4 +95,8 @@ public class LiveController extends BaseController
         return liveService.getLiveRoom(liveId);
     }
 
+    @PostMapping("/updateLiveIsAudit")
+    public Integer updateLiveIsAudit(@RequestBody Live live) {
+        return liveService.updateLive(live);
+    }
 }

+ 1 - 1
fs-live-app/src/main/java/com/fs/app/websocket/service/WebSocketServer.java

@@ -268,7 +268,7 @@ public class WebSocketServer {
     /**
      *定期将缓存的数据写入数据库
      */
-    @Scheduled(fixedRate = 60000) // 每分钟执行一次
+//    @Scheduled(fixedRate = 60000) // 每分钟执行一次
     public void syncLiveDataToDB() {
         List<LiveData> liveDatas = liveDataService.getAllLiveDatas(); // 获取所有正在直播的直播间数据
         if(liveDatas == null)

+ 4 - 2
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -205,8 +205,10 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
         if(live.getStatus() == 2){
             return R.ok().put("rtmpUrl", live.getRtmpUrl());
         }
-
-        if (live.getIsShow() != 1 || live.getIsAudit() != 1) {
+        if (live.getIsAudit() != 1) {
+            return R.error("您未通过审核");
+        }
+        if (live.getIsShow() != 1) {
             return R.error("您未拥有直播权限");
         }
         SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("living.config");