Authored by qinchao

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

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