ConceptController.java 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package com.diagbot.web;
  2. import com.diagbot.annotation.SysLogger;
  3. import com.diagbot.dto.ConceptBaseDTO;
  4. import com.diagbot.dto.RespDTO;
  5. import com.diagbot.facade.ConceptFacade;
  6. import com.diagbot.vo.ConceptExistVO;
  7. import com.diagbot.vo.IndexVO;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.web.bind.annotation.PostMapping;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import java.util.List;
  16. import java.util.Map;
  17. /**
  18. * <p>
  19. * 概念表 前端控制器
  20. * </p>
  21. *
  22. * @author zhaops
  23. * @since 2019-05-06
  24. */
  25. @RestController
  26. @RequestMapping("/concept")
  27. @Api(value = "概念相关API", tags = { "知识库标准化-概念相关API" })
  28. @SuppressWarnings("unchecked")
  29. public class ConceptController {
  30. @Autowired
  31. ConceptFacade conceptFacade;
  32. /**
  33. * 检索
  34. *
  35. * @param indexVO 搜索参数
  36. * @return 名称和概念id
  37. */
  38. @ApiOperation(value = "知识库标准化-根据名称和类型获取概念列表[by:zhoutg]",
  39. notes = "name: 搜索内容<br>" +
  40. "type:类型(1:症状 2:既往史,3:其他史,4:查体,5:化验),必填<br>")
  41. @PostMapping("/index")
  42. @SysLogger("index")
  43. public RespDTO<List<ConceptBaseDTO>> index(@RequestBody IndexVO indexVO){
  44. return RespDTO.onSuc(conceptFacade.indexFac(indexVO));
  45. }
  46. /**
  47. * 根据名称和类型获取概念列表Map
  48. *
  49. * @param conceptExistVO 搜索参数
  50. * @return 术语id和术语 Map
  51. */
  52. @ApiOperation(value = "知识库标准化-根据名称和类型获取概念列表Map[by:zhoutg]",
  53. notes = "nameList: 名称列表<br>" +
  54. "type: 类型")
  55. @PostMapping("/getConceptMapByNameAndType")
  56. @SysLogger("getConceptMapByNameAndType")
  57. public RespDTO<Map<String, Long>> getConceptMapByNameAndType(@RequestBody ConceptExistVO conceptExistVO){
  58. return RespDTO.onSuc(conceptFacade.getConceptMap(conceptExistVO));
  59. }
  60. }