inital commit

This commit is contained in:
j-weissen 2023-11-13 02:13:47 +01:00
commit b35b1b2efe
14 changed files with 935 additions and 0 deletions

View 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);
}
}

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

View 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<>();
}

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

View file

View 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() {
}
}