package com.yida.data.school.news.controller.out;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.school.dto.news.SysNoticeSaveDTO;
import com.yida.data.school.news.service.EduNoticeSystemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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.RestController;

@Api(tags = "通知资讯-外部(不鉴权)-系统通知")
@RequiredArgsConstructor
@RestController
@RequestMapping("/out/news/sys")
public class OutEduNoticeSysController {

    private final EduNoticeSystemService eduNoticeSystemService;

    @ApiOperation("发送系统通知")
    @PostMapping("/sendNotice")
    public ResultBean sendNotice(@RequestBody SysNoticeSaveDTO dto) {
        eduNoticeSystemService.saveNotice(dto);
        return ResultBean.buildSuccess();
    }
}
