-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from bzwei/crossmap
Add endpoints for Crossmap and CrossmapDetail
- Loading branch information
Showing
10 changed files
with
624 additions
and
2 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
...rkus-APIs/src/main/java/io/connectedhealth/idaas/defianz/apis/CrossmapDetailResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package io.connectedhealth.idaas.defianz.apis; | ||
|
||
import java.util.List; | ||
|
||
import javax.inject.Inject; | ||
import javax.ws.rs.Consumes; | ||
import javax.ws.rs.DELETE; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.PATCH; | ||
import javax.ws.rs.POST; | ||
import javax.ws.rs.PUT; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.PathParam; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.eclipse.microprofile.openapi.annotations.parameters.Parameter; | ||
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; | ||
|
||
import io.connectedhealth.idaas.defianz.audit.Audited; | ||
import io.connectedhealth.idaas.defianz.dtos.CrossmapDetail; | ||
import io.connectedhealth.idaas.defianz.exception.DefianzException; | ||
import io.connectedhealth.idaas.defianz.services.CrossmapService; | ||
|
||
@Path("/crossmap_details") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
public class CrossmapDetailResource { | ||
@Inject | ||
CrossmapService service; | ||
|
||
@Audited | ||
@GET | ||
@Path("/{crossmapDetailId}") | ||
public CrossmapDetail getCrossmapDetail(@Parameter(name="crossmapDetailId", required=true) @PathParam("crossmapDetailId") long crossmapDetailId) throws DefianzException { | ||
return service.getCrossmapDetail(crossmapDetailId); | ||
} | ||
|
||
@Audited | ||
@PATCH | ||
@Path("/{crossmapDetailId}") | ||
public CrossmapDetail updateCrossmapDetail(@Parameter(name="crossmapDetailId", required=true) @PathParam("crossmapDetailId") long crossmapDetailId, CrossmapDetail detail) throws DefianzException { | ||
return service.updateCrossmapDetail(crossmapDetailId, detail); | ||
} | ||
|
||
@Audited | ||
@DELETE | ||
@Path("/{crossmapDetailId}") | ||
@APIResponse(responseCode = "204") | ||
public void createCrossmapDetail(@Parameter(name="crossmapDetailId", required=true) @PathParam("crossmapDetailId") long crossmapDetailId) throws DefianzException { | ||
service.deleteCrossmapDetail(crossmapDetailId); | ||
} | ||
|
||
@Audited | ||
@POST | ||
@APIResponse(responseCode = "201") | ||
public CrossmapDetail createCrossmapDetail(CrossmapDetail crossmapDetail) throws DefianzException { | ||
return service.createCrossmapDetail(crossmapDetail); | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
...Is/Quarkus-APIs/src/main/java/io/connectedhealth/idaas/defianz/apis/CrossmapResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package io.connectedhealth.idaas.defianz.apis; | ||
|
||
import java.util.List; | ||
|
||
import javax.inject.Inject; | ||
import javax.ws.rs.Consumes; | ||
import javax.ws.rs.DELETE; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.PATCH; | ||
import javax.ws.rs.POST; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.PathParam; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.eclipse.microprofile.openapi.annotations.parameters.Parameter; | ||
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; | ||
|
||
import io.connectedhealth.idaas.defianz.audit.Audited; | ||
import io.connectedhealth.idaas.defianz.dtos.Crossmap; | ||
import io.connectedhealth.idaas.defianz.dtos.CrossmapDetail; | ||
import io.connectedhealth.idaas.defianz.exception.DefianzException; | ||
import io.connectedhealth.idaas.defianz.services.CrossmapService; | ||
|
||
@Path("/crossmaps") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
public class CrossmapResource { | ||
@Inject | ||
CrossmapService service; | ||
|
||
@Audited | ||
@GET | ||
public List<Crossmap> listCropssmaps() throws DefianzException { | ||
return service.listCrossmaps(); | ||
} | ||
|
||
@Audited | ||
@GET | ||
@Path("/{crossmapId}") | ||
public Crossmap getCropssmap(@Parameter(name="crossmapId", required=true) @PathParam("crossmapId") long crossmapId) throws DefianzException { | ||
return service.getCrossmap(crossmapId); | ||
} | ||
|
||
@Audited | ||
@DELETE | ||
@Path("/{crossmapId}") | ||
@APIResponse(responseCode = "204") | ||
public void deleteCropssmap(@Parameter(name="crossmapId", required=true) @PathParam("crossmapId") long crossmapId) throws DefianzException { | ||
service.deleteCrossmap(crossmapId); | ||
} | ||
|
||
@Audited | ||
@PATCH | ||
@Path("/{crossmapId}") | ||
public Crossmap updateCropssmap(@Parameter(name="crossmapId", required=true) @PathParam("crossmapId") long crossmapId, Crossmap crossmap) throws DefianzException { | ||
return service.updateCrossmap(crossmapId, crossmap); | ||
} | ||
|
||
@Audited | ||
@POST | ||
@APIResponse(responseCode = "201") | ||
public Crossmap createCrossmap(Crossmap crossmap) throws DefianzException { | ||
return service.createCrossmap(crossmap); | ||
} | ||
|
||
@Audited | ||
@GET | ||
@Path("/{crossmapId}/crossmap_details") | ||
public List<CrossmapDetail> getCrossmapDetails(@Parameter(name="crossmapId", required=true) @PathParam("crossmapId") long crossmapId) throws DefianzException { | ||
return service.listCrossmapDetails(crossmapId); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
DataTier-APIs/Quarkus-APIs/src/main/java/io/connectedhealth/idaas/defianz/dtos/Crossmap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.connectedhealth.idaas.defianz.dtos; | ||
|
||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder; | ||
import org.eclipse.microprofile.openapi.annotations.media.Schema; | ||
|
||
public class Crossmap { | ||
@Schema(readOnly = true) | ||
public long crossmapId; | ||
|
||
public String crossmapDesc; | ||
public String industryStd; | ||
public String organization; | ||
public String application; | ||
|
||
public String toString() | ||
{ | ||
return ReflectionToStringBuilder.toString(this); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...APIs/Quarkus-APIs/src/main/java/io/connectedhealth/idaas/defianz/dtos/CrossmapDetail.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.connectedhealth.idaas.defianz.dtos; | ||
|
||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder; | ||
import org.eclipse.microprofile.openapi.annotations.media.Schema; | ||
|
||
public class CrossmapDetail { | ||
@Schema(readOnly = true) | ||
public long crossmapDetailId; | ||
|
||
public int dataAttributeId; | ||
public long crossmapId; | ||
public String crossmapField; | ||
|
||
public String toString() | ||
{ | ||
return ReflectionToStringBuilder.toString(this); | ||
} | ||
} |
113 changes: 113 additions & 0 deletions
113
...rkus-APIs/src/main/java/io/connectedhealth/idaas/defianz/models/CrossmapDetailEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
package io.connectedhealth.idaas.defianz.models; | ||
|
||
import javax.persistence.Basic; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.Table; | ||
|
||
import org.hibernate.annotations.CreationTimestamp; | ||
|
||
import java.sql.Timestamp; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Table(name = "crossmaps_dtl") | ||
public class CrossmapDetailEntity extends io.quarkus.hibernate.orm.panache.PanacheEntityBase { | ||
private long crossmapDetailId; | ||
private String crossmapField; | ||
private Timestamp createdDate; | ||
private CrossmapEntity crossmap; | ||
private DataAttributeEntity dataAttribute; | ||
private RefDataStatusEntity status; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "crossmapdtlid", nullable = false) | ||
public long getCrossmapDetailId() { | ||
return crossmapDetailId; | ||
} | ||
|
||
public void setCrossmapDetailId(long crossmapDetailId) { | ||
this.crossmapDetailId = crossmapDetailId; | ||
} | ||
|
||
|
||
@Basic | ||
@Column(name = "crossmapfield", nullable = false, length = 20) | ||
public String getCrossmapField() { | ||
return crossmapField; | ||
} | ||
|
||
public void setCrossmapField(String field) { | ||
this.crossmapField = field; | ||
} | ||
|
||
@Basic | ||
@CreationTimestamp | ||
@Column(name = "createddate", nullable = true) | ||
public Timestamp getCreatedDate() { | ||
return createdDate; | ||
} | ||
|
||
public void setCreatedDate(Timestamp createdDate) { | ||
this.createdDate = createdDate; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return java.util.Objects.hash(crossmapDetailId, crossmapField, crossmap, | ||
createdDate, dataAttribute, status); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null) | ||
return false; | ||
if (getClass() != o.getClass()) | ||
return false; | ||
CrossmapDetailEntity other = (CrossmapDetailEntity) o; | ||
return java.util.Objects.equals(crossmapDetailId, other.crossmapDetailId) && | ||
java.util.Objects.equals(crossmapField, other.crossmapField) && | ||
java.util.Objects.equals(createdDate, other.createdDate) && | ||
java.util.Objects.equals(crossmap, other.crossmap) && | ||
java.util.Objects.equals(dataAttribute, other.dataAttribute) && | ||
java.util.Objects.equals(status, other.status); | ||
} | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "statusid", referencedColumnName = "statusid") | ||
public RefDataStatusEntity getStatus() { | ||
return status; | ||
} | ||
|
||
public void setStatus(RefDataStatusEntity status) { | ||
this.status = status; | ||
} | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "crossmapid", referencedColumnName = "crossmapid") | ||
public CrossmapEntity getCrossmap() { | ||
return crossmap; | ||
} | ||
|
||
public void setCrossmap(CrossmapEntity crossmap) { | ||
this.crossmap = crossmap; | ||
} | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "dataattributeid", referencedColumnName = "platformdataattributesid") | ||
public DataAttributeEntity getDataAttribute() { | ||
return dataAttribute; | ||
} | ||
|
||
public void setDataAttribute(DataAttributeEntity dataAttribute) { | ||
this.dataAttribute = dataAttribute; | ||
} | ||
} |
Oops, something went wrong.