suxiaoyang 6 lat temu
rodzic
commit
bc180827a5

+ 3 - 2
src/main/java/com/yihu/ehr/resource/constants/MicroServiceApi.java

@ -13,7 +13,8 @@ public interface MicroServiceApi {
        String DICT_ENTRIES = "cache/dict-entries";
    }
    interface ProfileSearch {
        String Hotwords = "/resource/hotwords";
    interface TextSearch {
        String TextSearch = "/resource/text_search";
        String HotWords = "/resource/text_search/hot_words";
    }
}

+ 3 - 3
src/main/java/com/yihu/ehr/resource/controller/TextSearchEndPoint.java

@ -42,7 +42,7 @@ public class TextSearchEndPoint extends EnvelopRestEndPoint {
    private ProfileSearchService profileSearchService;
    @ApiOperation(value = "全文检索")
    @RequestMapping(value = "/resources/text/search", method = RequestMethod.GET)
    @RequestMapping(value = MicroServiceApi.TextSearch.TextSearch, method = RequestMethod.GET)
    public Envelop countEhrCenter(
            @ApiParam(name = "keyword", value = "关键词")
            @RequestParam(value = "keyword", required = false) String keyword,
@ -88,7 +88,7 @@ public class TextSearchEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("获取热搜")
    @RequestMapping(value = MicroServiceApi.ProfileSearch.Hotwords, method = RequestMethod.GET)
    @RequestMapping(value = MicroServiceApi.TextSearch.HotWords, method = RequestMethod.GET)
    public List<String> getHotWords(
            @ApiParam(name = "reCount", value = "返回个数", required = true)
            @RequestParam(value = "reCount") int reCount,
@ -99,7 +99,7 @@ public class TextSearchEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新热搜")
    @RequestMapping(value = MicroServiceApi.ProfileSearch.Hotwords, method = RequestMethod.POST)
    @RequestMapping(value = MicroServiceApi.TextSearch.HotWords, method = RequestMethod.POST)
    public boolean updateHotWords(
            @ApiParam(name = "searchText", value = "搜索关键词", required = true)
            @RequestParam(value = "searchText") String searchText,

+ 2 - 2
src/main/java/com/yihu/ehr/resource/service/ProfileSearchService.java

@ -17,7 +17,7 @@ import java.util.*;
@Service
@Transactional
public class ProfileSearchService extends BaseJpaService<HotWord,HotWordDao> {
public class ProfileSearchService extends BaseJpaService<HotWord, HotWordDao> {
    private static final String PrefixRedis = "HOTWORDS_";
@ -28,7 +28,7 @@ public class ProfileSearchService extends BaseJpaService<HotWord,HotWordDao> {
    public boolean saveOrUpdateHotWords(String searchText,int type){
        boolean b = false;
        if(StringUtils.isNotBlank(searchText)){
        if (StringUtils.isNotBlank(searchText)){
            List<String> searchKeyWords = getSearchKeyWords(searchText);
            b = saveOrUpdateToRedis(searchKeyWords,type);
        }