|
@@ -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");
|