Search in sources :

Example 6 with SysConfig

use of com.zyd.blog.persistence.beans.SysConfig in project OneBlog by zhangyd-c.

the class CustomTags method searchOptions.

/**
 * web 端 “热门搜索” 中的待选项
 *
 * @param params
 * @return
 */
public Object searchOptions(Map params) {
    List<String> list = new ArrayList<>(Arrays.asList("Java", "SpringBoot"));
    SysConfig sysConfig = configService.getByKey(ConfigKeyEnum.SEARCH_OPTIONS.getKey());
    if (null != sysConfig) {
        String value = sysConfig.getConfigValue();
        if (!StringUtils.isEmpty(value)) {
            if (value.contains(",")) {
                list = Arrays.asList(value.split(","));
            } else {
                list = Collections.singletonList(value);
            }
        }
    }
    return list;
}
Also used : SysConfig(com.zyd.blog.persistence.beans.SysConfig)

Aggregations

SysConfig (com.zyd.blog.persistence.beans.SysConfig)6 RedisCache (com.zyd.blog.business.annotation.RedisCache)3 LocalDate (java.time.LocalDate)2 Date (java.util.Date)2 Link (com.zyd.blog.business.entity.Link)1 ZhydCommentException (com.zyd.blog.framework.exception.ZhydCommentException)1 Scheduled (org.springframework.scheduling.annotation.Scheduled)1