Ver Fonte

报错问题解决

yuhongqi há 1 mês atrás
pai
commit
97bf3b68a9

+ 5 - 1
fs-service-system/src/main/java/com/fs/live/service/impl/LiveCompletionPointsRecordServiceImpl.java

@@ -342,12 +342,16 @@ public class LiveCompletionPointsRecordServiceImpl implements ILiveCompletionPoi
                     continuousDays = 1;
                 }
             }
+            LiveCompletionPointsRecord record = new LiveCompletionPointsRecord();
+
+            if (config.getScoreAmount() == null) {
+                return record;
+            }
 
             // 8. 计算积分
             int points = Math.toIntExact(config.getScoreAmount());
 
             // 9. 创建完课记录
-            LiveCompletionPointsRecord record = new LiveCompletionPointsRecord();
             record.setLiveId(liveId);
             record.setUserId(userId);
             record.setWatchDuration(actualWatchDuration);

+ 2 - 0
fs-user-app/src/main/java/com/fs/app/controller/LiveGoodsController.java

@@ -1,5 +1,6 @@
 package com.fs.app.controller;
 
+import com.fs.app.annotation.Login;
 import com.fs.common.annotation.Log;
 import com.fs.common.constant.LiveKeysConstant;
 import com.fs.common.core.controller.BaseController;
@@ -135,6 +136,7 @@ public class LiveGoodsController extends AppBaseController
      * 获取直播店铺
      * */
     @GetMapping("/liveStore/{liveId}")
+    @Login
     public R liveGoodsStore(@PathVariable Long liveId,@RequestParam String key)
     {