CacheController.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package com.diagbot.web;
  2. import com.diagbot.annotation.SysLogger;
  3. import com.diagbot.dto.RespDTO;
  4. import com.diagbot.facade.CacheFacade;
  5. import io.swagger.annotations.Api;
  6. import io.swagger.annotations.ApiOperation;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.PostMapping;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. /**
  12. * <p>
  13. * 缓存 前端控制器
  14. * </p>
  15. *
  16. * @author zhoutg
  17. * @since 2018-12-25
  18. */
  19. @RequestMapping("/cache")
  20. @RestController
  21. @SuppressWarnings("unchecked")
  22. @Api(value = "缓存API", tags = { "缓存API" })
  23. public class CacheController {
  24. @Autowired
  25. CacheFacade cacheFacade;
  26. @ApiOperation(value = "清除启动加载类缓存[by:zhoutg]",
  27. notes = "")
  28. @PostMapping("/clear")
  29. @SysLogger("clear")
  30. public RespDTO<Boolean> clear() {
  31. cacheFacade.clearAll();
  32. return RespDTO.onSuc(true);
  33. }
  34. @ApiOperation(value = "重新加载药物缓存[by:zhoutg]",
  35. notes = "")
  36. @PostMapping("/clearDrug")
  37. @SysLogger("clearDrug")
  38. public RespDTO<Boolean> clearDrug() {
  39. cacheFacade.clearDrugloadDrug();
  40. return RespDTO.onSuc(true);
  41. }
  42. @ApiOperation(value = "清除规则缓存[by:wangfeng]",
  43. notes = "")
  44. @PostMapping("/clearRuleAll")
  45. @SysLogger("clearRuleAll")
  46. public RespDTO<Boolean> clearRuleInfoAlls() {
  47. cacheFacade.clearRuleInfoAll();
  48. return RespDTO.onSuc(true);
  49. }
  50. @ApiOperation(value = "重新加载标准词及规则、药物缓存[by:wangfeng]",
  51. notes = "")
  52. @PostMapping("/clearStandRuleDrug")
  53. @SysLogger("clearStandRuleDrug")
  54. public RespDTO<Boolean> clearStandRuleDrugAll() {
  55. cacheFacade.clearStandRuleDrugAll();
  56. return RespDTO.onSuc(true);
  57. }
  58. }