Browse Source

Merge branch 'data-bridge' of wangfan/adweb3-server into master

wangfan 6 months ago
parent
commit
b7351cd016
15 changed files with 345 additions and 5 deletions
  1. 2 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/common/util/RestTemplateUtil.java
  2. 32 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/ResourceDTO.java
  3. 16 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/CreatePropertyRequestDTO.java
  4. 27 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/GAAccountDTO.java
  5. 24 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/GADataStreamDTO.java
  6. 45 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/GAPropertyDTO.java
  7. 16 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/CreateContainerRequestDTO.java
  8. 27 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMAccountDTO.java
  9. 43 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMContainerDTO.java
  10. 30 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMTriggerDTO.java
  11. 28 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMVersionDTO.java
  12. 26 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMWorkspaceDTO.java
  13. 10 2
      jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  14. 9 1
      jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml
  15. 10 2
      jeecg-module-system/jeecg-system-start/src/main/resources/application-test.yml

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/common/util/RestTemplateUtil.java

@@ -13,6 +13,8 @@ import java.util.Map;
 /**
  * {@link RestTemplate}初始化及工厂类
  *
+ * <p>普通文本类型HTTP请求,请使用{@link org.jeecg.common.util.RestUtil}
+ *
  * @author wfansh
  */
 @Slf4j

+ 32 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/ResourceDTO.java

@@ -0,0 +1,32 @@
+package org.jeecg.modules.adweb.databridge.dto.google;
+
+import com.google.common.base.Splitter;
+import com.google.common.collect.Iterables;
+
+import lombok.Data;
+import lombok.experimental.SuperBuilder;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author wfansh
+ */
+@Data
+@SuperBuilder
+public abstract class ResourceDTO implements Serializable {
+
+    protected static final char RESOURCE_NAME_SPLITTER = '/';
+
+    private String id;
+
+    private String resourceName;
+
+    private String displayName;
+
+    /** Parses ID from the resource name. */
+    public static String parseId(String resourceName) {
+        List<String> parts = Splitter.on(RESOURCE_NAME_SPLITTER).splitToList(resourceName);
+        return parts.isEmpty() ? null : Iterables.getLast(parts);
+    }
+}

+ 16 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/CreatePropertyRequestDTO.java

@@ -0,0 +1,16 @@
+package org.jeecg.modules.adweb.databridge.dto.google.analytics;
+
+import lombok.Data;
+
+/**
+ * @author wfansh
+ */
+@Data
+public class CreatePropertyRequestDTO {
+
+    private String accountResourceName;
+
+    private String displayName;
+
+    private String url;
+}

+ 27 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/GAAccountDTO.java

@@ -0,0 +1,27 @@
+package org.jeecg.modules.adweb.databridge.dto.google.analytics;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.modules.adweb.databridge.dto.google.ResourceDTO;
+
+/**
+ * @author wfansh
+ */
+@Data
+@SuperBuilder
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+public class GAAccountDTO extends ResourceDTO {
+
+    private long createTime;
+
+    private long updateTime;
+
+    public static String toResourceName(String id) {
+        return StringUtils.isNumeric(id) ? "accounts" + RESOURCE_NAME_SPLITTER + id : id;
+    }
+}

+ 24 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/GADataStreamDTO.java

@@ -0,0 +1,24 @@
+package org.jeecg.modules.adweb.databridge.dto.google.analytics;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+import org.jeecg.modules.adweb.databridge.dto.google.ResourceDTO;
+
+/**
+ * @author wfansh
+ */
+@Data
+@SuperBuilder
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+public class GADataStreamDTO extends ResourceDTO {
+
+    private String propertyResourceName;
+
+    private String streamMeasurementId;
+
+    private String streamDefaultUrl;
+}

+ 45 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/GAPropertyDTO.java

@@ -0,0 +1,45 @@
+package org.jeecg.modules.adweb.databridge.dto.google.analytics;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.modules.adweb.databridge.dto.google.ResourceDTO;
+
+import java.util.List;
+
+/**
+ * @author wfansh
+ */
+@Data
+@SuperBuilder
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+public class GAPropertyDTO extends ResourceDTO {
+
+    private String propertyType;
+
+    private String accountResourceName;
+
+    private String parentResourceName;
+
+    private String industryCategory;
+
+    private String timeZone;
+
+    private String currencyCode;
+
+    private String serviceLevel;
+
+    private long createTime;
+
+    private long updateTime;
+
+    private List<GADataStreamDTO> dataStreams;
+
+    public static String toResourceName(String id) {
+        return StringUtils.isNumeric(id) ? "properties" + RESOURCE_NAME_SPLITTER + id : id;
+    }
+}

+ 16 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/CreateContainerRequestDTO.java

@@ -0,0 +1,16 @@
+package org.jeecg.modules.adweb.databridge.dto.google.gtm;
+
+import lombok.Data;
+
+/**
+ * @author wfansh
+ */
+@Data
+public class CreateContainerRequestDTO {
+
+    private String accountResourceName;
+
+    private String displayName;
+
+    private String googleTagId;
+}

+ 27 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMAccountDTO.java

