package com.gree.mall.manager.schedule;

import com.gree.mall.manager.logic.goods.GoodsLibraryLogic;
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 java.net.MalformedURLException;

/**
 * 同步商品库
 * @author ：lijh
 * @description：TODO
 * @date ：2024/5/6 10:02
 */
@ConditionalOnProperty(name = "schedule.enable", havingValue = "true", matchIfMissing = true)
@Component
public class SyncGoodsLibrarySchedule {

    @Autowired
    GoodsLibraryLogic goodsLibraryLogic;

    @Scheduled(cron = "0 0 5 * * ?")
    public void sync() throws MalformedURLException {
        goodsLibraryLogic.sync();
    }
}
