|
@@ -28,6 +28,7 @@ import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service
|
|
@Service
|
|
@@ -85,8 +86,8 @@ public class GameTencentMiniGameBackLogServiceImpl extends ServiceImpl<GameTence
|
|
TencentMiniGameBackRequest request = TencentMiniGameBackRequest.builder()
|
|
TencentMiniGameBackRequest request = TencentMiniGameBackRequest.builder()
|
|
.actions(Collections.singletonList(TencentMiniGameBackRequest.Action.builder()
|
|
.actions(Collections.singletonList(TencentMiniGameBackRequest.Action.builder()
|
|
.action_time(DateUtil.localDateTimeToSecond(backLog.getActionTime()))
|
|
.action_time(DateUtil.localDateTimeToSecond(backLog.getActionTime()))
|
|
- .user_id(UserActionRpcDTO.UserIdRpcDTO.builder().wechatAppId(backLog.getWechatAppId()).wechatOpenid(backLog.getWechatOpenid()).build())
|
|
|
|
- .trace(UserActionRpcDTO.TraceRpcDTO.builder().clickId(backLog.getClickId()).build())
|
|
|
|
|
|
+ .user_id(TencentMiniGameBackRequest.UserId.builder().wechat_app_id(backLog.getWechatAppId()).wechat_openid(backLog.getWechatOpenid()).build())
|
|
|
|
+ .trace(TencentMiniGameBackRequest.Trace.builder().click_id(backLog.getClickId()).build())
|
|
.account_id(backLog.getAdAccountId())
|
|
.account_id(backLog.getAdAccountId())
|
|
.action_set_id(null)
|
|
.action_set_id(null)
|
|
.action_type(backLog.getActionType())
|
|
.action_type(backLog.getActionType())
|
|
@@ -94,10 +95,14 @@ public class GameTencentMiniGameBackLogServiceImpl extends ServiceImpl<GameTence
|
|
.build()))
|
|
.build()))
|
|
.build();
|
|
.build();
|
|
try {
|
|
try {
|
|
|
|
+ log.error("腾讯小游戏回传参数:{}", JsonUtil.toString(request));
|
|
ResponseEntity<Map> response = restTemplate.postForEntity("http://tracking.e.qq.com/conv", request, Map.class);
|
|
ResponseEntity<Map> response = restTemplate.postForEntity("http://tracking.e.qq.com/conv", request, Map.class);
|
|
|
|
+ log.error("腾讯小游戏回传完成:{}", JsonUtil.toString(response.getBody()));
|
|
if (response.getStatusCode().is2xxSuccessful()) {
|
|
if (response.getStatusCode().is2xxSuccessful()) {
|
|
- backLog.setBackStatus(BackStatusEnum.SUCCESS.getBackStatus());
|
|
|
|
- return;
|
|
|
|
|
|
+ if (Objects.equals(response.getBody().get("code").toString(), "0")) {
|
|
|
|
+ backLog.setBackStatus(BackStatusEnum.SUCCESS.getBackStatus());
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
backLog.setBackStatus(BackStatusEnum.FAILED.getBackStatus());
|
|
backLog.setBackStatus(BackStatusEnum.FAILED.getBackStatus());
|
|
backLog.setErrMsg(JsonUtil.toString(response.getBody()));
|
|
backLog.setErrMsg(JsonUtil.toString(response.getBody()));
|
|
@@ -124,8 +129,8 @@ public class GameTencentMiniGameBackLogServiceImpl extends ServiceImpl<GameTence
|
|
|
|
|
|
private Long action_time;
|
|
private Long action_time;
|
|
|
|
|
|
- private UserActionRpcDTO.UserIdRpcDTO user_id;
|
|
|
|
- private UserActionRpcDTO.TraceRpcDTO trace;
|
|
|
|
|
|
+ private UserId user_id;
|
|
|
|
+ private Trace trace;
|
|
|
|
|
|
private Long account_id;
|
|
private Long account_id;
|
|
|
|
|
|
@@ -135,5 +140,25 @@ public class GameTencentMiniGameBackLogServiceImpl extends ServiceImpl<GameTence
|
|
|
|
|
|
private Map<String, Object> action_param;
|
|
private Map<String, Object> action_param;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Data
|
|
|
|
+ @NoArgsConstructor
|
|
|
|
+ @AllArgsConstructor
|
|
|
|
+ @Builder
|
|
|
|
+ public static class UserId {
|
|
|
|
+
|
|
|
|
+ private String wechat_app_id;
|
|
|
|
+
|
|
|
|
+ private String wechat_openid;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Data
|
|
|
|
+ @NoArgsConstructor
|
|
|
|
+ @AllArgsConstructor
|
|
|
|
+ @Builder
|
|
|
|
+ public static class Trace {
|
|
|
|
+ private String click_id;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|