|
|
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.server.ResponseStatusException;
|
|
|
|
|
|
import java.time.Instant;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.LinkedHashMap;
|
|
|
@@ -170,6 +171,8 @@ public class HonorTrackingController {
|
|
|
bidReq.put("reqId", traceId + "-" + Instant.now().toEpochMilli());
|
|
|
bidReq.put("imp", List.of(imp));
|
|
|
bidReq.put("device", device);
|
|
|
+ List<Integer> appList = parseAppList(firstParam(params, "appList", "app_list", "applist"));
|
|
|
+ if (!appList.isEmpty()) bidReq.put("appList", appList);
|
|
|
return bidReq;
|
|
|
}
|
|
|
|
|
|
@@ -262,6 +265,21 @@ public class HonorTrackingController {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ private List<Integer> parseAppList(String value) {
|
|
|
+ if (value == null || value.isBlank()) return Collections.emptyList();
|
|
|
+ List<Integer> result = new ArrayList<>();
|
|
|
+ for (String part : value.split("[,|]")) {
|
|
|
+ String item = part == null ? null : part.trim();
|
|
|
+ if (item == null || item.isEmpty()) continue;
|
|
|
+ try {
|
|
|
+ result.add(Integer.parseInt(item));
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ log.warn("[Honor] 忽略非法 appList 值 | raw={} | item={}", value, item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
private static void putUid(Map<String, Object> uid, String key, String value) {
|
|
|
if (value != null && !value.isBlank()) uid.put(key, value);
|
|
|
}
|