diff --git a/pom.xml b/pom.xml index 7ceea2f..842cd68 100644 --- a/pom.xml +++ b/pom.xml @@ -1,54 +1,60 @@ - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 4.0.3 - - - com.example - bankcards - 0.0.1-SNAPSHOT - bankcards - Bank cards managing system - - - - - - - - - - - - - - - 17 - - - - org.springframework.boot - spring-boot-starter - + + 4.0.0 - - org.springframework.boot - spring-boot-starter-test - test - - + + org.springframework.boot + spring-boot-starter-parent + 3.2.5 + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + com.example + bankcards + 0.0.1-SNAPSHOT + Bank Card Management System + + 17 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.postgresql + postgresql + runtime + + + org.projectlombok + lombok + true + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + diff --git a/src/main/java/com/example/bankcards/entity/Card.java b/src/main/java/com/example/bankcards/entity/Card.java index d601744..93d255b 100644 --- a/src/main/java/com/example/bankcards/entity/Card.java +++ b/src/main/java/com/example/bankcards/entity/Card.java @@ -1,7 +1,16 @@ package com.example.bankcards.entity; +import jakarta.persistence.*; +import java.math.BigDecimal; +import java.time.LocalDate; +import lombok.*; + @Entity @Table(name = "cards") +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder public class Card { @Id @@ -24,52 +33,4 @@ public class Card { @Column(nullable = false, precision = 19, scale = 2) private BigDecimal balance; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getCardNumberEncrypted() { - return cardNumberEncrypted; - } - - public void setCardNumberEncrypted(String cardNumberEncrypted) { - this.cardNumberEncrypted = cardNumberEncrypted; - } - - public User getOwner() { - return owner; - } - - public void setOwner(User owner) { - this.owner = owner; - } - - public LocalDate getExpiryDate() { - return expiryDate; - } - - public void setExpiryDate(LocalDate expiryDate) { - this.expiryDate = expiryDate; - } - - public CardStatus getStatus() { - return status; - } - - public void setStatus(CardStatus status) { - this.status = status; - } - - public BigDecimal getBalance() { - return balance; - } - - public void setBalance(BigDecimal balance) { - this.balance = balance; - } } diff --git a/src/main/java/com/example/bankcards/entity/User.java b/src/main/java/com/example/bankcards/entity/User.java index ef62161..8d4f8d2 100644 --- a/src/main/java/com/example/bankcards/entity/User.java +++ b/src/main/java/com/example/bankcards/entity/User.java @@ -1,9 +1,14 @@ package com.example.bankcards.entity; import jakarta.persistence.*; +import lombok.*; @Entity @Table(name = "users") +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder public class User { @Id @@ -22,44 +27,4 @@ public class User { @Enumerated(EnumType.STRING) @Column(nullable = false) private Role role; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public Role getRole() { - return role; - } - - public void setRole(Role role) { - this.role = role; - } }