generated from Java-2025Fall/final-vibevault-template
更新 src/main/java/com/vibevault/dto/SongDTO.java
This commit is contained in:
parent
e9bba84908
commit
b589d1c923
@ -1,9 +1,40 @@
|
|||||||
package com.vibevault.dto;
|
package com.vibevault.dto;
|
||||||
|
|
||||||
public record SongDTO(
|
public class SongDTO {
|
||||||
Long id,
|
// 1. 补全字段定义(之前截图里字段没写全)
|
||||||
String title,
|
private String title;
|
||||||
String artist,
|
private String artist;
|
||||||
int durationInSeconds
|
private Integer durationInSeconds;
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
public SongDTO(Long id, String title2, String artist2, int durationInSeconds2) {
|
||||||
|
//TODO Auto-generated constructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 补全getter方法(语法要完整)
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getArtist() {
|
||||||
|
return artist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDurationInSeconds() {
|
||||||
|
return durationInSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 3. 补全setter方法(如果需要接收前端参数,必须写setter)
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArtist(String artist) {
|
||||||
|
this.artist = artist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDurationInSeconds(Integer durationInSeconds) {
|
||||||
|
this.durationInSeconds = durationInSeconds;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user