فهرست منبع

-0721 解决直播间多次洗稿会出现积分扣为负数还可以一直调用的bug

song 5 ماه پیش
والد
کامیت
4ae0531145

+ 4 - 0
ai-config-server-live/src/main/java/org/spring/ai/config/server/controller/chat/ChatRewriterController.java

@@ -128,6 +128,10 @@ public class ChatRewriterController {
         Integer liveId = rewriteReq.getLiveId();
         String originalContent = rewriteReq.getOriginalContent();
         Integer accountId = redisUtils.getAccountId(req.getToken());
+        Account account = accountService.getById(accountId);
+        if (account.getSurplusTokens() <= 0) {
+            return Result.error("积分余额不足,请充值");
+        }
         redisUtils.setRewriteProcess(liveId, NumberUtils.INTEGER_ZERO);
         List<RewriteRecord> list = rewriteRecordService.list(Wrappers.<RewriteRecord>lambdaQuery().eq(RewriteRecord::getLiveId, liveId));
         if (!list.isEmpty()) {

+ 19 - 0
null

@@ -0,0 +1,19 @@
+ava
+package org.spring.ai.config.server.controller.entity.req;
+
+import org.spring.ai.config.biz.crud.entity.PromoteSpeech;
+
+import java.util.List;
+
+public class SavePromoteSpeechReq {
+    private List<PromoteSpeech> promoteSpeechList;
+
+    // Getter and Setter
+    public List<PromoteSpeech> getPromoteSpeechList() {
+        return promoteSpeechList;
+    }
+
+    public void setPromoteSpeechList(List<PromoteSpeech> promoteSpeechList) {
+        this.promoteSpeechList = promoteSpeechList;
+    }
+}