|
@@ -35,22 +35,23 @@ public class AdRecommendController {
|
|
|
map.put("msg", "score error");
|
|
|
return map;
|
|
|
}
|
|
|
-
|
|
|
- AdRankItem rankResult = rankService.adItemRank(request);
|
|
|
-
|
|
|
- if (Objects.isNull(rankResult)) {
|
|
|
- map.put("code", "1");
|
|
|
- map.put("msg", "score error");
|
|
|
- return map;
|
|
|
+ try {
|
|
|
+ AdRankItem rankResult = rankService.adItemRank(request);
|
|
|
+ if (Objects.nonNull(rankResult)) {
|
|
|
+ map.put("code", "0");
|
|
|
+ map.put("msg", "success");
|
|
|
+ Map<String, Object> contentMap = new HashMap<>();
|
|
|
+ contentMap.put("adId", rankResult.getAdId());
|
|
|
+ contentMap.put("adScore", rankResult.getScore());
|
|
|
+ map.put("content", contentMap);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("模型排序异常: ", e);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- map.put("code", "0");
|
|
|
- map.put("msg", "success");
|
|
|
- Map<String, Object> contentMap = new HashMap<>();
|
|
|
- contentMap.put("adId", rankResult.getAdId());
|
|
|
- contentMap.put("adScore", rankResult.getScore());
|
|
|
- map.put("content", contentMap);
|
|
|
+ map.put("code", "1");
|
|
|
+ map.put("msg", "score error");
|
|
|
return map;
|
|
|
}
|
|
|
|