package com.yh.saas.plugin.news.controller;

import com.yh.saas.plugin.news.command.CircularManagementReceiveCommand;
import com.yh.saas.plugin.news.command.CircularManagementReceiveSearchCommand;
import com.yh.saas.plugin.news.service.INewsCircularManagementReceiveService;
import com.yh.saas.plugin.news.vo.CircularManagementReceiveVo;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
import com.baomidou.mybatisplus.plugins.Page;

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

@Api(value = "通知通函管理", description = "通知通函接收")
@RestController
@RequestMapping("/txCircularManagementReceive")
//@PluginFeature(id = "CircularManagement", name = "通知通函")
public class NewsCircularManagementReceiveController {
	@Autowired
	private INewsCircularManagementReceiveService circularManagementReceiveService;


	@ApiOperation(value = "查询接收通知通函列表",notes = "查询接收通知通函列表")
	@GetMapping("/query/queryCircularManagementReceiveList")
	public Page<CircularManagementReceiveVo> queryCircularManagementReceiveList(
			CircularManagementReceiveSearchCommand example) {
		return circularManagementReceiveService.queryCircularManagementReceiveList(example);
	}


	@ApiOperation(value = "接收通知通函",notes = "接收通知通函")
	@PostMapping("/api/receiveCircularManagementInfo")
	public void receiveCircularManagementInfo(@RequestBody CircularManagementReceiveCommand example) {
		circularManagementReceiveService.receiveCircularManagementInfo(example);
	}
	@ApiOperation(value = "接收通知通函",notes = "接收通知通函")
	@PostMapping("/api/receiveCircularManagement")
	public void receiveCircularManagement(@RequestBody CircularManagementReceiveCommand example) {
		circularManagementReceiveService.receiveCircularManagement(example);
	}

	@ApiOperation(value = "反馈通知通函",notes = "反馈通知通函")
	@PostMapping("/api/feedbackCircularManagementInfo")
	public void feedbackCircularManagementInfo(@RequestBody CircularManagementReceiveCommand example) {
		circularManagementReceiveService.feedbackCircularManagementInfo(example);
	}

	/**
	 * 批量接收
	 * @param example
	 */
	@PostMapping("/api/receiveInfos")
	public void receiveInfos(@RequestBody CircularManagementReceiveCommand example) {
		circularManagementReceiveService.receiveInfos(example);
	}

	/**
	 * 保存
	 * @param example
	 */
	@PostMapping("/api/saveCircularManagementInfo")
	public void saveCircularManagementInfo(@RequestBody CircularManagementReceiveCommand example) {
		circularManagementReceiveService.saveCircularManagementInfo(example);
	}

	/**
	 * 查询详细
	 * @param id
	 * @return
	 */
	@GetMapping("/query/getReceiveDetail")
	public CircularManagementReceiveVo getReceiveDetail(String id) {
		return circularManagementReceiveService.getReceiveDetail(id);
	}
}
