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

plan-java v0.09

(cherry picked from commit e19f9d9ace71d13cbff5455dbdd8f40eef384b6b)
MOKASZ\lw12420 2 лет назад
Родитель
Сommit
8d3b373d55

+ 13 - 5
launch-admin/src/main/java/com/webflux/launchadmin/mysql/controller/planNew/PlanNewController.java

@@ -1,5 +1,7 @@
 package com.webflux.launchadmin.mysql.controller.planNew;
 
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.webflux.launchadmin.config.BaseContextHandler;
 import com.webflux.launchadmin.global.BaseException;
 import com.webflux.launchadmin.mysql.controller.lbOut.resp.DataList;
@@ -62,7 +64,7 @@ public class PlanNewController {
      * @return {@link Mono}<{@link RStatus}<{@link BackgroupImageRes}>>
      */
     @GetMapping("backgroupSelectOne/{planNewId}/{qsOrFx}")
-    public Mono<RStatus<List<PlanNewBackgroupPoster>>> backgroupSelectOne(@PathVariable("id") Long planNewId,@PathVariable("qsOrFx") Integer qsOrFx ){
+    public Mono<RStatus<List<PlanNewBackgroupPoster>>> backgroupSelectOne(@PathVariable("planNewId") Long planNewId,@PathVariable("qsOrFx") Integer qsOrFx ){
         Mono<List<PlanNewBackgroupPoster>> listMono = template.select(Query.query(Criteria.where("plan_new_id").is(planNewId)
                 .and("qs_or_fx").is(qsOrFx)), PlanNewBackgroupPoster.class)
                 .collectList();
@@ -373,7 +375,8 @@ public class PlanNewController {
                 saveRequest.getTopAdvBl(),
                 saveRequest.getBottomAdvBl(),
                 saveRequest.getReturnLoopBl(),
-                saveRequest.getGroupIdQs()
+                saveRequest.getGroupIdQs(),
+                saveRequest.getBaiduDot()
         );
         Mono<PlanNew> insert = template.insert(plan);
         Mono<PlanNew> map = insert.map(f -> {
@@ -407,7 +410,10 @@ public class PlanNewController {
                 null,
                 null,
                 planNewId,null,null);
-         template.insert(planNewBackgroupPoster);
+         template.insert(planNewBackgroupPoster).subscribe(f->{
+             JSONObject jsonObject = JSONUtil.parseObj(f);
+             System.out.println(jsonObject);
+         });
         return true;
     }
 
@@ -447,7 +453,8 @@ public class PlanNewController {
                         saveRequest.getTopAdvBl(),
                         saveRequest.getBottomAdvBl(),
                         saveRequest.getReturnLoopBl(),
-                        saveRequest.getGroupIdQs()
+                        saveRequest.getGroupIdQs(),
+                        saveRequest.getBaiduDot()
                 )).map(map -> {
                     template.update(map);
                     return map;
@@ -525,7 +532,8 @@ public class PlanNewController {
                         saveRequest.topAdvBl(),
                         saveRequest.bottomAdvBl(),
                         saveRequest.returnLoopBl(),
-                        saveRequest.groupIdQs()
+                        saveRequest.groupIdQs(),
+                        saveRequest.baiduDot()
                 )).map(map -> {
                     template.update(map);
                     return map;

+ 2 - 0
launch-admin/src/main/java/com/webflux/launchadmin/mysql/controller/planNew/req/PlanReq.java

@@ -96,6 +96,8 @@ public class PlanReq {
 
     private Long  groupIdQs;
 
+    private String  baiduDot;
+
     /**
      * 分享背景组-配置
      */

+ 2 - 1
launch-admin/src/main/java/com/webflux/launchadmin/mysql/entity/planNew/PlanNew.java

@@ -36,6 +36,7 @@ public record PlanNew(
         Integer topAdvBl,
         Integer bottomAdvBl,
         Integer returnLoopBl,
-        Long groupIdQs
+        Long groupIdQs,
+        String baiduDot
         ) {
 }

+ 2 - 0
launch-admin/src/main/java/com/webflux/launchadmin/mysql/entity/planNew/PlanNewBackgroupPoster.java

@@ -3,6 +3,7 @@ package com.webflux.launchadmin.mysql.entity.planNew;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.data.annotation.Id;
+import org.springframework.data.relational.core.mapping.Column;
 import org.springframework.data.relational.core.mapping.Table;
 
 import java.time.ZonedDateTime;
@@ -16,6 +17,7 @@ public record PlanNewBackgroupPoster(@Id Long id,//
                                      String limitTime,//分享限时
                                      String limitTimeRemark,//	分享限时内提示
                                      Integer status,//0:h5链接 1:客服二维码
+                                     @Column("idx")
                                      Integer index,//	背景图序号
                                      String serviceGroupId,//客服组 ,分割
                                      Integer serviceGroupType ,//1:客服组 2:上传图片

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

@@ -2,6 +2,7 @@ package com.webflux.launchadmin.mysql.service.planNew.goGenerate;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.RandomUtil;
+import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
@@ -51,8 +52,11 @@ public class GoGenerateService {
         JSONObject jsonObject = JSONUtil.parseObj(temStr);
         GoRequest goRequest = new GoRequest();
         BeanUtil.copyProperties(jsonObject,goRequest);
-        String post = HttpUtil.post(value + "/api/image/createImage", JSONUtil.parseObj(goRequest));
-        return post;
+        //HttpResponse response = HttpUtil.createPost(value + "/api/image/createImage").body(temStr).timeout(300000).execute();
+        //String body = response.body();
+
+        String body = HttpUtil.post(value + "/api/image/createImage", JSONUtil.parseObj(goRequest),100000);
+        return body;
 
     }
 
@@ -89,7 +93,8 @@ public class GoGenerateService {
                         .filter(ff -> "text".equals(ff.getT()))
                         .findFirst()
                         .ifPresent(item -> item.setV(material.content())));
-                String s = GoGenerate(JSONUtil.toJsonStr(goRequest));
+                String s1 = JSONUtil.toJsonStr(goRequest);
+                String s = GoGenerate(s1);
                 return Mono.just(s);
             });
             Mono<PosterRes> zip = getPosterResMono(insert, stringMono);
@@ -112,8 +117,8 @@ public class GoGenerateService {
             Update update = Update.update("updated_at", ZonedDateTime.now());
             if (jsonObject1.containsKey("code") && jsonObject1.get("code", Integer.class) == 0 && jsonObject1.containsKey("data")) {
                 JSONObject data = jsonObject1.get("data", JSONObject.class);
-                if (data.containsKey("url")) {
-                    String url = data.get("url", String.class);
+                if (data.containsKey("Url")) {
+                    String url = data.get("Url", String.class);
                     update.set("generate_images_url", url);
                     update.set("generate_images_Jjson", ret);
                     posterRes.setGenerateImagesUrl(url);