package com.hs.api.controller;

import com.hs.api.common.Result;
import com.hs.api.common.annotations.Token;
import com.hs.api.model.SerDiseaseDocRs;
import com.hs.api.model.reqmodel.DiseaseDoc;
import com.hs.api.service.SerDiseaseDocService;
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 SerDiseaseDocController {

    @Autowired
    private SerDiseaseDocService serDiseaseDocService;

    @PostMapping("diseaseDoc")
    @Token
    @ApiOperation("根据Code查询疾病关系信息")
    public Object getDiseaseDoc(@RequestBody DiseaseDoc disease) throws InterruptedException {
        List<SerDiseaseDocRs> list = serDiseaseDocService.getDiseaseDoc(disease.getDocCode(),disease.getMdcCode(),
                disease.getDeptCode(),disease.getDate());
        return Result.success(list);
    }
}
