create chats only together with the first message
- GET /api/v1/chats/with/{otherUserId}?postId= finds an existing chat
(404 if there is none) and never creates one
- POST /api/v1/chats/with/{otherUserId}/messages?postId= with {content}
finds or creates the chat and saves the first message in one
transaction; same participant/post checks as before, WebSocket events
still sent after commit
- the old POST /with/{otherUserId} that created empty chats is removed
- chat list hides chats without messages (existing empty rows stay in DB)
- empty messages are rejected with 400
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.krylov.refound.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Первое сообщение, с которым создаётся чат. */
|
||||
@Data
|
||||
public class StartChatRequest {
|
||||
private String content;
|
||||
}
|
||||
Reference in New Issue
Block a user