From c0e5c1f671f928161c28e93d00be40aa2a74ebc0 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Fri, 28 Jul 2023 10:23:33 +0800 Subject: [PATCH] 赠送积分更新状态 --- src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java b/src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java index 019e9f1..803c177 100644 --- a/src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java +++ b/src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.exceptions.ApiException; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; @@ -22,6 +23,7 @@ @Slf4j @Component +@ConditionalOnProperty(prefix = "system", name = "job", havingValue = "true") public class WxxcxJob { private final XcxProperties xcxProperties = SpringContextHolder.getBean(XcxProperties.class); @@ -30,13 +32,14 @@ private RedisUtils redisUtils; @Resource RestTemplate restTemplate; - @Autowired - private SpringContextHolder springContextHolder; +// @Autowired +// private SpringContextHolder springContextHolder; /** * 获取access_token * 有效期两小时 */ @Scheduled(cron = "0 0 0/1 * * ? ") +// @Scheduled(cron = "0 0/1 * * * ? ") public void getAccessToken() throws IOException { String appId = xcxProperties.getXcxAppid(); String appSecret = xcxProperties.getXcxSecret(); -- Gitblit v1.9.1