package com.ics.admin.controller.meeting;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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.ics.common.core.domain.R;
import com.ics.common.core.controller.BaseController;
import com.ics.admin.domain.meeting.ReservationServe;
import com.ics.admin.service.meeting.IReservationServeService;
import org.wf.jwtp.annotation.RequiresPermissions;

/**
 * 预约服务关联 提供者
 *
 * @author chen
 * @date 2024-06-26
 */
@RestController
@RequestMapping("serve")
public class ReservationServeController extends BaseController {

    @Autowired
    private IReservationServeService reservationServeService;

    /**
     * 查询预约服务关联
     */
    @GetMapping("get/{id}")
    public ReservationServe get(@PathVariable("id") Long id) {
        return reservationServeService.selectReservationServeById(id);
    }

    /**
     * 查询预约服务关联列表
     */
    @RequiresPermissions("meeting:serve:list")
    @GetMapping("list")
    public R list(ReservationServe reservationServe) {
        startPage();
        return result(reservationServeService.selectReservationServeList(reservationServe));
    }


    /**
     * 新增保存预约服务关联
     */
    @RequiresPermissions("meeting:serve:add")
    @PostMapping("save")
    public R addSave(@RequestBody ReservationServe reservationServe) {
        return toAjax(reservationServeService.insertReservationServe(reservationServe));
    }

    /**
     * 修改保存预约服务关联
     */
    @RequiresPermissions("meeting:serve:edit")
    @PostMapping("update")
    public R editSave(@RequestBody ReservationServe reservationServe) {
        return toAjax(reservationServeService.updateReservationServe(reservationServe));
    }

    /**
     * 删除预约服务关联
     */
    @RequiresPermissions("meeting:serve:remove")
    @PostMapping("remove")
    public R remove(String ids) {
        return toAjax(reservationServeService.deleteReservationServeByIds(ids));
    }

}
