inital commit
This commit is contained in:
commit
b35b1b2efe
14 changed files with 935 additions and 0 deletions
13
src/main/java/me/jweissen/aeticket/AeticketApplication.java
Normal file
13
src/main/java/me/jweissen/aeticket/AeticketApplication.java
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package me.jweissen.aeticket;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class AeticketApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AeticketApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
29
src/main/java/me/jweissen/aeticket/model/Category.java
Normal file
29
src/main/java/me/jweissen/aeticket/model/Category.java
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package me.jweissen.aeticket.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@Table
|
||||
@Getter
|
||||
@Setter
|
||||
public class Category {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Double price;
|
||||
|
||||
@Column(nullable = false)
|
||||
private int stock;
|
||||
|
||||
@ManyToOne(optional = false)
|
||||
@JoinColumn(nullable = false)
|
||||
private Event event;
|
||||
|
||||
}
|
||||
36
src/main/java/me/jweissen/aeticket/model/Event.java
Normal file
36
src/main/java/me/jweissen/aeticket/model/Event.java
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package me.jweissen.aeticket.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table
|
||||
@Getter
|
||||
@Setter
|
||||
public class Event {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private int id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String title;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String description;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Date start;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Date end;
|
||||
|
||||
@OneToMany(mappedBy = "event")
|
||||
@Column(nullable = false)
|
||||
private List<Category> categories = new ArrayList<>();
|
||||
|
||||
}
|
||||
24
src/main/java/me/jweissen/aeticket/model/User.java
Normal file
24
src/main/java/me/jweissen/aeticket/model/User.java
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package me.jweissen.aeticket.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@Table
|
||||
@Getter
|
||||
@Setter
|
||||
public class User {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private int id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String firstname;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String lastname;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String password;
|
||||
}
|
||||
0
src/main/resources/application.yml
Normal file
0
src/main/resources/application.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package me.jweissen.aeticket;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class AeticketApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in a new issue