@ -1,5 +1,6 @@
@@ -1,5 +1,6 @@
package com.cloud.kicc.system.service.impl ;
import cn.hutool.core.convert.Convert ;
import cn.hutool.core.io.FileUtil ;
import cn.hutool.core.util.IdUtil ;
import cn.hutool.core.util.StrUtil ;
@ -67,7 +68,7 @@ public class ImContentServiceImpl extends ServiceImpl<ImContentMapper, ImContent
@@ -67,7 +68,7 @@ public class ImContentServiceImpl extends ServiceImpl<ImContentMapper, ImContent
@Override
@Transactional ( rollbackFor = Exception . class )
@SneakyThrows
public ImContent completions ( ImContent imContent , MultipartFile file ) {
public Map < String , Object > completions ( ImContent imContent , MultipartFile file ) {
SecurityUtils . openInterfaceTemporaryLoginSession ( imContent . getSendUserId ( ) ) ;
if ( imContent . getContentType ( ) . equals ( ImMessageTypeEnum . AUDIO . getValue ( ) ) ) {
Optional . ofNullable ( file ) . orElseThrow ( ( ) - > new CheckedException ( "当前语音文件为空,请检查后重试!" ) ) ;
@ -133,14 +134,17 @@ public class ImContentServiceImpl extends ServiceImpl<ImContentMapper, ImContent
@@ -133,14 +134,17 @@ public class ImContentServiceImpl extends ServiceImpl<ImContentMapper, ImContent
fileService . save ( receiveOssOssFile ) ;
// 保存AI回复聊天记录
imC ontent. setFiles ( receiveOssOssFile . getId ( ) ) ;
c ontent. setFiles ( receiveOssOssFile . getId ( ) ) ;
super . save ( content ) ;
return content ;
Map < String , Object > result = Convert . toMap ( String . class , Object . class , content ) ;
result . putAll ( Convert . toMap ( String . class , Object . class , receiveOssOssFile ) ) ;
return result ;
} else {
// 保存AI回复聊天记录
ImContent content = askChatCompletion ( imContent ) ;
super . save ( content ) ;
return content ;
return Convert . toMap ( String . class , Object . class , content ) ;
}
}