package com.usky.meeting.controller.web;


import com.usky.common.core.bean.ApiResult;
import com.usky.common.core.bean.CommonPage;
import com.usky.meeting.domain.MeetingFile;
import com.usky.meeting.service.MeetingFileService;
import com.usky.meeting.service.vo.MeetingFileListVO;
import com.usky.meeting.service.vo.MeetingFileRequestVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 * 会议文件 前端控制器
 * </p>
 *
 * @author zyj
 * @since 2024-03-08
 */
@RestController
@RequestMapping("/meetingFile")
public class MeetingFileController {
    @Autowired
    private MeetingFileService meetingFileService;

    /**
     * 添加会议文件
     * @param requestVO
     * @return
     */
    @PostMapping("insertMeetingFile")
    public ApiResult<Void> insertMeetingFile(@RequestBody List<MeetingFileRequestVO> requestVOList){
        meetingFileService.insertMeetingFile(requestVOList);
        return ApiResult.success();
    }

    /**
     * 查询会议文件
     * @param meetingFileListVO
     * @return
     */
    @PostMapping("meetingFileList")
    public ApiResult<CommonPage<MeetingFile>> meetingFileList(@RequestBody MeetingFileListVO meetingFileListVO){
        return ApiResult.success(meetingFileService.meetingFileList(meetingFileListVO));
    }

}

