Merge pull request 'api: Refactor and update settings' (#4) from 3002833/Backend:main into main
Reviewed-on: Maradona/Backend#4pull/1/head
commit
e4fdd6a39e
|
@ -1,28 +0,0 @@
|
|||
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 +0,0 @@
|
|||
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,14 @@
|
|||
package com.maradona.backend.controllers;
|
||||
|
||||
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;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/skills")
|
||||
public class SkillController {
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.maradona.backend;
|
||||
package com.maradona.backend.entities;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
@ -7,23 +7,23 @@ 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;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.maradona.backend;
|
||||
package com.maradona.backend.entities;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
|
@ -6,7 +6,7 @@ import lombok.Data;
|
|||
@Entity
|
||||
@Data
|
||||
public class FormOfAddress {
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
|
@ -1,11 +1,11 @@
|
|||
package com.maradona.backend;
|
||||
package com.maradona.backend.entities;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
public class PrimarySkill {
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long psid;
|
|
@ -1,4 +1,4 @@
|
|||
package com.maradona.backend;
|
||||
package com.maradona.backend.entities;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
|||
package com.maradona.backend;
|
||||
package com.maradona.backend.entities;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
|||
package com.maradona.backend;
|
||||
package com.maradona.backend.entities;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.maradona.backend.entities;
|
||||
|
||||
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 +0,0 @@
|
|||
spring.application.name=backend
|
|
@ -0,0 +1,21 @@
|
|||
spring:
|
||||
profiles:
|
||||
active: dev # Set 'dev' profile as the active profile for development
|
||||
|
||||
datasource:
|
||||
url: jdbc:h2:mem:testdb
|
||||
driver-class-name: org.h2.Driver
|
||||
username: sa
|
||||
password: password
|
||||
|
||||
h2:
|
||||
console:
|
||||
enabled: true # Enable H2 console for testing at http://localhost:8080/h2-console
|
||||
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: update # Automatically create/update schema
|
||||
show-sql: true
|
||||
properties:
|
||||
hibernate:
|
||||
dialect: org.hibernate.dialect.H2Dialect
|
|
@ -0,0 +1,14 @@
|
|||
spring:
|
||||
datasource:
|
||||
url: jdbc:postgresql://<YOUR_PROD_DB_URL>:5432/<YOUR_DB_NAME>
|
||||
driver-class-name: org.postgresql.Driver
|
||||
username: <YOUR_DB_USERNAME>
|
||||
password: <YOUR_DB_PASSWORD>
|
||||
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: update
|
||||
show-sql: false
|
||||
properties:
|
||||
hibernate:
|
||||
dialect: org.hibernate.dialect.PostgreSQLDialect
|
Loading…
Reference in New Issue