mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-09 07:16:09 +00:00
fix: 后端代码格式化
This commit is contained in:
@@ -3,50 +3,50 @@ package com.openisle.model;
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
||||
import jakarta.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Table(name = "message_conversations")
|
||||
public class MessageConversation {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
// Indicates whether this conversation represents a public channel
|
||||
@Column(nullable = false)
|
||||
private boolean channel = false;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
// Channel metadata
|
||||
private String name;
|
||||
// Indicates whether this conversation represents a public channel
|
||||
@Column(nullable = false)
|
||||
private boolean channel = false;
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String description;
|
||||
// Channel metadata
|
||||
private String name;
|
||||
|
||||
private String avatar;
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String description;
|
||||
|
||||
@CreationTimestamp
|
||||
@Column(nullable = false, updatable = false)
|
||||
private LocalDateTime createdAt;
|
||||
private String avatar;
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "last_message_id")
|
||||
private Message lastMessage;
|
||||
@CreationTimestamp
|
||||
@Column(nullable = false, updatable = false)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@OneToMany(mappedBy = "conversation", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JsonBackReference
|
||||
private Set<MessageParticipant> participants = new HashSet<>();
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "last_message_id")
|
||||
private Message lastMessage;
|
||||
|
||||
@OneToMany(mappedBy = "conversation", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JsonBackReference
|
||||
private Set<Message> messages = new HashSet<>();
|
||||
}
|
||||
@OneToMany(mappedBy = "conversation", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JsonBackReference
|
||||
private Set<MessageParticipant> participants = new HashSet<>();
|
||||
|
||||
@OneToMany(mappedBy = "conversation", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JsonBackReference
|
||||
private Set<Message> messages = new HashSet<>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user