feat: Adjust json responses
This commit is contained in:
parent
85d2b218aa
commit
1b9bc90920
4 changed files with 71 additions and 7 deletions
|
@ -1,15 +1,33 @@
|
|||
package de.szut.casino.blackjack;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CardEntity {
|
||||
private final Suit suit;
|
||||
private final Rank rank;
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@JsonIgnore
|
||||
private Long id;
|
||||
|
||||
public CardEntity(Suit suit, Rank rank) {
|
||||
this.suit = suit;
|
||||
this.rank = rank;
|
||||
}
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "game_id", nullable = false)
|
||||
@JsonBackReference
|
||||
private BlackJackGameEntity game;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Suit suit;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Rank rank;
|
||||
}
|
||||
|
|
Reference in a new issue