|
@@ -2,6 +2,7 @@ package com.yoho.search.service.restapi; |
|
@@ -2,6 +2,7 @@ package com.yoho.search.service.restapi; |
2
|
|
2
|
|
3
|
import com.yoho.search.service.cache.LocalCacheService;
|
3
|
import com.yoho.search.service.cache.LocalCacheService;
|
4
|
import com.yoho.search.service.personalized.PersonalVectorFeatureSearch;
|
4
|
import com.yoho.search.service.personalized.PersonalVectorFeatureSearch;
|
|
|
5
|
+import com.yoho.search.service.service.SearchDynamicConfigService;
|
5
|
import com.yoho.search.service.service.SearchKeyWordService;
|
6
|
import com.yoho.search.service.service.SearchKeyWordService;
|
6
|
import com.yoho.search.service.servicenew.IProductListService;
|
7
|
import com.yoho.search.service.servicenew.IProductListService;
|
7
|
import com.yoho.search.service.vo.KeyWordWithCount;
|
8
|
import com.yoho.search.service.vo.KeyWordWithCount;
|
|
@@ -9,12 +10,14 @@ import com.yoho.search.service.vo.SearchApiResult; |
|
@@ -9,12 +10,14 @@ import com.yoho.search.service.vo.SearchApiResult; |
9
|
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse.AnalyzeToken;
|
10
|
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse.AnalyzeToken;
|
10
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
import org.springframework.stereotype.Controller;
|
12
|
import org.springframework.stereotype.Controller;
|
|
|
13
|
+import org.springframework.util.Assert;
|
12
|
import org.springframework.web.bind.annotation.RequestMapping;
|
14
|
import org.springframework.web.bind.annotation.RequestMapping;
|
13
|
import org.springframework.web.bind.annotation.RequestMethod;
|
15
|
import org.springframework.web.bind.annotation.RequestMethod;
|
14
|
import org.springframework.web.bind.annotation.RequestParam;
|
16
|
import org.springframework.web.bind.annotation.RequestParam;
|
15
|
import org.springframework.web.bind.annotation.ResponseBody;
|
17
|
import org.springframework.web.bind.annotation.ResponseBody;
|
16
|
|
18
|
|
17
|
import java.util.ArrayList;
|
19
|
import java.util.ArrayList;
|
|
|
20
|
+import java.util.HashMap;
|
18
|
import java.util.List;
|
21
|
import java.util.List;
|
19
|
import java.util.Map;
|
22
|
import java.util.Map;
|
20
|
|
23
|
|
|
@@ -31,6 +34,9 @@ public class ToolsController { |
|
@@ -31,6 +34,9 @@ public class ToolsController { |
31
|
@Autowired
|
34
|
@Autowired
|
32
|
private IProductListService productListService;
|
35
|
private IProductListService productListService;
|
33
|
|
36
|
|
|
|
37
|
+ @Autowired
|
|
|
38
|
+ private SearchDynamicConfigService searchDynamicConfigService;
|
|
|
39
|
+
|
34
|
/**
|
40
|
/**
|
35
|
* 获取热搜词结果
|
41
|
* 获取热搜词结果
|
36
|
*
|
42
|
*
|
|
@@ -104,6 +110,7 @@ public class ToolsController { |
|
@@ -104,6 +110,7 @@ public class ToolsController { |
104
|
|
110
|
|
105
|
/**
|
111
|
/**
|
106
|
* 删除redis上的key
|
112
|
* 删除redis上的key
|
|
|
113
|
+ *
|
107
|
* @param redisKey
|
114
|
* @param redisKey
|
108
|
* @return
|
115
|
* @return
|
109
|
*/
|
116
|
*/
|
|
@@ -141,6 +148,23 @@ public class ToolsController { |
|
@@ -141,6 +148,23 @@ public class ToolsController { |
141
|
return new SearchApiResult().setMessage("清除本地缓存成功");
|
148
|
return new SearchApiResult().setMessage("清除本地缓存成功");
|
142
|
}
|
149
|
}
|
143
|
|
150
|
|
|
|
151
|
+ @RequestMapping(value = "/dynamicParameterValue")
|
|
|
152
|
+ @ResponseBody
|
|
|
153
|
+ public Map<String, Object> dynamicParameterValue(String key) {
|
|
|
154
|
+ Map<String, Object> rtnMap = new HashMap<String, Object>();
|
|
|
155
|
+
|
|
|
156
|
+ try {
|
|
|
157
|
+ Assert.notNull(key);
|
|
|
158
|
+ rtnMap.put("code", 200);
|
|
|
159
|
+ rtnMap.put("value", searchDynamicConfigService.getDynamicParameterValue(key));
|
|
|
160
|
+ } catch (Exception e) {
|
|
|
161
|
+ rtnMap.put("code", 400);
|
|
|
162
|
+ rtnMap.put("msg", e.getMessage());
|
|
|
163
|
+ }
|
|
|
164
|
+
|
|
|
165
|
+ return rtnMap;
|
|
|
166
|
+ }
|
|
|
167
|
+
|
144
|
@RequestMapping(method = RequestMethod.GET, value = "/calVectorFeature")
|
168
|
@RequestMapping(method = RequestMethod.GET, value = "/calVectorFeature")
|
145
|
@ResponseBody
|
169
|
@ResponseBody
|
146
|
public SearchApiResult calVectorFeature(@RequestParam String uid, @RequestParam String skns, @RequestParam String version) throws Exception {
|
170
|
public SearchApiResult calVectorFeature(@RequestParam String uid, @RequestParam String skns, @RequestParam String version) throws Exception {
|