api: Add missing entities
parent
a4dfcba99a
commit
3ac4042b2a
7
pom.xml
7
pom.xml
|
@ -58,6 +58,13 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.30</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package com.maradona.backend;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
import java.time.LocalTime;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class Employee {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
private Integer employeeNr;
|
||||
|
||||
@Column(length = 100)
|
||||
private String firstName;
|
||||
|
||||
@Column(length = 100)
|
||||
private String lastName;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "AID")
|
||||
private FormOfAddress formOfAddress;
|
||||
|
||||
@Column(length = 150)
|
||||
private String mail;
|
||||
|
||||
private LocalTime dStart;
|
||||
private LocalTime dEnd;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.maradona.backend;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class FormOfAddress {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false, length = 50)
|
||||
private String description;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.maradona.backend;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class Project {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false, length = 255)
|
||||
private String name;
|
||||
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
|
||||
private Integer workload;
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String description;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.maradona.backend;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class ProjectAssignment {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "PID", nullable = false)
|
||||
private Project project;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "EID", nullable = false)
|
||||
private Employee employee;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.maradona.backend;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class SkillAssignment {
|
||||
public enum SkillLevel {
|
||||
ONE, TWO, THREE, FOUR, FIVE;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "EID", nullable = false)
|
||||
private Employee employee;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "SSID", nullable = false)
|
||||
private SecondarySkill secondarySkill;
|
||||
|
||||
@Column(nullable = false)
|
||||
@Enumerated(EnumType.ORDINAL)
|
||||
private SkillLevel level;
|
||||
}
|
|
@ -1,16 +1,16 @@
|
|||
package com.maradona.backend;
|
||||
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class FormOfAddress {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/skills")
|
||||
public class SkillController {
|
||||
|
||||
@Column(nullable = false, length = 50)
|
||||
private String description;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue