package com.rongwei.savecheck.controller;

import com.rongwei.rwcommon.base.R;
import com.rongwei.sfcommon.sys.service.AspSafetyMeetingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("aspSafetyMeeting")
@Slf4j
public class AspSafetyMeetingController {

    @Autowired
    private AspSafetyMeetingService aspSafetyMeetingService;

    /**
     * 安全会议定时任务提醒，定时任务每天凌晨执行一次，发送今天和明天的会议提醒
     */
    @PostMapping("/reportMessage")
    public R reportMessage(){
        try{
            aspSafetyMeetingService.reportMessage();
            return R.ok();
        }catch (Exception e){
            e.printStackTrace();
            return R.error(e.getMessage());
        }
    }
}
