@MappedSuperclass
public abstract class Auction {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@Column(nullable = false)
private String title;
@Column
private String description;
@Column
private String category;
@Column(nullable = false)
private long sellerId;
@Column
private String urlPicture;
}
@Getter
@Setter
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "inverseauction")
public class InverseAuction extends Auction{
@Column(nullable = false)
private int startingPrice;
@Column(nullable = false)
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy'T'HH:mm:ss[.SSS][.SS][.S]")
private LocalDateTime expiryDate;
}
My @GetMapping
Return的唯一属性是startingPrice
和expiryDate
,出于某种原因,拍卖属性对拍卖是不可见的.
我唯一的猜测是添加一些SpringBoot注释,但我不知道是哪一个,我try 了一些,但不起作用