package com.yida.data.attendance.controller;

import com.yida.data.attendance.service.EduAttendanceNoticeService;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.attendance.EduAttendanceNotice;
import io.swagger.annotations.Api;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "考勤-学生-通知(不鉴权)")
@RestController
@RequestMapping("/in/notice")
public class InEduAttendanceNoticeController {

    @Resource
    private EduAttendanceNoticeService eduAttendanceNoticeService;

    @PostMapping("/saveNotice")
    public ResultBean saveNotice(@RequestBody EduAttendanceNotice notice) {
        eduAttendanceNoticeService.save(notice);
        return ResultBean.buildSuccess();
    }

    @GetMapping("/sendNotice")
    public ResultBean sendNotice(@RequestParam Long id) {
        eduAttendanceNoticeService.sendNotice(id);
        return ResultBean.buildSuccess();
    }
}
