-
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 FoodCoopV3/main
Foodcoop Backend
- Loading branch information
Showing
159 changed files
with
7,713 additions
and
2,198 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
FROM adoptopenjdk/openjdk11:alpine-jre | ||
ARG JAR_FILE=/*.jar | ||
COPY ${JAR_FILE} app.jar | ||
ENTRYPOINT ["java","-jar","/app.jar"] | ||
FROM maven:3.6.3-jdk-11-slim AS build | ||
WORKDIR /home/app | ||
|
||
# Kopiere das gesamte Projektverzeichnis | ||
COPY . . | ||
|
||
# Baue das Projekt mit Maven Wrapper | ||
RUN mvn clean install -DskipTests | ||
|
||
# Verwende das offizielle OpenJDK Image, um die Jar auszuführen | ||
FROM openjdk:11-jre-slim | ||
COPY --from=build /home/app/plugins/target/*.jar /usr/local/lib/app.jar | ||
ENTRYPOINT ["java","-jar","/usr/local/lib/app.jar"] |
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
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,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<parent> | ||
<artifactId>warehouse</artifactId> | ||
<groupId>de.dhbw.foodcoop</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>abstraction</artifactId> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
<configuration> | ||
<debug>true</debug> | ||
<release>11</release> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>javax.persistence</groupId> | ||
<artifactId>javax.persistence-api</artifactId> | ||
<version>2.2</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
<version>5.3.4</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
<version>3.11</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>warehouse</artifactId> | ||
<groupId>de.dhbw.foodcoop</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>abstraction</artifactId> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
<configuration> | ||
<debug>true</debug> | ||
<release>11</release> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>javax.persistence</groupId> | ||
<artifactId>javax.persistence-api</artifactId> | ||
<version>2.2</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
<version>5.3.4</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
<version>3.11</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
|
||
</project> |
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
35 changes: 35 additions & 0 deletions
35
...in/java/de/dhbw/foodcoop/warehouse/adapters/representations/BestandBuyRepresentation.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,35 @@ | ||
package de.dhbw.foodcoop.warehouse.adapters.representations; | ||
|
||
public class BestandBuyRepresentation { | ||
|
||
private String id; | ||
private ProduktRepresentation bestand; | ||
private double amount; | ||
public BestandBuyRepresentation(String id, ProduktRepresentation bestand, double amount) { | ||
super(); | ||
this.id = id; | ||
this.bestand = bestand; | ||
this.amount = amount; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
public ProduktRepresentation getBestand() { | ||
return bestand; | ||
} | ||
public void setBestand(ProduktRepresentation bestand) { | ||
this.bestand = bestand; | ||
} | ||
public double getAmount() { | ||
return amount; | ||
} | ||
public void setAmount(double amount) { | ||
this.amount = amount; | ||
} | ||
|
||
|
||
} |
58 changes: 58 additions & 0 deletions
58
.../main/java/de/dhbw/foodcoop/warehouse/adapters/representations/BestandRepresentation.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,58 @@ | ||
package de.dhbw.foodcoop.warehouse.adapters.representations; | ||
|
||
import javax.persistence.Inheritance; | ||
import javax.persistence.InheritanceType; | ||
|
||
import com.fasterxml.jackson.annotation.JsonSubTypes; | ||
import com.fasterxml.jackson.annotation.JsonTypeInfo; | ||
|
||
import de.dhbw.foodcoop.warehouse.domain.entities.BrotBestand; | ||
import de.dhbw.foodcoop.warehouse.domain.entities.FrischBestand; | ||
import de.dhbw.foodcoop.warehouse.domain.entities.Produkt; | ||
|
||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") | ||
@JsonSubTypes({ | ||
@JsonSubTypes.Type(value = FrischBestandRepresentation.class, name = "frisch"), | ||
@JsonSubTypes.Type(value = BrotBestandRepresentation.class, name ="brot"), | ||
@JsonSubTypes.Type(value = ProduktRepresentation.class, name="lager") | ||
// Andere Subtypen hier | ||
}) | ||
@Inheritance(strategy = InheritanceType.JOINED) | ||
public abstract class BestandRepresentation { | ||
protected String id; | ||
protected String name; | ||
private boolean verfuegbarkeit; | ||
private float preis; | ||
|
||
public BestandRepresentation(String id, String name, boolean verfuegbarkeit, float preis) { | ||
this.id = id; | ||
this.name = name; | ||
this.verfuegbarkeit = verfuegbarkeit; | ||
this.preis = preis; | ||
} | ||
|
||
public BestandRepresentation() { | ||
// TODO Auto-generated constructor stub | ||
} | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public boolean getVerfuegbarkeit() { | ||
return verfuegbarkeit; | ||
} | ||
|
||
|
||
|
||
public float getPreis() { | ||
return preis; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...java/de/dhbw/foodcoop/warehouse/adapters/representations/BestellungBuyRepresentation.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,38 @@ | ||
package de.dhbw.foodcoop.warehouse.adapters.representations; | ||
|
||
public class BestellungBuyRepresentation { | ||
private String id; | ||
private BestellungRepresentation bestellung; | ||
private double amount; | ||
public BestellungBuyRepresentation(String id, BestellungRepresentation bestellung, double amount) { | ||
super(); | ||
this.id = id; | ||
this.bestellung = bestellung; | ||
this.amount = amount; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
|
||
|
||
public BestellungRepresentation getBestellung() { | ||
return bestellung; | ||
} | ||
|
||
public void setBestellung(BestellungRepresentation bestellung) { | ||
this.bestellung = bestellung; | ||
} | ||
|
||
public double getAmount() { | ||
return amount; | ||
} | ||
public void setAmount(double amount) { | ||
this.amount = amount; | ||
} | ||
|
||
} |
Oops, something went wrong.