1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- package com.diagbot.web;
- import com.diagbot.annotation.SysLogger;
- import com.diagbot.dto.RespDTO;
- import com.diagbot.facade.CacheFacade;
- 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.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- /**
- * <p>
- * 缓存 前端控制器
- * </p>
- *
- * @author zhoutg
- * @since 2018-12-25
- */
- @RequestMapping("/cache")
- @RestController
- @SuppressWarnings("unchecked")
- @Api(value = "缓存API", tags = { "缓存API" })
- public class CacheController {
- @Autowired
- CacheFacade cacheFacade;
- @ApiOperation(value = "清除启动加载类缓存[by:zhoutg]",
- notes = "")
- @PostMapping("/clear")
- @SysLogger("clear")
- public RespDTO<Boolean> clear() {
- cacheFacade.clearAll();
- return RespDTO.onSuc(true);
- }
- @ApiOperation(value = "重新加载药物缓存[by:zhoutg]",
- notes = "")
- @PostMapping("/clearDrug")
- @SysLogger("clearDrug")
- public RespDTO<Boolean> clearDrug() {
- cacheFacade.clearDrugloadDrug();
- return RespDTO.onSuc(true);
- }
- @ApiOperation(value = "清除规则缓存[by:wangfeng]",
- notes = "")
- @PostMapping("/clearRuleAll")
- @SysLogger("clearRuleAll")
- public RespDTO<Boolean> clearRuleInfoAlls() {
- cacheFacade.clearRuleInfoAll();
- return RespDTO.onSuc(true);
- }
- @ApiOperation(value = "重新加载标准词及规则、药物缓存[by:wangfeng]",
- notes = "")
- @PostMapping("/clearStandRuleDrug")
- @SysLogger("clearStandRuleDrug")
- public RespDTO<Boolean> clearStandRuleDrugAll() {
- cacheFacade.clearStandRuleDrugAll();
- return RespDTO.onSuc(true);
- }
- }
|