package com.xinelu.quartz.controller;

import com.xinelu.quartz.task.PaymentInfoTask;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description 手动处理支付定时任务控制器
 * @Author 纪寒
 * @Date 2022-10-21 15:11:38
 * @Version 1.0
 */
@RestController
@RequestMapping("/monitor/payTask")
public class PaymentInfoTaskController {

    @Resource
    private PaymentInfoTask paymentInfoTask;

    /**
     * 手动执行关闭订单定时任务
     *
     * @throws Exception 异常信息
     */
    @GetMapping("/handCloseOrder")
    public void handCloseOrder() throws Exception {
        paymentInfoTask.automaticOrderTask();
    }

    /**
     * 手动执行更新订单状态定时任务
     *
     * @throws Exception 异常信息
     */
    @GetMapping("/handOrderStatus")
    public void handOrderStatus() throws Exception {
        paymentInfoTask.automaticUpdateOrderStatusTask();
    }
}
