package com.datacenter.job;

import com.datacenter.service.StatCopyTradePositionService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class CopyTradePositionJob {

    private final StatCopyTradePositionService statCopyTradePositionService;

    @Scheduled(cron = "0 5 * * * *")
    public void run() {
        log.info("[CopyTradePositionJob] 定时任务触发");
        statCopyTradePositionService.computeAndSave();
    }
}
