added chats with another users

This commit is contained in:
SlimusMinus
2026-06-22 01:08:47 +03:00
parent 194b7efb8a
commit 236d00f2f9
19 changed files with 433 additions and 177 deletions

View File

@@ -0,0 +1,16 @@
package com.krylov.refound.dto;
import java.time.LocalDateTime;
import lombok.Data;
@Data
public class ChatDto {
private Long id;
private Long otherUserId;
private String otherUserName;
private String otherUserAvatar;
private Long postId;
private String lastMessage;
private LocalDateTime lastMessageAt;
private long unreadCount;
}

View File

@@ -0,0 +1,8 @@
package com.krylov.refound.dto;
import lombok.Data;
@Data
public class CreateChatRequest {
private Long postId; // опционально, с каким объявлением связан чат
}

View File

@@ -0,0 +1,14 @@
package com.krylov.refound.dto;
import java.time.LocalDateTime;
import lombok.Data;
@Data
public class MessageDto {
private Long id;
private Long chatId;
private Long senderId;
private String content;
private boolean isRead;
private LocalDateTime createdAt;
}

View File

@@ -0,0 +1,9 @@
package com.krylov.refound.dto;
import lombok.Data;
@Data
public class SendMessageRequest {
private Long chatId;
private String content;
}