//package com.red.circle.wallet.app.scheduler;
//
//import com.red.circle.component.redis.annotation.TaskCacheLock;
//import com.red.circle.framework.mybatis.constant.PageConstant;
//import com.red.circle.tool.core.date.DateUtils;
//import com.red.circle.wallet.infra.database.rds.entity.WalletGoldAssetRecord;
//import com.red.circle.wallet.infra.database.rds.service.WalletGoldAssetRecordService;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
///**
// * 移除历史钱包资产.
// *
// * @author pengliang on 2023/9/27
// */
//@Slf4j
//@Component
//@RequiredArgsConstructor
//public class DelHistoryWalletGoldAssetRecordTask {
//
//  private final WalletGoldAssetRecordService walletGoldAssetRecordService;
//
//  /**
//   * 10分钟检查一次.
//   */
//  @Scheduled(cron = "0 */10 * * * ?")
//  @TaskCacheLock(key = "CHECK_WALLET_GOLD_EXECUTE", expireSecond = 60 * 3)
//  public void execute() {
//
//    // 移除上个月数据
//    walletGoldAssetRecordService.delete()
//        .le(WalletGoldAssetRecord::getCreateTime,
//            DateUtils.setDateTime(DateUtils.lastDayOfLastMonth(), 23, 59, 59))
//        .last(PageConstant.formatLimit(1000000))
//        .execute();
//
//
//    // optimize table
//  }
//
//
//}
