package com.openhis.web.appointmentmanage.controller;

import com.core.common.core.domain.R;
import com.openhis.appointmentmanage.domain.DoctorSchedule;
import com.openhis.web.appointmentmanage.appservice.IDoctorScheduleAppService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/doctor-schedule")
public class DoctorScheduleController {
    @Resource
    private IDoctorScheduleAppService doctorScheduleAppService;

    /*
     * 获取医生排班List
     *
     * */
    @GetMapping("/list")
    public R<?> getDoctorScheduleList() {
        return R.ok(doctorScheduleAppService.getDoctorScheduleList());
    }

    /*
    * 新增医生排班
    *
    * */
    @PostMapping("/add")
    public R<?> addDoctorSchedule(@RequestBody DoctorSchedule doctorSchedule) {
        return R.ok(doctorScheduleAppService.addDoctorSchedule(doctorSchedule));
    }

    /*
     * 删除医生排班
     *
     * */
    @DeleteMapping("/delete/{doctorScheduleId}")
    public R<?> removeDoctorSchedule(@PathVariable Integer doctorScheduleId){
        return R.ok(doctorScheduleAppService.removeDoctorSchedule(doctorScheduleId));
    }

}
