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

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.school.news.service.EduNoticeBuyService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;

/**
 * @author chenbo
 */
@Api(tags = "通知咨询-购买通知(不鉴权)")
@AllArgsConstructor
@RestController
@RequestMapping("/in/news/buy")
public class InEduNoticeBuyController {

    @Resource
    private EduNoticeBuyService eduNoticeBuyService;

    @ApiOperation("执行定时任务发送购买通知")
    @GetMapping("/updateBuyNoticeById")
    public ResultBean updateBuyNoticeById(@RequestParam Long noticeId) {
        eduNoticeBuyService.updateBuyNoticeById(noticeId);
        return ResultBean.buildSuccess();
    }
}
