package com.keao.edu.user.controller;

import com.keao.edu.common.controller.BaseController;
import com.keao.edu.user.service.ExamRegistrationPaymentService;
import com.keao.edu.user.service.ExamRoomService;
import com.keao.edu.user.service.ExaminationBasicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("task")
@RestController
public class TaskController extends BaseController {

    @Autowired
    private ExamRegistrationPaymentService examRegistrationPaymentService;
    @Autowired
    private ExaminationBasicService examinationBasicService;
    @Autowired
    private ExamRoomService examRoomService;

    // 查询订单状态
    @GetMapping("/queryPaymentStatus")
    public void queryOrderStatus() throws Exception {
        try {
            examRegistrationPaymentService.queryPaymentStatus();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    //更新考级项目状态
    @GetMapping("/updateExamStatus")
    public void updateExamStatus(){
        examinationBasicService.updateExamStatus();
    }

    //明日考试安排推送
    @GetMapping("/tomorrowExamPlanRemind")
    public void tomorrowExamPlanRemind(String day){
        examRoomService.tomorrowExamPlanRemind(day);
    }

    //考级项目结束提醒，提醒确认结果
    @GetMapping("/examEndRemind")
    public void examEndRemind(){
        examinationBasicService.examEndRemind();
    }

    //清理历史未关闭教室
    @GetMapping("/cleanExamRoom")
    public void cleanExamRoom(){
        examRoomService.cleanExamRoom();
    }
}
