|
|
@@ -5,12 +5,16 @@ import cn.com.ctop.common.module.service.IRefreshTokenService;
|
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
|
|
|
+@Slf4j
|
|
|
@Component
|
|
|
public class ByteDanceRefreshTokenJob {
|
|
|
|
|
|
@@ -54,15 +58,42 @@ public class ByteDanceRefreshTokenJob {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 定时关停头条账户
|
|
|
+ */
|
|
|
+ @XxlJob("closeExpiredByteDanceAccountJob")
|
|
|
+ public void closeExpiredByteDanceAccountJob() {
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ String createTimeLimit = now.minusDays(3).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ int statDatetimeLimit = Integer.parseInt(now.minusDays(7).format(DateTimeFormatter.ofPattern("yyyyMMdd")));
|
|
|
+ int i = userAllocationService.closeExpiredByteDanceAccounts(createTimeLimit, statDatetimeLimit);
|
|
|
+ log.info("关停头条账户数:{}",i);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
- * 刷新token 千川
|
|
|
- * 待上线
|
|
|
+ * 定时关停头条账户
|
|
|
*/
|
|
|
- /* @XxlJob("qianChuanRefreshTokenJob")
|
|
|
- public void qianChuanRefresh() throws Exception {
|
|
|
- refreshTokenService.qianChuanRefresh(null);
|
|
|
- }*/
|
|
|
+ @XxlJob("closeExpiredKuaiShouAccountJob")
|
|
|
+ public void closeExpiredKuaiShouAccountJob() {
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ String createTimeLimit = now.minusDays(7).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ int statDatetimeLimit = Integer.parseInt(now.minusDays(15).format(DateTimeFormatter.ofPattern("yyyyMMdd")));
|
|
|
+ int i = userAllocationService.closeExpiredKuaiShouAccounts(createTimeLimit, statDatetimeLimit);
|
|
|
+ log.info("关停快手账户数:{}",i);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ String createTimeLimit = now.minusDays(7).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ int statDatetimeLimit = Integer.parseInt(now.minusDays(15).format(DateTimeFormatter.ofPattern("yyyyMMdd")));
|
|
|
+ System.err.println(createTimeLimit);
|
|
|
+ System.err.println(statDatetimeLimit);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|