Authored by mali

搜索词接口

... ... @@ -25,6 +25,7 @@ public class HotSearchWordController {
private final Logger LOG = LoggerFactory.getLogger(HotSearchWordController.class);
private final Integer CLIENT_TYPE_APP = 0; // APP端
private final Integer CLIENT_TYPE_MINIAPP = 1; // 小程序端
private final Integer WORD_TYPE_HOT = 0; // 热搜词
... ... @@ -36,19 +37,23 @@ public class HotSearchWordController {
@IgnoreSession
@RequestMapping(params = "method=ufo.product.searchWord")
@Cachable(expire = 180)
public ApiResponse querySearchWord(@RequestParam(value = "client_type", required = false) Integer clientType,
public ApiResponse querySearchWord(@RequestParam(value = "client_type", required = false) String clientType,
@RequestParam(value = "word_type", required = false) Integer wordType) {
LOG.info("in method=ufo.product.searchWord clientType is {}, wordType is {}", clientType, wordType);
Integer dalClientType;
if (null == clientType) {
clientType = CLIENT_TYPE_APP;
dalClientType = CLIENT_TYPE_APP;
} else if ("iphone".equals(clientType) || "android".equals(clientType)) {
dalClientType = CLIENT_TYPE_APP;
} else {
dalClientType = CLIENT_TYPE_MINIAPP;
}
if (null == wordType) {
wordType = WORD_TYPE_HOT;
}
List<SearchWordResp> resp = hotSearchWordService.querySearchWord(clientType, wordType);
List<SearchWordResp> resp = hotSearchWordService.querySearchWord(dalClientType, wordType);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("热搜词列表").build();
}
}
... ...