|
|
|
@ -7,10 +7,13 @@ import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.sztzjy.marketing.entity.StuAiLimit;
|
|
|
|
|
import com.sztzjy.marketing.entity.StuAiLimitExample;
|
|
|
|
|
import com.sztzjy.marketing.entity.StuUploadImgAi;
|
|
|
|
|
import com.sztzjy.marketing.entity.StuUploadImgAiExample;
|
|
|
|
|
import com.sztzjy.marketing.entity.dto.ReqChatMessage;
|
|
|
|
|
import com.sztzjy.marketing.entity.dto.StuCreateArticleDTO;
|
|
|
|
|
import com.sztzjy.marketing.entity.dto.StuCreateImgDTO;
|
|
|
|
|
import com.sztzjy.marketing.mapper.StuAiLimitMapper;
|
|
|
|
|
import com.sztzjy.marketing.mapper.StuUploadImgAiMapper;
|
|
|
|
|
import com.sztzjy.marketing.qianfan.Qianfan;
|
|
|
|
|
import com.sztzjy.marketing.qianfan.model.chat.ChatResponse;
|
|
|
|
|
import com.sztzjy.marketing.qianfan.model.chat.Message;
|
|
|
|
@ -28,7 +31,9 @@ import org.apache.http.client.methods.HttpPost;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.core.task.AsyncTaskExecutor;
|
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
import reactor.core.publisher.Flux;
|
|
|
|
|
|
|
|
|
@ -191,6 +196,31 @@ public class QianFanBigModuleServiceImpl implements QianFanBigModuleService {
|
|
|
|
|
return (chat(accesstoken,messageList));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取文件上传信息
|
|
|
|
|
* @param userId
|
|
|
|
|
* @param module
|
|
|
|
|
* @param schoolId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private StuUploadImgAiMapper stuUploadImgAiMapper;
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getUploadFileInfo(String userId, String module, String schoolId) {
|
|
|
|
|
StuUploadImgAiExample limitExample = new StuUploadImgAiExample();
|
|
|
|
|
limitExample.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module);
|
|
|
|
|
List<StuUploadImgAi> stuAiLimits = stuUploadImgAiMapper.selectByExample(limitExample);
|
|
|
|
|
if (CollectionUtils.isEmpty(stuAiLimits))
|
|
|
|
|
{
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
}else {
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,stuAiLimits);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取accessToken
|
|
|
|
|
public String getAccesstoken() throws IOException {
|
|
|
|
|
|
|
|
|
|