package com.thinkgem.jeesite.modules.pay.service;


import com.thinkgem.jeesite.modules.user.service.UserApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;


@Service
@Lazy(false)
public class TimingService {
    @Autowired
    private PayApiService payApiService;

    @Autowired
    private UserApiService userApiService;


    @Scheduled(cron = "0 0 0/1 * * ?")
    public void updateOrders(){
        payApiService.updateOrderTiming();
        payApiService.updateOrders();
    }

    @Scheduled(cron = "0 0/5 * * * ? ")
    public void updateUserGrade(){
        userApiService.updateUserLevel();
    }
}
