Commit 1b7b0d2b by shenjunjie

Merge branch 'feature' into 'release'

热点库-热搜趋势修复

See merge request !375
parents 11b5fe7e 9ee4925d
...@@ -34,7 +34,7 @@ import org.springframework.web.client.RestTemplate; ...@@ -34,7 +34,7 @@ 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.URI;
import java.net.URISyntaxException; 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;
...@@ -349,11 +349,9 @@ public class AppHotController extends BaseController { ...@@ -349,11 +349,9 @@ public class AppHotController extends BaseController {
@ApiOperation("热点库-品牌热点-热搜趋势") @ApiOperation("热点库-品牌热点-热搜趋势")
@GetMapping("/trend") @GetMapping("/trend")
public ResponseResult hotSearchTrend(@RequestParam String name, @RequestParam Long startTime, @RequestParam String type) throws URISyntaxException { public ResponseResult hotSearchTrend(@RequestParam String name, @RequestParam Long startTime, @RequestParam String type) throws Exception{
// 热搜名可能含有特殊字符,故使用特殊请求方式 // 参数中可能的特殊字符故做此处理
if (name.contains("+")){ name = URLEncoder.encode(name, "UTF-8");
name = name.replace("+", "%2B");
}
String url = hotSearchTrendUrl + "?name=" + name + "&startTime=" + startTime + "&type=" + HotPlatformEnum.convertFromName2Eng(type); String url = hotSearchTrendUrl + "?name=" + name + "&startTime=" + startTime + "&type=" + HotPlatformEnum.convertFromName2Eng(type);
ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.getForEntity(new URI(url), JSONObject.class); ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.getForEntity(new URI(url), JSONObject.class);
if (Objects.isNull(jsonObjectResponseEntity.getBody())) { if (Objects.isNull(jsonObjectResponseEntity.getBody())) {
......
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