提交 5c27bce5 编写于 作者: Z zhengjie

add VisitsInitialization 启动时初始化站点统计

上级 baa9b7c6
package me.zhengjie.modules.monitor.config;
import me.zhengjie.modules.monitor.service.VisitsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
/**
* 初始化站点统计
* @author jie
*/
@Component
public class VisitsInitialization implements ApplicationRunner {
@Autowired
private VisitsService visitsService;
@Override
public void run(ApplicationArguments args) throws Exception {
System.out.println("--------------- 初始化站点统计,如果存在今日统计则跳过 ---------------");
visitsService.save();
System.out.println("--------------- 初始化站点统计完成 ---------------");
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册