From ba879fab2dbe7af5b08f577a498ee4abec2acdf4 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 27 Jul 2023 10:38:52 +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