package com.cf.imes.module.executor.service.order.intervalometer;

import com.cf.imes.framework.organ.core.context.OrganContextHolder;
import com.cf.imes.framework.organ.core.job.OrganJob;
import com.cf.imes.module.executor.service.order.OrderService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;

/**
 * 订单定时处理器
 */
@Slf4j
@Component
public class OrderInvalidCleanJob {

    @Resource
    private OrderService orderService;

    @XxlJob("orderInvalidCleanJob")
    @OrganJob
    public void execute() {
        orderService.expireByOrganId(OrganContextHolder.getOrganId());
    }
}
