RemoteHospitalService.java 2.5 KB
package cn.brotop.api.hospital;

import cn.brotop.api.hospital.DTO.HospitalDTO;
import cn.brotop.api.hospital.DTO.HospitalRpcDTO;
import cn.brotop.api.hospital.VO.CityVO;
import cn.brotop.api.hospital.VO.CountyVO;
import cn.brotop.api.hospital.VO.ProvinceVO;
import cn.brotop.api.hospital.factory.RemoteHospitalFallbackFactory;
import cn.brotop.common.core.constant.ServiceNameConstants;
import cn.brotop.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 医院模块API服务
 * @author 啊雷
 * @version 1.0
 * @date 2021/2/3 16:19
 */
@FeignClient(contextId = "remoteHospitalService", value = ServiceNameConstants.HOSPITAL_SERVICE, fallbackFactory = RemoteHospitalFallbackFactory.class)
public interface RemoteHospitalService {

    /**
     * 查询医院信息
     * @param hospitalIds ids
     * @return R<List<HospitalRpcDTO>>
     */
    @PostMapping(value = "/remote_hospital/findByHospitalIds")
    R<List<HospitalRpcDTO>> findByHospitalIds(@RequestBody List<Long> hospitalIds);

    /**
     * 查询医院信息
     * @param hospitalId 医院id
     * @return R<HospitalRpcDTO>
     */
    @GetMapping(value = "/remote_hospital/findByHospitalId")
    R<HospitalRpcDTO> findByHospitalId(@RequestParam("hospitalId") Long hospitalId);
    /**
     * 获取省
     * @return 省列表
     */
    @GetMapping(value = "/remote_hospital/getProvince")
    R<List<ProvinceVO>> getProvince();

    /**
     * 获取市
     * @param provinceId 省id
     * @return 市列表
     */
    @GetMapping(value = "/remote_hospital/getCity")
    R<List<CityVO>> getCity(@RequestParam("provinceId") Long provinceId);

    /**
     * 获取区
     * @param cityId 城市id
     * @return 区列表
     */
    @GetMapping(value = "/remote_hospital/getCounty")
    R<List<CountyVO>> getCounty(@RequestParam("cityId") Long cityId);

    /**
     * 获取区下所有医院
     * @param countyId 区id
     * @return 区下医院列表
     */
    @GetMapping(value = "/remote_hospital/getHospital")
    R<List<HospitalDTO>> getHospital(@RequestParam("countyId") Long countyId);

//    /**
//     * 根据输入的名称查询医院
//     * @param hospitalName 医院名称
//     */
//    R<HospitalRpcDTO> getOneHospital(String hospitalName);

}