Commit 5692bfb4 by shenjunjie

Merge branch 'feature' into 'dev'

Feature

See merge request !377
parents 0b836a50 9ee4925d
...@@ -33,6 +33,8 @@ import org.springframework.web.client.RestTemplate; ...@@ -33,6 +33,8 @@ import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.net.URI;
import java.net.URLEncoder;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -347,8 +349,11 @@ public class AppHotController extends BaseController { ...@@ -347,8 +349,11 @@ public class AppHotController extends BaseController {
@ApiOperation("热点库-品牌热点-热搜趋势") @ApiOperation("热点库-品牌热点-热搜趋势")
@GetMapping("/trend") @GetMapping("/trend")
public ResponseResult hotSearchTrend(@RequestParam String name, @RequestParam Long startTime, @RequestParam String type) { public ResponseResult hotSearchTrend(@RequestParam String name, @RequestParam Long startTime, @RequestParam String type) throws Exception{
ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.getForEntity(hotSearchTrendUrl, JSONObject.class, name, startTime, HotPlatformEnum.convertFromName2Eng(type)); // 参数中可能的特殊字符故做此处理
name = URLEncoder.encode(name, "UTF-8");
String url = hotSearchTrendUrl + "?name=" + name + "&startTime=" + startTime + "&type=" + HotPlatformEnum.convertFromName2Eng(type);
ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.getForEntity(new URI(url), JSONObject.class);
if (Objects.isNull(jsonObjectResponseEntity.getBody())) { if (Objects.isNull(jsonObjectResponseEntity.getBody())) {
return ResponseResult.failure("查询热搜趋势失败"); return ResponseResult.failure("查询热搜趋势失败");
} }
...@@ -358,7 +363,7 @@ public class AppHotController extends BaseController { ...@@ -358,7 +363,7 @@ public class AppHotController extends BaseController {
@ApiOperation("热点库-品牌热点-上榜/峰值截图") @ApiOperation("热点库-品牌热点-上榜/峰值截图")
@GetMapping("/snapshot") @GetMapping("/snapshot")
public ResponseResult hotSnapshot(@RequestParam String type, @RequestParam Long time, @RequestParam Integer rank) { public ResponseResult hotSnapshot(@RequestParam String type, @RequestParam Long time, @RequestParam Integer rank) {
ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.getForEntity(hotSearchSnapshotUrl, JSONObject.class, HotPlatformEnum.convertFromName2Eng(type), time, rank); ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.getForEntity(hotSearchSnapshotUrl, JSONObject.class, type, time, rank);
if (Objects.isNull(jsonObjectResponseEntity.getBody())) { if (Objects.isNull(jsonObjectResponseEntity.getBody())) {
return ResponseResult.failure("上榜/峰值截图失败"); return ResponseResult.failure("上榜/峰值截图失败");
} }
......
...@@ -85,7 +85,7 @@ trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTr ...@@ -85,7 +85,7 @@ trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTr
trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4} trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3} trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3} trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3 #\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2} ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
......
...@@ -88,7 +88,7 @@ trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTr ...@@ -88,7 +88,7 @@ trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTr
trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4} trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3} trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3} trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3 #\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
......
...@@ -85,7 +85,7 @@ trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTr ...@@ -85,7 +85,7 @@ trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTr
trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4} trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3} trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3} trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3 #\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2} ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment