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

修改接入反馈表url项接口

zyl 2 месяцев назад
Родитель
Сommit
ed4a797224

+ 21 - 0
liutongyi-admin/src/main/java/com/citygis/web/controller/TabKafkaSunController.java

@@ -0,0 +1,21 @@
+package com.citygis.web.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * kafka子表 前端控制器
+ * </p>
+ *
+ * @author citygis
+ * @since 2025-01-14
+ */
+@RestController
+@RequestMapping("/web/tab-kafka-sun")
+public class TabKafkaSunController {
+
+}
+

+ 21 - 0
liutongyi-admin/src/main/java/com/citygis/web/controller/TabUrlSunController.java

@@ -0,0 +1,21 @@
+package com.citygis.web.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * url子表 前端控制器
+ * </p>
+ *
+ * @author citygis
+ * @since 2025-01-14
+ */
+@RestController
+@RequestMapping("/web/tab-url-sun")
+public class TabUrlSunController {
+
+}
+

+ 70 - 58
liutongyi-admin/src/main/java/com/citygis/web/domain/TabUrl.java

@@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -16,113 +14,127 @@ import java.util.List;
 
 /**
  * <p>
- * Api数据资源信息表
+ * KAFKA数据资源信息表
  * </p>
  *
  * @author citygis
- * @since 2025-01-07
+ * @since 2025-01-14
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
 @TableName("TAB_URL")
-@ApiModel(value="TabUrl对象", description="Api数据资源信息表")
+@ApiModel(value = "TabUrl对象", description = "KAFKA数据资源信息表")
 public class TabUrl implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    @ApiModelProperty(value = "id")
+    @ApiModelProperty(value = "ID")
     @TableField("ID")
-    @TableId(value = "ID",type = IdType.ASSIGN_UUID)
-    @JsonSerialize(using = ToStringSerializer.class)
+    @TableId(value = "ID", type = IdType.ASSIGN_ID)
     private Long id;
 
-    @ApiModelProperty(value = "URL描述")
-    @TableField("URL_DETAIL")
-    private String urlDetail;
-
-    @ApiModelProperty(value = "编目状态")
-    @TableField("CATALOG_STATUS")
-    private String catalogStatus;
+    @ApiModelProperty(value = "接口服务名称")
+    @TableField("API_NAME")
+    private String apiName;
 
     @ApiModelProperty(value = "应用场景")
     @TableField("SCENARIO")
     private String scenario;
 
-    @ApiModelProperty(value = "提供方式")
-    @TableField("ACCRSS_TYPE")
-    private String accrssType;
-
-    @ApiModelProperty(value = "接收方式")
-    @TableField("OFFER_TYPE")
-    private String offerType;
+    @ApiModelProperty(value = "接口调用方")
+    @TableField("ACCESS")
+    private String access;
 
-    @ApiModelProperty(value = "提供url")
+    @ApiModelProperty(value = "接口调用方URL地址")
     @TableField("ACCESS_URL")
     private String accessUrl;
 
-    @ApiModelProperty(value = "接收url")
-    @TableField("OFFER_URL")
-    private String offerUrl;
-
-    @ApiModelProperty(value = "六统一url")
-    @TableField("LIUTONGYI_URL")
-    private String liutongyiUrl;
+    @ApiModelProperty(value = "支持格式")
+    @TableField("FORMAT")
+    private String format;
 
     @ApiModelProperty(value = "调用频率")
     @TableField("APPLY_COUNT")
     private String applyCount;
 
-    @ApiModelProperty(value = "每次请求数量")
+    @ApiModelProperty(value = "每频率内条数")
     @TableField("COUNT_NUM")
     private String countNum;
 
-    @ApiModelProperty(value = "描述")
-    @TableField("DETAILE")
-    private String detaile;
+    @ApiModelProperty(value = "调用间隔说明")
+    @TableField("COUNT_DETAIL")
+    private String countDetail;
 
     @ApiModelProperty(value = "联调数据量")
-    @TableField("DATA_COUNT")
-    private String dataCount;
+    @TableField("NUM")
+    private String num;
 
     @ApiModelProperty(value = "联调实施步骤")
     @TableField("STEPS")
     private String steps;
 
-    @ApiModelProperty(value = "网络侧率确认")
+    @ApiModelProperty(value = "网络策略确认")
     @TableField("INTERNET")
     private String internet;
 
-    @ApiModelProperty(value = "接收/提供")
-    @TableField("ACCESS_OR_OFFER")
-    private String accessOrOffer;
+    @ApiModelProperty(value = "响应示例")
+    @TableField("RESPONSE_EXAMPLE")
+    private String responseExample;
 
-    @ApiModelProperty(value = "接入反馈表id")
+    @ApiModelProperty(value = "请求示例")
+    @TableField("REQUEST_EXAMPLE")
+    private String requestExample;
+
+    @ApiModelProperty(value = "接入反馈表唯一id")
     @TableField("ACCESS_FEEDBACK_ID")
     private Long accessFeedbackId;
 
-    @ApiModelProperty(value = "成功响应")
-    @TableField("RESPONSE_SUCCESS")
-    private String responseSuccess;
+    @ApiModelProperty(value = "英文名")
+    @TableField("API_ENGLISH_NAME")
+    private String apiEnglishName;
+
+    @ApiModelProperty(value = "接口描述")
+    @TableField("API_DETAIL")
+    private String apiDetail;
 
-    @ApiModelProperty(value = "失败响应")
-    @TableField("RESPONSE_ERROR")
-    private String responseError;
+    @ApiModelProperty(value = "接口提供方")
+    @TableField("OFFER")
+    private String offer;
 
-    @ApiModelProperty(value = "请求参数")
-    @TableField("PARAM")
-    private String param;
+    @ApiModelProperty(value = "接口提供方地址")
+    @TableField("OFFER_URL")
+    private String offerUrl;
 
-    @ApiModelProperty(value = "token验证")
-    @TableField("TOKEN")
-    private String token;
+    @ApiModelProperty(value = "六统一URL")
+    @TableField("SIX_URL")
+    private String sixUrl;
 
-    @ApiModelProperty(value = "是否删除:0未删除,1删除")
-    @TableField("IS_DEL")
-    private Integer isDel;
+    @ApiModelProperty(value = "调用方向")
+    @TableField("DIRECTION")
+    private String direction;
 
-    @ApiModelProperty(value = "接入数据资源详情")
+    @ApiModelProperty(value = "请求方式")
+    @TableField("REQUEST_METHOD")
+    private String requestMethod;
+
+    @ApiModelProperty(value = "header")
+    @TableField(exist = false)
+    private List<TabUrlSun> tabEtlHeaderSuns;
+
+    @ApiModelProperty(value = "body")
+    @TableField(exist = false)
+    private List<TabUrlSun> tabEtlBodySuns;
+
+    @ApiModelProperty(value = "query")
+    @TableField(exist = false)
+    private List<TabUrlSun> tabEtlQuerySuns;
+
+    @ApiModelProperty(value = "response")
     @TableField(exist = false)
-    private List<TabDatasourceMsg> tabDatasourceMsgs;
+    private List<TabUrlSun> tabEtlResponseSuns;
 
+    @ApiModelProperty(value = "data")
+    @TableField(exist = false)
+    private List<TabUrlSun> tabEtlDataSuns;
 
 }

+ 68 - 0
liutongyi-admin/src/main/java/com/citygis/web/domain/TabUrlSun.java

@@ -0,0 +1,68 @@
+package com.citygis.web.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * url子表
+ * </p>
+ *
+ * @author citygis
+ * @since 2025-01-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("TAB_URL_SUN")
+@ApiModel(value = "TabUrlSun对象", description = "url子表")
+public class TabUrlSun implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "ID")
+    @TableField("ID")
+    @TableId(value = "ID", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    @ApiModelProperty(value = "中文名称")
+    @TableField("NAME")
+    private String name;
+
+    @ApiModelProperty(value = "英文名称")
+    @TableField("ENGLISH_NAME")
+    private String englishName;
+
+    @ApiModelProperty(value = "数据类型")
+    @TableField("DATA_TYPE")
+    private String dataType;
+
+    @ApiModelProperty(value = "是否必填:0非必填1必填")
+    @TableField("IS_REQUIRED")
+    private String isRequired;
+
+    @ApiModelProperty(value = "描述")
+    @TableField("PS")
+    private String ps;
+
+    @ApiModelProperty(value = "示例说明")
+    @TableField("EXAMPLE")
+    private String example;
+
+    @ApiModelProperty(value = "url主表id")
+    @TableField("URL_ID")
+    private Long urlId;
+
+    @ApiModelProperty(value = "类型")
+    @TableField("TYPE")
+    private String type;
+
+
+}

+ 135 - 3
liutongyi-admin/src/main/java/com/citygis/web/service/impl/TabDatasourceMsgServiceImpl.java

@@ -47,6 +47,9 @@ public class TabDatasourceMsgServiceImpl extends ServiceImpl<TabDatasourceMsgMap
     @Resource
     ITabKafkaSunService tabKafkaSunService;
 
+    @Resource
+    ITabUrlSunService tabUrlSunService;
+
     @Override
     @Transactional
     public AjaxResult insertDataSun(DataSun dataSun) {
@@ -109,6 +112,7 @@ public class TabDatasourceMsgServiceImpl extends ServiceImpl<TabDatasourceMsgMap
         List<TabKb> kb = dataSun.getKb();
         if (kb != null) {
             kb.forEach(tabKb -> {
+                tabKb.setId(snowflake.nextId());
                 tabKb.setAccessFeedbackId(dataSun.getAccessFeedbackId());
                 tabKbService.save(tabKb);
             });
@@ -117,6 +121,7 @@ public class TabDatasourceMsgServiceImpl extends ServiceImpl<TabDatasourceMsgMap
         List<TabSftp> sftp = dataSun.getSftp();
         if (sftp != null) {
             sftp.forEach(tabSftp -> {
+                tabSftp.setId(snowflake.nextId());
                 tabSftp.setAccessFeedbackId(dataSun.getAccessFeedbackId());
                 tabSftpService.save(tabSftp);
             });
@@ -125,8 +130,39 @@ public class TabDatasourceMsgServiceImpl extends ServiceImpl<TabDatasourceMsgMap
         List<TabUrl> url = dataSun.getUrl();
         if (url != null) {
             url.forEach(tabUrl -> {
+                long urlId = snowflake.nextId();
                 tabUrl.setAccessFeedbackId(dataSun.getAccessFeedbackId());
                 tabUrlService.save(tabUrl);
+
+                tabUrl.getTabEtlHeaderSuns().forEach(tabUrlSun -> {
+                    tabUrlSun.setId(snowflake.nextId());
+                    tabUrlSun.setUrlId(urlId);
+                    tabUrlSunService.save(tabUrlSun);
+                });
+
+                tabUrl.getTabEtlBodySuns().forEach(tabUrlSun -> {
+                    tabUrlSun.setId(snowflake.nextId());
+                    tabUrlSun.setUrlId(urlId);
+                    tabUrlSunService.save(tabUrlSun);
+                });
+
+                tabUrl.getTabEtlQuerySuns().forEach(tabUrlSun -> {
+                    tabUrlSun.setId(snowflake.nextId());
+                    tabUrlSun.setUrlId(urlId);
+                    tabUrlSunService.save(tabUrlSun);
+                });
+
+                tabUrl.getTabEtlResponseSuns().forEach(tabUrlSun -> {
+                    tabUrlSun.setId(snowflake.nextId());
+                    tabUrlSun.setUrlId(urlId);
+                    tabUrlSunService.save(tabUrlSun);
+                });
+
+                tabUrl.getTabEtlDataSuns().forEach(tabUrlSun -> {
+                    tabUrlSun.setId(snowflake.nextId());
+                    tabUrlSun.setUrlId(urlId);
+                    tabUrlSunService.save(tabUrlSun);
+                });
             });
         }
 
@@ -212,6 +248,67 @@ public class TabDatasourceMsgServiceImpl extends ServiceImpl<TabDatasourceMsgMap
             url.forEach(tabUrl -> {
                 tabUrl.setAccessFeedbackId(dataSun.getAccessFeedbackId());
                 tabUrlService.saveOrUpdate(tabUrl);
+
+                tabUrl.getTabEtlHeaderSuns().forEach(tabUrlSun -> {
+                    LambdaQueryWrapper<TabUrlSun> kql = new LambdaQueryWrapper<>();
+                    kql.eq(TabUrlSun::getId, tabUrlSun.getId());
+                    TabUrlSun one = tabUrlSunService.getOne(kql);
+                    if (one != null) {
+                        tabUrlSunService.updateById(one);
+                    } else {
+                        tabUrlSun.setId(snowflake.nextId());
+                        tabUrlSunService.save(tabUrlSun);
+                    }
+                });
+
+                tabUrl.getTabEtlBodySuns().forEach(tabUrlSun -> {
+                    LambdaQueryWrapper<TabUrlSun> kql = new LambdaQueryWrapper<>();
+                    kql.eq(TabUrlSun::getId, tabUrlSun.getId());
+                    TabUrlSun one = tabUrlSunService.getOne(kql);
+                    if (one != null) {
+                        tabUrlSunService.updateById(one);
+                    } else {
+                        tabUrlSun.setId(snowflake.nextId());
+                        tabUrlSunService.save(tabUrlSun);
+                    }
+                });
+
+                tabUrl.getTabEtlQuerySuns().forEach(tabUrlSun -> {
+                    LambdaQueryWrapper<TabUrlSun> kql = new LambdaQueryWrapper<>();
+                    kql.eq(TabUrlSun::getId, tabUrlSun.getId());
+                    TabUrlSun one = tabUrlSunService.getOne(kql);
+                    if (one != null) {
+                        tabUrlSunService.updateById(one);
+                    } else {
+                        tabUrlSun.setId(snowflake.nextId());
+                        tabUrlSunService.save(tabUrlSun);
+                    }
+                });
+
+                tabUrl.getTabEtlResponseSuns().forEach(tabUrlSun -> {
+                    LambdaQueryWrapper<TabUrlSun> kql = new LambdaQueryWrapper<>();
+                    kql.eq(TabUrlSun::getId, tabUrlSun.getId());
+                    TabUrlSun one = tabUrlSunService.getOne(kql);
+                    if (one != null) {
+                        tabUrlSunService.updateById(one);
+                    } else {
+                        tabUrlSun.setId(snowflake.nextId());
+                        tabUrlSunService.save(tabUrlSun);
+                    }
+                });
+
+                tabUrl.getTabEtlDataSuns().forEach(tabUrlSun -> {
+                    LambdaQueryWrapper<TabUrlSun> kql = new LambdaQueryWrapper<>();
+                    kql.eq(TabUrlSun::getId, tabUrlSun.getId());
+                    TabUrlSun one = tabUrlSunService.getOne(kql);
+                    if (one != null) {
+                        tabUrlSunService.updateById(one);
+                    } else {
+                        tabUrlSun.setId(snowflake.nextId());
+                        tabUrlSunService.save(tabUrlSun);
+                    }
+                });
+
             });
         }
 
@@ -246,9 +343,12 @@ public class TabDatasourceMsgServiceImpl extends ServiceImpl<TabDatasourceMsgMap
         tabSftpService.updateById(tabSftp);
 
         TabUrl tabUrl = new TabUrl();
-        tabUrl.setAccessFeedbackId(id);
-        tabUrl.setIsDel(1);
-        tabUrlService.updateById(tabUrl);
+        tabUrl.setId(id);
+        tabUrlService.removeById(tabUrl);
+
+        LambdaQueryWrapper<TabUrlSun> uql = new LambdaQueryWrapper<>();
+        uql.eq(TabUrlSun::getUrlId, id);
+        tabUrlSunService.remove(uql);
 
         return AjaxResult.success("删除成功");
 
@@ -297,6 +397,38 @@ public class TabDatasourceMsgServiceImpl extends ServiceImpl<TabDatasourceMsgMap
         urlql.eq(TabUrl::getAccessFeedbackId, id);
         List<TabUrl> tabUrls = tabUrlService.list(urlql);
 
+        tabUrls.forEach(tabUrl -> {
+            LambdaQueryWrapper<TabUrlSun> hql = new LambdaQueryWrapper<>();
+            hql.eq(TabUrlSun::getUrlId, tabUrl.getId());
+            hql.eq(TabUrlSun::getType, "header");
+            List<TabUrlSun> tabUrlSunS = tabUrlSunService.list(hql);
+            tabUrl.setTabEtlHeaderSuns(tabUrlSunS);
+
+            LambdaQueryWrapper<TabUrlSun> bql = new LambdaQueryWrapper<>();
+            bql.eq(TabUrlSun::getUrlId, tabUrl.getId());
+            bql.eq(TabUrlSun::getType, "body");
+            List<TabUrlSun> tabUrlSunS1 = tabUrlSunService.list(bql);
+            tabUrl.setTabEtlBodySuns(tabUrlSunS1);
+
+            LambdaQueryWrapper<TabUrlSun> qql = new LambdaQueryWrapper<>();
+            qql.eq(TabUrlSun::getUrlId, tabUrl.getId());
+            qql.eq(TabUrlSun::getType, "query");
+            List<TabUrlSun> tabUrlSunS2 = tabUrlSunService.list(qql);
+            tabUrl.setTabEtlQuerySuns(tabUrlSunS2);
+
+            LambdaQueryWrapper<TabUrlSun> rql = new LambdaQueryWrapper<>();
+            rql.eq(TabUrlSun::getUrlId, tabUrl.getId());
+            rql.eq(TabUrlSun::getType, "response");
+            List<TabUrlSun> tabUrlSunS3 = tabUrlSunService.list(rql);
+            tabUrl.setTabEtlResponseSuns(tabUrlSunS3);
+
+            LambdaQueryWrapper<TabUrlSun> dql = new LambdaQueryWrapper<>();
+            dql.eq(TabUrlSun::getUrlId, tabUrl.getId());
+            dql.eq(TabUrlSun::getType, "data");
+            List<TabUrlSun> tabUrlSunS4 = tabUrlSunService.list(dql);
+            tabUrl.setTabEtlDataSuns(tabUrlSunS4);
+        });
+
         DataSun dataSun = new DataSun();
         dataSun.setEtl(tabEtls);
         dataSun.setKafka(tabKafkas);