mirror of https://gitee.com/maxjhandsome/pig
fixed: 字典缓存问题,删除还能查看
This commit is contained in:
parent
822f6ed5bc
commit
be56e2ac01
|
@ -7,8 +7,10 @@ import com.github.pig.admin.entity.SysDict;
|
|||
import com.github.pig.admin.service.SysDictService;
|
||||
import com.github.pig.common.constant.CommonConstant;
|
||||
import com.github.pig.common.util.Query;
|
||||
import com.github.pig.common.util.R;
|
||||
import com.github.pig.common.web.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
@ -67,4 +69,16 @@ public class DictController extends BaseController {
|
|||
return sysDictService.selectList(new EntityWrapper<>(condition));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典,并且清除字典缓存
|
||||
*
|
||||
* @param id ID
|
||||
* @param type 类型
|
||||
* @return R
|
||||
*/
|
||||
@DeleteMapping("/{id}/{type}")
|
||||
@CacheEvict(value = "dict_details", key = "#type")
|
||||
public R<Boolean> deleteDict(@PathVariable Integer id, @PathVariable String type) {
|
||||
return new R<>(sysDictService.deleteById(id));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue