package com.m2pool.pool.task;

import com.m2pool.pool.entity.BlockInfo;
import com.m2pool.pool.mapper.PoolMapper;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;

import static com.m2pool.pool.utils.dome4j.*;

/**
 * @Description TODO
 * @Date 2025/9/28 09:39
 * @Author yyb
 */
@Configuration
@EnableScheduling
public class XtmBlockInfoTask {

    @Resource
    private PoolMapper poolMapper;

    @Scheduled(cron = "0 0/10 * * * ?")
    public void Sha3xBlockInfoToDB(){
        BlockInfo xtmBlockInfoForXml = getSha3xBlockInfoForXml();
        //入库
        int i = poolMapper.insertXtmBlockInfo(xtmBlockInfoForXml);
        if (i > 0){
            System.out.println("sha3x信息入库成功");
        }

    }
}
