DoctorInfoController.java 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package com.diagbot.web;
  2. import java.util.List;
  3. import java.util.Map;
  4. import javax.validation.Valid;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.RequestBody;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import com.diagbot.annotation.SysLogger;
  11. import com.diagbot.dto.DoctorInfoDTO;
  12. import com.diagbot.dto.RespDTO;
  13. import com.diagbot.entity.DoctorInfo;
  14. import com.diagbot.facade.DoctorInfoFacade;
  15. import com.diagbot.vo.DoctorInfoVO;
  16. import io.swagger.annotations.Api;
  17. import io.swagger.annotations.ApiOperation;
  18. import springfox.documentation.annotations.ApiIgnore;
  19. /**
  20. * <p>
  21. * 医生信息表 前端控制器
  22. * </p>
  23. *
  24. * @author wangyu
  25. * @since 2018-11-19
  26. */
  27. @RestController
  28. @RequestMapping("/doctorInfo")
  29. @Api(value = "医生信息API", tags = { "医生信息API" })
  30. @SuppressWarnings("unchecked")
  31. /*@ApiIgnore*/
  32. public class DoctorInfoController {
  33. @Autowired
  34. private DoctorInfoFacade doctorInfoFacade;
  35. @ApiOperation(value = "医生信息——保存[by:QQ]",
  36. notes = "deptCode:科室编号,必填<br>" +
  37. "hospitalCode: 医院编号,必填<br>" +
  38. "doctorCode: 医生编号,必填<br>")
  39. @PostMapping("/saveDoctorInfo")
  40. @SysLogger("saveDoctorInfo")
  41. @ApiIgnore
  42. public RespDTO<Boolean> saveDoctorInfo(@Valid @RequestBody DoctorInfoVO doctorInfoVo){
  43. Boolean res = doctorInfoFacade.createDoctor(doctorInfoVo);
  44. return RespDTO.onSuc(res);
  45. }
  46. @ApiOperation(value = "医生信息——查询[by:wangyu]",
  47. notes = "deptCode:科室编号,必填<br>" +
  48. "hospitalCode: 医院编号,必填<br>" +
  49. "doctorCode: 医生编号,必填<br>")
  50. @PostMapping("/getDoctorInfo")
  51. @SysLogger("getDoctorInfo")
  52. @ApiIgnore
  53. public RespDTO<List<DoctorInfoDTO>> getDoctorInfo(@Valid @RequestBody DoctorInfoVO doctorInfoVo) {
  54. List<DoctorInfoDTO> data = doctorInfoFacade.getDoctorInfo(doctorInfoVo);
  55. return RespDTO.onSuc(data);
  56. }
  57. @PostMapping(value = "/doctorInfoMapByIds")
  58. @SysLogger("doctorInfoMapByIds")
  59. @ApiOperation(value = "根据ids获取医生信息map[by:rengb]")
  60. @ApiIgnore
  61. RespDTO<Map<Long, DoctorInfo>> doctorInfoMapByIds(@RequestBody List<Long> ids) {
  62. Map<Long, DoctorInfo> result = doctorInfoFacade.doctorInfoMapByIds(ids);
  63. return RespDTO.onSuc(result);
  64. }
  65. }