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.HotakeMeetingCalendarDetail;
import com.vetti.hotake.service.IHotakeMeetingCalendarDetailService;
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/meetingCalendarDetail")
public class HotakeMeetingCalendarDetailController extends BaseController
{
    @Autowired
    private IHotakeMeetingCalendarDetailService hotakeMeetingCalendarDetailService;

    /**
     * 查询会议日历记录明细列表
     */
    @ApiOperation("查询会议日历记录明细列表")
    @GetMapping("/list")
    public TableWebDataInfo<HotakeMeetingCalendarDetail> list(HotakeMeetingCalendarDetail hotakeMeetingCalendarDetail)
    {
        startPage();
        List<HotakeMeetingCalendarDetail> list = hotakeMeetingCalendarDetailService.selectHotakeMeetingCalendarDetailList(hotakeMeetingCalendarDetail);
        return getWebDataTable(list);
    }


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

    /**
     * 新增会议日历记录明细
     */
    @ApiOperation("新增会议日历记录明细")
    @Log(title = "会议日历记录明细", businessType = BusinessType.INSERT)
    @PostMapping
    public R<HotakeMeetingCalendarDetail> add(@RequestBody HotakeMeetingCalendarDetail hotakeMeetingCalendarDetail)
    {
        return R.ok(hotakeMeetingCalendarDetailService.insertHotakeMeetingCalendarDetail(hotakeMeetingCalendarDetail));
    }

    /**
     * 修改会议日历记录明细
     */
    @ApiOperation("修改会议日历记录明细")
    @Log(title = "会议日历记录明细", businessType = BusinessType.UPDATE)
    @PutMapping
    public R<HotakeMeetingCalendarDetail> edit(@RequestBody HotakeMeetingCalendarDetail hotakeMeetingCalendarDetail)
    {
        return R.ok(hotakeMeetingCalendarDetailService.updateHotakeMeetingCalendarDetail(hotakeMeetingCalendarDetail));
    }

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