|
|
@@ -70,10 +70,19 @@ public class BytedancePushDataController {
|
|
|
projectExecutorService.submit(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- String token = bytedanceProjectService.getTokenByAccountId(advertiserId);
|
|
|
- if (!Check.isNull(token)) {
|
|
|
+ JSONObject tokenJson = bytedanceProjectService.getTokenByAccountId(advertiserId);
|
|
|
+ if (!Check.isNull(tokenJson)) {
|
|
|
Map<Long, JSONObject> projectMap = new HashMap<>();
|
|
|
- bytedanceProjectService.getPromotionList(advertiserId, token, ids, projectMap, 1);
|
|
|
+ String accessToken = tokenJson.getString("accessToken");
|
|
|
+ Integer accountStatus = tokenJson.getInteger("accountStatus");
|
|
|
+ if (!Check.isNull(accountStatus)) {
|
|
|
+ if (accountStatus == 0) {
|
|
|
+ bytedanceProjectService.getPromotionList(advertiserId, accessToken, ids, projectMap, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -91,19 +100,19 @@ public class BytedancePushDataController {
|
|
|
@ResponseBody
|
|
|
public void test(HttpServletRequest request, @RequestParam(value = "challenge", defaultValue = "0") int challenge, @RequestParam(value = "event", defaultValue = "") String event, @RequestParam(value = "appId", defaultValue = "") String appId) throws IOException {
|
|
|
|
|
|
- // bytedanceProjectService.sendAuthFailure(1847120413784843L);
|
|
|
- String token = bytedanceProjectService.getTokenByAccountId(1842948124549184L);
|
|
|
+ // bytedanceProjectService.sendAuthFailure(1847120413784843L);
|
|
|
+ JSONObject token = bytedanceProjectService.getTokenByAccountId(1842948124549184L);
|
|
|
|
|
|
List<Long> list = new ArrayList<>();
|
|
|
list.add(7570918730826416178L);
|
|
|
- // list.add(7566848458911367211L);
|
|
|
+ // list.add(7566848458911367211L);
|
|
|
|
|
|
|
|
|
Map<Long, JSONObject> projectMap = new HashMap<>();
|
|
|
List<List<Long>> partitions = Lists.partition(list, 20);
|
|
|
for (int i = 0; i < partitions.size(); i++) {
|
|
|
List<Long> ids = partitions.get(i);
|
|
|
- bytedanceProjectService.getPromotionList(1842948124549184L, token, ids, projectMap, 1);
|
|
|
+ bytedanceProjectService.getPromotionList(1842948124549184L, token.getString("accessToken"), ids, projectMap, 1);
|
|
|
|
|
|
}
|
|
|
}
|