Просмотр исходного кода

针对code压测 v0.01

(cherry picked from commit 5a609f670ff2389d070b95e88e11996ef6d4fd48)
MOKASZ\lw12420 1 год назад
Родитель
Сommit
c923d95ff2

+ 7 - 1
launch-admin/src/main/java/com/webflux/launchadmin/mysql/controller/planNew/PlanNewOutController.java

@@ -688,6 +688,7 @@ public class PlanNewOutController {
 //设置二维码 生成图片
 //设置二维码 生成图片
     private Mono<DataLists0> setEndData(HftRequest request, Mono<DataLists0> dataLists0Mono2) {
     private Mono<DataLists0> setEndData(HftRequest request, Mono<DataLists0> dataLists0Mono2) {
         Mono<DataLists0> dataLists0Mono1 = dataLists0Mono2.flatMap(fm -> {
         Mono<DataLists0> dataLists0Mono1 = dataLists0Mono2.flatMap(fm -> {
+            String code = fm.getPlanNew().code();
             Poster poster = fm.getPoster();
             Poster poster = fm.getPoster();
             if (Objects.isNull(poster)) {
             if (Objects.isNull(poster)) {
                 return Mono.just(fm);
                 return Mono.just(fm);
@@ -737,7 +738,12 @@ public class PlanNewOutController {
                     });
                     });
                 }
                 }
                 DataLists0 fm3 = f9.getT3();
                 DataLists0 fm3 = f9.getT3();
-                String ret = goGenerateService.goGenerate(JSONUtil.toJsonStr(goRequest2));
+               String ret;
+                if("38fcfd7bd5434c5d91d6b9519986a098".equals(code)){
+                     ret = goGenerateService.goGenerateCode(JSONUtil.toJsonStr(goRequest2));
+                }else {
+                     ret = goGenerateService.goGenerate(JSONUtil.toJsonStr(goRequest2));
+                }
                 if (Objects.nonNull(ret)) {
                 if (Objects.nonNull(ret)) {
                     JSONObject jsonObject1;
                     JSONObject jsonObject1;
                     try {
                     try {

+ 14 - 0
launch-admin/src/main/java/com/webflux/launchadmin/mysql/service/planNew/goGenerate/GoGenerateService.java

@@ -70,6 +70,20 @@ public class GoGenerateService {
             throw new BaseException(e.getMessage() + "body:::" + body + ":::request:::" + temStr);
             throw new BaseException(e.getMessage() + "body:::" + body + ":::request:::" + temStr);
         }
         }
     }
     }
+    public String goGenerateCode(String temStr) {
+        String body = "";
+        String url = "http://172.19.192.16:80/api/image/createImage";
+        try {
+            long ls = System.currentTimeMillis();
+            body = HttpUtil.post(url, temStr, 100000);
+            long le = System.currentTimeMillis();
+            log.info("请求go-createImage 用时:"+(le-ls)+"ms");
+            return body;
+        } catch (Exception e) {
+            log.error("error: body:::" + body + ":::request:::" + temStr + ", url: {}", url, e);
+            throw new BaseException(e.getMessage() + "body:::" + body + ":::request:::" + temStr);
+        }
+    }
 
 
     public String goGenerateStr(String temStr) {
     public String goGenerateStr(String temStr) {
         String body = "";
         String body = "";