...
|
...
|
@@ -11,6 +11,7 @@ import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.List;
|
...
|
...
|
@@ -23,6 +24,10 @@ public class HotSearchWordController { |
|
|
|
|
|
private final Logger LOG = LoggerFactory.getLogger(HotSearchWordController.class);
|
|
|
|
|
|
private final Integer CLIENT_TYPE_APP = 0; // APP端
|
|
|
|
|
|
private final Integer WORD_TYPE_HOT = 0; // 热搜词
|
|
|
|
|
|
@Autowired
|
|
|
private HotSearchWordService hotSearchWordService;
|
|
|
|
...
|
...
|
@@ -31,9 +36,19 @@ public class HotSearchWordController { |
|
|
@IgnoreSession
|
|
|
@RequestMapping(params = "method=ufo.product.searchWord")
|
|
|
@Cachable(expire = 180)
|
|
|
public ApiResponse querySearchWord() {
|
|
|
LOG.info("in method=ufo.product.searchWord");
|
|
|
List<SearchWordResp> resp = hotSearchWordService.querySearchWord();
|
|
|
public ApiResponse querySearchWord(@RequestParam(value = "client_type", required = false) Integer clientType,
|
|
|
@RequestParam(value = "word_type", required = false) Integer wordType) {
|
|
|
LOG.info("in method=ufo.product.searchWord clientType is {}, wordType is {}", clientType, wordType);
|
|
|
|
|
|
if (null == clientType) {
|
|
|
clientType = CLIENT_TYPE_APP;
|
|
|
}
|
|
|
|
|
|
if (null == wordType) {
|
|
|
wordType = WORD_TYPE_HOT;
|
|
|
}
|
|
|
|
|
|
List<SearchWordResp> resp = hotSearchWordService.querySearchWord(clientType, wordType);
|
|
|
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("热搜词列表").build();
|
|
|
}
|
|
|
} |
...
|
...
|
|