From 93c593bb419b1d8983cd36dd6e5bcb76e6c99321 Mon Sep 17 00:00:00 2001 From: Brian Long Date: Wed, 15 Nov 2023 20:16:10 -0500 Subject: [PATCH 1/2] added ModelsApi get --- .../inteligr8/alfresco/activiti/api/ModelsApi.java | 12 ++++++++++-- .../alfresco/activiti/model/ModelRepresentation.java | 12 ++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/inteligr8/alfresco/activiti/api/ModelsApi.java b/src/main/java/com/inteligr8/alfresco/activiti/api/ModelsApi.java index 1819cb6..768a9f9 100644 --- a/src/main/java/com/inteligr8/alfresco/activiti/api/ModelsApi.java +++ b/src/main/java/com/inteligr8/alfresco/activiti/api/ModelsApi.java @@ -16,10 +16,12 @@ package com.inteligr8.alfresco.activiti.api; import javax.ws.rs.GET; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; -import com.inteligr8.alfresco.activiti.model.ResultListDataRepresentation; +import com.inteligr8.activiti.model.ResultList; +import com.inteligr8.alfresco.activiti.model.ModelRepresentation; @Path("/api/enterprise/models") public interface ModelsApi { @@ -40,8 +42,14 @@ public interface ModelsApi { } @GET + @Path("{id}") @Produces({ "application/json" }) - public ResultListDataRepresentation get( + public ModelRepresentation get( + @PathParam("id") String id); + + @GET + @Produces({ "application/json" }) + public ResultList get( @QueryParam("filter") String filter, @QueryParam("sort") String sort, @QueryParam("modelType") Integer modelType, diff --git a/src/main/java/com/inteligr8/alfresco/activiti/model/ModelRepresentation.java b/src/main/java/com/inteligr8/alfresco/activiti/model/ModelRepresentation.java index 06219b1..d22741d 100644 --- a/src/main/java/com/inteligr8/alfresco/activiti/model/ModelRepresentation.java +++ b/src/main/java/com/inteligr8/alfresco/activiti/model/ModelRepresentation.java @@ -1,10 +1,13 @@ package com.inteligr8.alfresco.activiti.model; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonFormat.Shape; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -52,7 +55,8 @@ public class ModelRepresentation { @JsonProperty("id") private Integer id; @JsonProperty("lastUpdated") - private String lastUpdated; + @JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXX") + private OffsetDateTime lastUpdated; @JsonProperty("lastUpdatedBy") private Integer lastUpdatedBy; @JsonProperty("lastUpdatedByFullName") @@ -167,16 +171,16 @@ public class ModelRepresentation { } @JsonProperty("lastUpdated") - public String getLastUpdated() { + public OffsetDateTime getLastUpdated() { return lastUpdated; } @JsonProperty("lastUpdated") - public void setLastUpdated(String lastUpdated) { + public void setLastUpdated(OffsetDateTime lastUpdated) { this.lastUpdated = lastUpdated; } - public ModelRepresentation withLastUpdated(String lastUpdated) { + public ModelRepresentation withLastUpdated(OffsetDateTime lastUpdated) { this.lastUpdated = lastUpdated; return this; } From 09aabea4e3d88d174598f65d36bb2573d51a4219 Mon Sep 17 00:00:00 2001 From: Brian Long Date: Thu, 16 Nov 2023 09:20:22 -0500 Subject: [PATCH 2/2] int$64 is long --- .../activiti/model/ModelRepresentation.java | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/inteligr8/alfresco/activiti/model/ModelRepresentation.java b/src/main/java/com/inteligr8/alfresco/activiti/model/ModelRepresentation.java index d22741d..89b064f 100644 --- a/src/main/java/com/inteligr8/alfresco/activiti/model/ModelRepresentation.java +++ b/src/main/java/com/inteligr8/alfresco/activiti/model/ModelRepresentation.java @@ -45,7 +45,7 @@ public class ModelRepresentation { @JsonProperty("comment") private String comment; @JsonProperty("createdBy") - private Integer createdBy; + private Long createdBy; @JsonProperty("createdByFullName") private String createdByFullName; @JsonProperty("description") @@ -53,12 +53,12 @@ public class ModelRepresentation { @JsonProperty("favorite") private Boolean favorite; @JsonProperty("id") - private Integer id; + private Long id; @JsonProperty("lastUpdated") @JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXX") private OffsetDateTime lastUpdated; @JsonProperty("lastUpdatedBy") - private Integer lastUpdatedBy; + private Long lastUpdatedBy; @JsonProperty("lastUpdatedByFullName") private String lastUpdatedByFullName; @JsonProperty("latestVersion") @@ -70,11 +70,11 @@ public class ModelRepresentation { @JsonProperty("permission") private String permission; @JsonProperty("referenceId") - private Integer referenceId; + private Long referenceId; @JsonProperty("stencilSet") - private Integer stencilSet; + private Long stencilSet; @JsonProperty("tenantId") - private Integer tenantId; + private Long tenantId; @JsonProperty("version") private Integer version; @JsonIgnore @@ -96,16 +96,16 @@ public class ModelRepresentation { } @JsonProperty("createdBy") - public Integer getCreatedBy() { + public Long getCreatedBy() { return createdBy; } @JsonProperty("createdBy") - public void setCreatedBy(Integer createdBy) { + public void setCreatedBy(Long createdBy) { this.createdBy = createdBy; } - public ModelRepresentation withCreatedBy(Integer createdBy) { + public ModelRepresentation withCreatedBy(Long createdBy) { this.createdBy = createdBy; return this; } @@ -156,16 +156,16 @@ public class ModelRepresentation { } @JsonProperty("id") - public Integer getId() { + public Long getId() { return id; } @JsonProperty("id") - public void setId(Integer id) { + public void setId(Long id) { this.id = id; } - public ModelRepresentation withId(Integer id) { + public ModelRepresentation withId(Long id) { this.id = id; return this; } @@ -186,16 +186,16 @@ public class ModelRepresentation { } @JsonProperty("lastUpdatedBy") - public Integer getLastUpdatedBy() { + public Long getLastUpdatedBy() { return lastUpdatedBy; } @JsonProperty("lastUpdatedBy") - public void setLastUpdatedBy(Integer lastUpdatedBy) { + public void setLastUpdatedBy(Long lastUpdatedBy) { this.lastUpdatedBy = lastUpdatedBy; } - public ModelRepresentation withLastUpdatedBy(Integer lastUpdatedBy) { + public ModelRepresentation withLastUpdatedBy(Long lastUpdatedBy) { this.lastUpdatedBy = lastUpdatedBy; return this; } @@ -276,46 +276,46 @@ public class ModelRepresentation { } @JsonProperty("referenceId") - public Integer getReferenceId() { + public Long getReferenceId() { return referenceId; } @JsonProperty("referenceId") - public void setReferenceId(Integer referenceId) { + public void setReferenceId(Long referenceId) { this.referenceId = referenceId; } - public ModelRepresentation withReferenceId(Integer referenceId) { + public ModelRepresentation withReferenceId(Long referenceId) { this.referenceId = referenceId; return this; } @JsonProperty("stencilSet") - public Integer getStencilSet() { + public Long getStencilSet() { return stencilSet; } @JsonProperty("stencilSet") - public void setStencilSet(Integer stencilSet) { + public void setStencilSet(Long stencilSet) { this.stencilSet = stencilSet; } - public ModelRepresentation withStencilSet(Integer stencilSet) { + public ModelRepresentation withStencilSet(Long stencilSet) { this.stencilSet = stencilSet; return this; } @JsonProperty("tenantId") - public Integer getTenantId() { + public Long getTenantId() { return tenantId; } @JsonProperty("tenantId") - public void setTenantId(Integer tenantId) { + public void setTenantId(Long tenantId) { this.tenantId = tenantId; } - public ModelRepresentation withTenantId(Integer tenantId) { + public ModelRepresentation withTenantId(Long tenantId) { this.tenantId = tenantId; return this; }