New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.zy.asrs.task.handler.ErpAccessTokenHandler; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | @Component |
| | | public class ErpAccessTokenScheduler { |
| | | |
| | | public static String accessToken = ""; |
| | | |
| | | @Autowired |
| | | private ErpAccessTokenHandler erpAccessTokenHandler; |
| | | |
| | | |
| | | |
| | | @PostConstruct |
| | | @Scheduled(cron = "10 15,30,45,59 * * * ?") |
| | | private void accessToken(){ |
| | | erpAccessTokenHandler.getAccessToken(); |
| | | } |
| | | } |