@ -40,6 +40,7 @@ import org.springframework.web.multipart.MultipartFile;
@@ -40,6 +40,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File ;
import java.time.Duration ;
import java.time.LocalDateTime ;
import java.time.format.DateTimeFormatter ;
import java.util.List ;
import java.util.Map ;
import java.util.Objects ;
@ -231,7 +232,7 @@ public class ImContentServiceImpl extends ServiceImpl<ImContentMapper, ImContent
@@ -231,7 +232,7 @@ public class ImContentServiceImpl extends ServiceImpl<ImContentMapper, ImContent
. between ( ImContent : : getSendTime , startTime , endTime ) ) ;
// 检查是否大于发送次数
if ( StrUtil . equals ( SecurityUtils . < KiccUser > getUser ( ) . getSubscriber ( ) , SubscriberEnum . NON . getValue ( ) ) & & maxCount > 1 ) {
if ( StrUtil . equals ( SecurityUtils . < KiccUser > getUser ( ) . getSubscriber ( ) , SubscriberEnum . NON . getValue ( ) ) & & maxCount > openAiConfigProperties . getNonMaxCount ( ) ) {
throw new CheckedException ( String . format ( "普通订阅用户已超出当前最大速率限制,%s" , getLimitDuration ( startTime , endTime ) ) ) ;
} else if ( StrUtil . equals ( SecurityUtils . < KiccUser > getUser ( ) . getSubscriber ( ) , SubscriberEnum . BASIC . getValue ( ) ) & & maxCount > openAiConfigProperties . getBasicMaxCount ( ) ) {
throw new CheckedException ( String . format ( "基础订阅用户已超出当前最大速率限制,%s" , getLimitDuration ( startTime , endTime ) ) ) ;