Browse Source

Data bridge DTOs

wfansh 6 months ago
parent
commit
dea6bc981e
11 changed files with 314 additions and 0 deletions
  1. 32 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/ResourceDTO.java
  2. 16 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/CreatePropertyRequestDTO.java
  3. 27 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/GAAccountDTO.java
  4. 24 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/GADataStreamDTO.java
  5. 45 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/analytics/GAPropertyDTO.java
  6. 16 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/CreateContainerRequestDTO.java
  7. 27 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMAccountDTO.java
  8. 43 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMContainerDTO.java
  9. 30 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMTriggerDTO.java
  10. 28 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMVersionDTO.java
  11. 26 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/databridge/dto/google/gtm/GTMWorkspaceDTO.java

+ 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;
+}