|
@@ -25,6 +25,7 @@ public class HotSearchWordController { |
|
@@ -25,6 +25,7 @@ public class HotSearchWordController { |
25
|
private final Logger LOG = LoggerFactory.getLogger(HotSearchWordController.class);
|
25
|
private final Logger LOG = LoggerFactory.getLogger(HotSearchWordController.class);
|
26
|
|
26
|
|
27
|
private final Integer CLIENT_TYPE_APP = 0; // APP端
|
27
|
private final Integer CLIENT_TYPE_APP = 0; // APP端
|
|
|
28
|
+ private final Integer CLIENT_TYPE_MINIAPP = 1; // 小程序端
|
28
|
|
29
|
|
29
|
private final Integer WORD_TYPE_HOT = 0; // 热搜词
|
30
|
private final Integer WORD_TYPE_HOT = 0; // 热搜词
|
30
|
|
31
|
|
|
@@ -36,19 +37,23 @@ public class HotSearchWordController { |
|
@@ -36,19 +37,23 @@ public class HotSearchWordController { |
36
|
@IgnoreSession
|
37
|
@IgnoreSession
|
37
|
@RequestMapping(params = "method=ufo.product.searchWord")
|
38
|
@RequestMapping(params = "method=ufo.product.searchWord")
|
38
|
@Cachable(expire = 180)
|
39
|
@Cachable(expire = 180)
|
39
|
- public ApiResponse querySearchWord(@RequestParam(value = "client_type", required = false) Integer clientType,
|
40
|
+ public ApiResponse querySearchWord(@RequestParam(value = "client_type", required = false) String clientType,
|
40
|
@RequestParam(value = "word_type", required = false) Integer wordType) {
|
41
|
@RequestParam(value = "word_type", required = false) Integer wordType) {
|
41
|
LOG.info("in method=ufo.product.searchWord clientType is {}, wordType is {}", clientType, wordType);
|
42
|
LOG.info("in method=ufo.product.searchWord clientType is {}, wordType is {}", clientType, wordType);
|
42
|
-
|
43
|
+ Integer dalClientType;
|
43
|
if (null == clientType) {
|
44
|
if (null == clientType) {
|
44
|
- clientType = CLIENT_TYPE_APP;
|
45
|
+ dalClientType = CLIENT_TYPE_APP;
|
|
|
46
|
+ } else if ("iphone".equals(clientType) || "android".equals(clientType)) {
|
|
|
47
|
+ dalClientType = CLIENT_TYPE_APP;
|
|
|
48
|
+ } else {
|
|
|
49
|
+ dalClientType = CLIENT_TYPE_MINIAPP;
|
45
|
}
|
50
|
}
|
46
|
|
51
|
|
47
|
if (null == wordType) {
|
52
|
if (null == wordType) {
|
48
|
wordType = WORD_TYPE_HOT;
|
53
|
wordType = WORD_TYPE_HOT;
|
49
|
}
|
54
|
}
|
50
|
|
55
|
|
51
|
- List<SearchWordResp> resp = hotSearchWordService.querySearchWord(clientType, wordType);
|
56
|
+ List<SearchWordResp> resp = hotSearchWordService.querySearchWord(dalClientType, wordType);
|
52
|
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("热搜词列表").build();
|
57
|
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("热搜词列表").build();
|
53
|
}
|
58
|
}
|
54
|
} |
59
|
} |