package com.diagbot.web;

import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.HospitalInfoDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.HospitalInfoFacade;
import com.diagbot.vo.HospitalInfoVO;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.validation.Valid;
import java.util.List;

/**
 * @Description:
 * @author: wangyu
 * @time: 2018/11/22 13:41
 */
@RestController
@RequestMapping("/hospitalInfo")
@Api(value = "医院信息API", tags = { "医院信息API" })
@SuppressWarnings("unchecked")
@ApiIgnore
public class HospitalInfoController {

    @Autowired
    private HospitalInfoFacade hospitalInfoFacade;

    @ApiOperation(value = "医院信息——根据医院编码获取医院信息[by:wangyu]",
            notes = "id: 医院id<br>" +
                    "code：医院编码<br>")
    @PostMapping("/getHospitalInfo")
    @SysLogger("getHospitalInfo")
    public RespDTO<List<HospitalInfoDTO>> getHospitalInfo(@RequestBody @Valid HospitalInfoVO hospitalInfoVO) {
        List<HospitalInfoDTO> data = hospitalInfoFacade.getHospitalInfo(hospitalInfoVO);
        return RespDTO.onSuc(data);
    }
}