@@ -0,0 +1,27 @@
+package org.jeecg.modules.adweb.databridge.dto.google.gtm;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.modules.adweb.databridge.dto.google.ResourceDTO;
+
+/**
+ * @author wfansh
+ */
+@Data
+@SuperBuilder
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+public class GTMAccountDTO extends ResourceDTO {
+
+    private boolean supportUserPermissions;
+
+    private boolean supportMultipleContainers;
+
+    public static String toResourceName(String id) {
+        return StringUtils.isNumeric(id) ? "accounts" + RESOURCE_NAME_SPLITTER + id : id;
+    }
+}

+ 43 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMContainerDTO.java

@@ -0,0 +1,43 @@
+package org.jeecg.modules.adweb.databridge.dto.google.gtm;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.modules.adweb.databridge.dto.google.ResourceDTO;
+
+import java.util.List;
+
+/**
+ * @author wfansh
+ */
+@Data
+@SuperBuilder
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+public class GTMContainerDTO extends ResourceDTO {
+
+    private String accountId;
+
+    private List<String> domainNames;
+
+    private String publicId;
+
+    private List<String> tagIds;
+
+    private String notes;
+
+    private List<String> usageContext;
+
+    private String headSnippet;
+
+    private String bodySnippet;
+
+    private String fingerprint;
+
+    public static String toResourceName(String id) {
+        return StringUtils.isNumeric(id) ? "accounts" + RESOURCE_NAME_SPLITTER + id : id;
+    }
+}

+ 30 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMTriggerDTO.java

@@ -0,0 +1,30 @@
+package org.jeecg.modules.adweb.databridge.dto.google.gtm;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+import org.jeecg.modules.adweb.databridge.dto.google.ResourceDTO;
+
+/**
+ * @author wfansh
+ */
+@Data
+@SuperBuilder
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+public class GTMTriggerDTO extends ResourceDTO {
+
+    private String accountId;
+
+    private String containerId;
+
+    private String workspaceId;
+
+    private String type;
+
+    private String notes;
+
+    private String fingerprint;
+}

+ 28 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMVersionDTO.java

@@ -0,0 +1,28 @@
+package org.jeecg.modules.adweb.databridge.dto.google.gtm;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+import org.jeecg.modules.adweb.databridge.dto.google.ResourceDTO;
+
+/**
+ * @author wfansh
+ */
+@Data
+@SuperBuilder
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+public class GTMVersionDTO extends ResourceDTO {
+
+    private String accountId;
+
+    private String containerId;
+
+    private boolean deleted;
+
+    private String description;
+
+    private String fingerprint;
+}

+ 26 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMWorkspaceDTO.java

@@ -0,0 +1,26 @@
+package org.jeecg.modules.adweb.databridge.dto.google.gtm;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+import org.jeecg.modules.adweb.databridge.dto.google.ResourceDTO;
+
+/**
+ * @author wfansh
+ */
+@Data
+@SuperBuilder
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+public class GTMWorkspaceDTO extends ResourceDTO {
+
+    private String accountId;
+
+    private String containerId;
+
+    private String description;
+
+    private String fingerprint;
+}

+ 10 - 2
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -246,7 +246,7 @@ jeecg:
   #大屏报表参数设置
   jmreport:
     #多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离) (v1.6.2+ 新增)
-    saasMode: 
+    saasMode:
     # 平台上线安全配置(v1.6.2+ 新增)
     firewall:
       # 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
@@ -334,4 +334,12 @@ security:
       ignore-urls:
         - /test/jeecgDemo/demo3
         - /test/jeecgDemo/redisDemo/**
-        - /jmreport/bigscreen2/**
+        - /jmreport/bigscreen2/**
+
+### 自定义
+### GA,GTM,Ads等数据交换中心
+data-bridge:
+  open:
+    api:
+      host: http://data-bridge.v3.adwebcloud.com:9002
+      token: lgoXX9APqgPLGMPECiNoxaPx

+ 9 - 1
jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml

@@ -322,4 +322,12 @@ security:
         - /test/jeecgDemo/demo3
         - /test/jeecgDemo/redisDemo/**
         - /jmreport/bigscreen2/**
-        - /api/getUserInfo
+        - /api/getUserInfo
+
+### 自定义
+### GA,GTM,Ads等数据交换中心
+data-bridge:
+  open:
+    api:
+      host: http://data-bridge.v3.adwebcloud.com:9002
+      token: lgoXX9APqgPLGMPECiNoxaPx

+ 10 - 2
jeecg-module-system/jeecg-system-start/src/main/resources/application-test.yml

@@ -246,7 +246,7 @@ jeecg:
   #大屏报表参数设置
   jmreport:
     #多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离) (v1.6.2+ 新增)
-    saasMode: 
+    saasMode:
     # 平台上线安全配置(v1.6.2+ 新增)
     firewall:
       # 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
@@ -320,4 +320,12 @@ security:
       ignore-urls:
         - /test/jeecgDemo/demo3
         - /test/jeecgDemo/redisDemo/**
-        - /jmreport/bigscreen2/**
+        - /jmreport/bigscreen2/**
+
+### 自定义
+### GA,GTM,Ads等数据交换中心
+data-bridge:
+  open:
+    api:
+      host: http://data-bridge.v3.adwebcloud.com:9002
+      token: lgoXX9APqgPLGMPECiNoxaPx