package com.qaup.collision.datacollector.service;

import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class DataCleanupService {
//    private final MongoTemplate mongoTemplate;
//
//    @Scheduled(cron = "0 0 1 * * ?") // 每天凌晨1点执行
//    public void cleanupOldData() {
//        LocalDateTime threshold = LocalDateTime.now().minusDays(30);
//        Query query = Query.query(Criteria.where("createTime").lt(threshold));
//        DeleteResult result = mongoTemplate.remove(query, VehicleLocationDocument.class);
//        log.info("Cleaned up {} old location records", result.getDeletedCount());
//    }
}
