package com.hs.api.controller;

import com.hs.api.common.Result;
import com.hs.api.common.annotations.Token;
import com.hs.api.model.SerDoctor;
import com.hs.api.model.reqmodel.Doctor;
import com.hs.api.service.SerDoctorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "医生Api")
@RestController
public class DoctorController {
    @Autowired
    private SerDoctorService serDoctorService;

    /**
     * 根据科室查询医生列表
     *
     * @return
     */
    @PostMapping("/doctor/list")
    @Token
    @ApiOperation("根据科室查询医生列表")
    public Object getList(@RequestBody Doctor doctor) throws InterruptedException {
        List<SerDoctor> list = serDoctorService.getDoctor(doctor.getDept());
        return Result.success(list);
    }
}
