Selaa lähdekoodia

feat:添加日志

zhaohaipeng 6 kuukautta sitten
vanhempi
commit
c03a13d8cb

+ 9 - 3
ad-engine-server/src/main/java/com/tzld/piaoquan/ad/engine/server/controller/AdRecommendController.java

@@ -14,9 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 @RestController
 @RequestMapping("/recommend")
@@ -30,6 +28,14 @@ public class AdRecommendController {
     @RequestMapping("/top1/basic")
     public Map<String, Object> adRecommendTop1Basic(@RequestBody RankRecommendRequestParam request) {
         Map<String, Object> map = new HashMap<>();
+
+        List<AdPlatformCreativeDTO> adIdList = request.getAdIdList();
+        if (adIdList.size() > 5) {
+            List<AdPlatformCreativeDTO> newAdIdList = new ArrayList<>(5);
+            newAdIdList.addAll(adIdList.subList(0, 6));
+            request.setAdIdList(newAdIdList);
+        }
+
         if (CollectionUtils.isEmpty(request.getAdIdList())) {
             map.put("code", "1");
             map.put("msg", "score error");