perf: 对查询参数信息接口增加缓存处理

This commit is contained in:
2023-09-24 10:58:24 +08:00
parent b7c504ab8f
commit 243ac0104a
3 changed files with 12 additions and 0 deletions

View File

@@ -129,6 +129,7 @@ public class CommonController {
@SaIgnore
@Operation(summary = "查询参数", description = "查询参数")
@GetMapping("/option")
@Cacheable(cacheNames = CacheConsts.OPTION_KEY_PREFIX)
public R<List<LabelValueVO>> listOption(@Validated OptionQuery query) {
return R.ok(optionService.list(query).stream().map(option -> new LabelValueVO(option.getCode(),
StrUtil.nullToDefault(option.getValue(), option.getDefaultValue()))).collect(Collectors.toList()));