|
@@ -11,6 +11,7 @@ import org.slf4j.Logger; |
|
@@ -11,6 +11,7 @@ import org.slf4j.Logger; |
11
|
import org.slf4j.LoggerFactory;
|
11
|
import org.slf4j.LoggerFactory;
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
13
|
import org.springframework.web.bind.annotation.RequestMapping;
|
13
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
14
|
+import org.springframework.web.bind.annotation.RequestParam;
|
14
|
import org.springframework.web.bind.annotation.RestController;
|
15
|
import org.springframework.web.bind.annotation.RestController;
|
15
|
|
16
|
|
16
|
import java.util.List;
|
17
|
import java.util.List;
|
|
@@ -23,6 +24,10 @@ public class HotSearchWordController { |
|
@@ -23,6 +24,10 @@ public class HotSearchWordController { |
23
|
|
24
|
|
24
|
private final Logger LOG = LoggerFactory.getLogger(HotSearchWordController.class);
|
25
|
private final Logger LOG = LoggerFactory.getLogger(HotSearchWordController.class);
|
25
|
|
26
|
|
|
|
27
|
+ private final Integer CLIENT_TYPE_APP = 0; // APP端
|
|
|
28
|
+
|
|
|
29
|
+ private final Integer WORD_TYPE_HOT = 0; // 热搜词
|
|
|
30
|
+
|
26
|
@Autowired
|
31
|
@Autowired
|
27
|
private HotSearchWordService hotSearchWordService;
|
32
|
private HotSearchWordService hotSearchWordService;
|
28
|
|
33
|
|
|
@@ -31,9 +36,19 @@ public class HotSearchWordController { |
|
@@ -31,9 +36,19 @@ public class HotSearchWordController { |
31
|
@IgnoreSession
|
36
|
@IgnoreSession
|
32
|
@RequestMapping(params = "method=ufo.product.searchWord")
|
37
|
@RequestMapping(params = "method=ufo.product.searchWord")
|
33
|
@Cachable(expire = 180)
|
38
|
@Cachable(expire = 180)
|
34
|
- public ApiResponse querySearchWord() {
|
|
|
35
|
- LOG.info("in method=ufo.product.searchWord");
|
|
|
36
|
- List<SearchWordResp> resp = hotSearchWordService.querySearchWord();
|
39
|
+ public ApiResponse querySearchWord(@RequestParam(value = "client_type", required = false) Integer clientType,
|
|
|
40
|
+ @RequestParam(value = "word_type", required = false) Integer wordType) {
|
|
|
41
|
+ LOG.info("in method=ufo.product.searchWord clientType is {}, wordType is {}", clientType, wordType);
|
|
|
42
|
+
|
|
|
43
|
+ if (null == clientType) {
|
|
|
44
|
+ clientType = CLIENT_TYPE_APP;
|
|
|
45
|
+ }
|
|
|
46
|
+
|
|
|
47
|
+ if (null == wordType) {
|
|
|
48
|
+ wordType = WORD_TYPE_HOT;
|
|
|
49
|
+ }
|
|
|
50
|
+
|
|
|
51
|
+ List<SearchWordResp> resp = hotSearchWordService.querySearchWord(clientType, wordType);
|
37
|
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("热搜词列表").build();
|
52
|
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("热搜词列表").build();
|
38
|
}
|
53
|
}
|
39
|
} |
54
|
} |