xueyiming преди 7 месеца
родител
ревизия
4e72964217

+ 7 - 13
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/AigcServiceImpl.java

@@ -20,15 +20,14 @@ import java.util.stream.Collectors;
 @Service
 public class AigcServiceImpl implements AigcService {
 
-    private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 8000, 20, 100, 3, 3000);
+    private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 10000, 20, 100, 3, 3000);
 
     @Override
     //获取所有长文系统托管计划
     public List<LongArticleSystemPlan> getAllLongArticleSystemPlan() {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/getAllLongArticleSystemPlan";
         try {
-            HttpPoolClientUtil httpPoolClientUtil = HttpClientUtil.create(5000, 20000, 5, 10, 3, 3000);
-            String res = httpPoolClientUtil.post(apiUrl);
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl);
             JSONObject jsonObject = JSON.parseObject(res);
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {
@@ -69,8 +68,7 @@ public class AigcServiceImpl implements AigcService {
     public LongArticleSystemContentVO listWaitingMatchMiniprogramContents(GetContentsParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/listWaitingMatchMiniprogramContents";
         try {
-            HttpPoolClientUtil httpPoolClientUtil = HttpClientUtil.create(5000, 8000, 5, 10, 3, 3000);
-            String res = httpPoolClientUtil.post(apiUrl, JSON.toJSONString(param));
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
             JSONObject jsonObject = JSON.parseObject(res);
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {
@@ -104,8 +102,7 @@ public class AigcServiceImpl implements AigcService {
     public String createPushTask(CreatePushTaskParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/createPushTask";
         try {
-            HttpPoolClientUtil httpPoolClientUtil = HttpClientUtil.create(5000, 8000, 5, 10, 3, 3000);
-            String res = httpPoolClientUtil.post(apiUrl, JSON.toJSONString(param));
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
             JSONObject jsonObject = JSON.parseObject(res);
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {
@@ -122,8 +119,7 @@ public class AigcServiceImpl implements AigcService {
     public boolean updateMatchMiniprogramStatus(MatchMiniprogramStatusParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/updateMatchMiniprogramStatus";
         try {
-            HttpPoolClientUtil httpPoolClientUtil = HttpClientUtil.create(5000, 8000, 5, 10, 3, 3000);
-            String res = httpPoolClientUtil.post(apiUrl, JSON.toJSONString(param));
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
             JSONObject jsonObject = JSON.parseObject(res);
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {
@@ -139,8 +135,7 @@ public class AigcServiceImpl implements AigcService {
     public boolean filterSortContents(FilterSortParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/filterSortContents";
         try {
-            HttpPoolClientUtil httpPoolClientUtil = HttpClientUtil.create(5000, 8000, 5, 10, 3, 3000);
-            String res = httpPoolClientUtil.post(apiUrl, JSON.toJSONString(param));
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
             JSONObject jsonObject = JSON.parseObject(res);
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {
@@ -175,11 +170,10 @@ public class AigcServiceImpl implements AigcService {
         }
         String apiUrl = "http://aigc-api.cybertogether.net/aigc//publish/LongArticleSystem/uploadMiniprogramCover";
         try {
-            HttpPoolClientUtil httpPoolClientUtil = HttpClientUtil.create(5000, 8000, 5, 10, 3, 3000);
             JSONObject param = new JSONObject();
             param.put("coverUrl", coverUrl);
             param.put("publishContentId", publishContentId);
-            String res = httpPoolClientUtil.post(apiUrl, JSONObject.toJSONString(param));
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSONObject.toJSONString(param));
             JSONObject jsonObject = JSON.parseObject(res);
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {

+ 1 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/SortServiceImpl.java

@@ -18,12 +18,12 @@ import java.util.Objects;
 @Service
 public class SortServiceImpl implements SortService {
 
+    HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 200000, 20, 100, 3, 3000);
 
     public ArticleSortResponse publishArticleSort(ArticleSortRequest request) {
         ArticleSortResponse response = new ArticleSortResponse();
         String apiUrl = "http://101.37.174.139:80/recommend";
         try {
-            HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 200000, 5, 10, 3, 3000);
             String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(request));
             log.info("publishArticleSort res={}", res);
             response = JSON.parseObject(res, ArticleSortResponse.class);