mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
refactor(chat): migrate Message from Java POJO to Kotlin data class
This commit is contained in:
@@ -1,22 +1,14 @@
|
||||
package work.slhaf.partner.api.chat.pojo;
|
||||
package work.slhaf.partner.api.chat.pojo
|
||||
|
||||
import lombok.*;
|
||||
import work.slhaf.partner.api.common.entity.PersistableObject;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Message extends PersistableObject {
|
||||
import work.slhaf.partner.api.common.entity.PersistableObject
|
||||
import java.io.Serial
|
||||
|
||||
data class Message(
|
||||
val role: String,
|
||||
val content: String
|
||||
) : PersistableObject() {
|
||||
companion object {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NonNull
|
||||
private String role;
|
||||
@NonNull
|
||||
private String content;
|
||||
private const val serialVersionUID = 1L
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user