TASK:mixi;

This commit is contained in:
shahaibo
2024-08-28 16:47:33 +08:00
parent f2a7a8c774
commit 38325fedc1
3 changed files with 25 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ import com.mixi.common.config.FileProperties;
import com.mixi.common.config.exception.BusinessException;
import com.mixi.common.utils.AccessLimitUtils;
import com.mixi.mapper.TProductMapper;
import com.mixi.mapper.entity.QeFilling;
import com.mixi.mapper.entity.TProduct;
import com.mixi.model.dto.AIRecommendDTO;
import com.mixi.model.dto.GenerateCollocationDataBaseDTO;
@@ -568,7 +569,7 @@ public class PythonService {
return productList;
}
public JSONObject getAIRecommend(AIRecommendDTO aiRecommendDTO) {
public JSONObject getAIRecommend(QeFilling qeFilling) {
//限流校验
// AccessLimitUtils.validate("similarityMatch", 20);
OkHttpClient client = new OkHttpClient().newBuilder()
@@ -579,9 +580,16 @@ public class PythonService {
.build();
MediaType mediaType = MediaType.parse("application/json");
Map<String, Object> content = Maps.newHashMap();
content.put("input_message", "recommend four outfits");
content.put("user_id", aiRecommendDTO.getUserId());
content.put("image_urls", "");
content.put("user_id", qeFilling.getPhoneNum());
content.put("type", qeFilling.getType());
content.put("q1", qeFilling.getQ1());
content.put("q2", qeFilling.getQ2());
content.put("q3", qeFilling.getQ3());
content.put("q4", qeFilling.getQ4());
content.put("q5", qeFilling.getQ5());
content.put("q6", qeFilling.getQ6());
content.put("q7", qeFilling.getQ7());
content.put("q8", qeFilling.getQ8());
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content));
Request request = new Request.Builder()