package com.vetti.web.controller.hotake;

import com.vetti.common.annotation.Log;
import com.vetti.common.core.controller.BaseController;
import com.vetti.common.core.domain.R;
import com.vetti.common.core.page.TableDataInfo;
import com.vetti.common.core.page.TableWebDataInfo;
import com.vetti.common.enums.BusinessType;
import com.vetti.hotake.domain.HotakeMeetingCalendarInfo;
import com.vetti.hotake.domain.dto.HotakeMeetingCalendarDataDto;
import com.vetti.hotake.domain.vo.HotakeMeetingCalendarVo;
import com.vetti.hotake.service.IHotakeMeetingCalendarInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 会议日历记录主Controller
 * 
 * @author wangxiangshun
 * @date 2025-11-09
 */
@Api(tags ="会议日历记录")
@RestController
@RequestMapping("/hotake/meetingCalendarInfo")
public class HotakeMeetingCalendarInfoController extends BaseController
{
    @Autowired
    private IHotakeMeetingCalendarInfoService hotakeMeetingCalendarInfoService;

    /**
     * 查询会议日历记录主列表
     */
    @ApiOperation("查询会议日历记录列表")
    @GetMapping("/getPageList")
    public TableWebDataInfo<HotakeMeetingCalendarInfo> pageList(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo)
    {
        startPage();
        List<HotakeMeetingCalendarInfo> list = hotakeMeetingCalendarInfoService.selectHotakeMeetingCalendarInfoList(hotakeMeetingCalendarInfo);
        return getWebDataTable(list);
    }


    /**
     * 查询会议日历记录主列表(无分页)
     */
    @ApiOperation("候选人-查询会议日历记录列表(无分页)")
    @GetMapping("/getList")
    public R<List<HotakeMeetingCalendarInfo>> list(HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo)
    {
        List<HotakeMeetingCalendarInfo> list = hotakeMeetingCalendarInfoService.selectHotakeMeetingCalendarInfoCandidateList(hotakeMeetingCalendarInfo);
        return R.ok(list,"");
    }

    /**
     * 获取会议日历记录主详细信息
     */
    @ApiOperation("获取会议日历记录详细信息")
    @GetMapping(value = "/{id}")
    public R<HotakeMeetingCalendarInfo> getInfo(@PathVariable("id") Long id)
    {
        return R.ok(hotakeMeetingCalendarInfoService.selectHotakeMeetingCalendarInfoById(id));
    }

    /**
     * 新增会议日历记录主
     */
    @ApiOperation("新增会议日历记录")
    @Log(title = "会议日历记录主", businessType = BusinessType.INSERT)
    @PostMapping
    public R<HotakeMeetingCalendarInfo> add(@RequestBody HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo)
    {
        return R.ok(hotakeMeetingCalendarInfoService.insertHotakeMeetingCalendarInfo(hotakeMeetingCalendarInfo));
    }

    /**
     * 修改会议日历记录主
     */
    @ApiOperation("修改会议日历记录")
    @Log(title = "会议日历记录主", businessType = BusinessType.UPDATE)
    @PutMapping
    public R<HotakeMeetingCalendarInfo> edit(@RequestBody HotakeMeetingCalendarInfo hotakeMeetingCalendarInfo)
    {
        return R.ok(hotakeMeetingCalendarInfoService.updateHotakeMeetingCalendarInfo(hotakeMeetingCalendarInfo));
    }

    /**
     * 删除会议日历记录主
     */
    @ApiOperation("删除会议日历记录")
    @Log(title = "会议日历记录主", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public R remove(@PathVariable Long[] ids)
    {
        return R.ok(hotakeMeetingCalendarInfoService.deleteHotakeMeetingCalendarInfoByIds(ids));
    }


    /**
     * 保存会议日历记录主
     */
    @ApiOperation("保存会议日历记录")
    @Log(title = "保存会议日历记录", businessType = BusinessType.INSERT)
    @PostMapping("/interview/invitation")
    public R<?> save(@RequestBody HotakeMeetingCalendarVo calendarVo)
    {
        hotakeMeetingCalendarInfoService.saveHotakeMeetingCalendarInfo(calendarVo);
        return R.ok();
    }

    /**
     * 查询当前候选者会议日历数据
     */
    @ApiOperation("查询当前候选者会议日历数据")
    @GetMapping("/getCandidateCalendarList")
    public R<List<HotakeMeetingCalendarDataDto>> listCandidateAll()
    {
        List<HotakeMeetingCalendarDataDto> list = hotakeMeetingCalendarInfoService.selectHotakeMeetingCalendarDataDtoList();
        return R.ok(list,"");
    }


    /**
     * 获取当前候选人即将开始的会议信息
     */
    @ApiOperation("获取当前候选人即将开始的会议信息")
    @GetMapping(value = "/getCandidateStartCalendarInfo")
    public R<HotakeMeetingCalendarInfo> getCandidateStartCalendarInfo()
    {
        return R.ok(hotakeMeetingCalendarInfoService.selectCandidateStartCalendarInfo());
    }

}
