Authored by qinchao

Merge branch 'test6.8.3' of http://git.yoho.cn/ufo/yohoufo-fore into test6.8.3

... ... @@ -10,7 +10,7 @@
</resultMap>
<select id="selectAll" resultMap="BaseResultMap">
select id, search_word, order_by, create_time, update_time from hot_search_word
select id, search_word, order_by, create_time, update_time from search_word
where 1 = 1
<if test="clientType != null">
AND (client_type = #{clientType, jdbcType=INTEGER} or client_type = 2)
... ...
... ... @@ -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();
}
}
... ...