fix(push): add OPPO delivery diagnostics

这个提交包含在:
XuqmGroup 2026-07-13 17:14:28 +08:00
父节点 71975e8b7c
当前提交 b20bb12091

查看文件

@ -59,6 +59,7 @@ public class OppoPushProvider implements PushProvider {
String messageId = appKey + "_" + System.currentTimeMillis();
Map<String, Object> notification = new java.util.LinkedHashMap<>();
notification.put("app_message_id", messageId);
notification.put("style", 1);
notification.put("title", title);
notification.put("content", body);
notification.put("click_action_type", 0);
@ -86,6 +87,9 @@ public class OppoPushProvider implements PushProvider {
JsonNode json = objectMapper.readTree(response.body());
int code = json.path("code").asInt(-1);
if (response.statusCode() == 200 && code == 0) {
String vendorMessageId = json.path("data").path("messageId").asText("");
log.info("OPPO push accepted: appMessageId={} vendorMessageId={} channelId={} target={} response={}",
messageId, vendorMessageId, channelId, maskToken(token), response.body());
return true;
}
log.error("OPPO push rejected: httpStatus={} code={} message={}",
@ -139,6 +143,13 @@ public class OppoPushProvider implements PushProvider {
return java.util.HexFormat.of().formatHex(digest);
}
private static String maskToken(String token) {
if (token == null || token.length() <= 16) {
return "***";
}
return token.substring(0, 8) + "..." + token.substring(token.length() - 8);
}
private String normalizeActionParameters(String payload) throws Exception {
JsonNode parsed = runCatchingJson(payload);
if (parsed != null && parsed.isObject()) {