package com.weiqi.mis.contorller;

import com.weiqi.mis.MsgService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RestController;

@Component
@Configurable
@EnableScheduling
@RestController

/**
 *
 */
public class ScheduledTasks {
    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    MsgService msgService;

    /**
     * 一小时缓存失效一次
     */
    @Scheduled(cron = "0 0 0/1 * * ? ")
    public void addinfoCron() {
        msgService.addinfo();
    }

    /**
     * 定期更新订单表数据
     *
     */
    @Scheduled(cron = "0 0/1 * * * ? ")
    public void setorderInfoCron() {
        msgService.setorderInfo();
    }

}
