- 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>
10 lines
205 B
Java
10 lines
205 B
Java
package com.krylov.refound.dto;
|
||
|
||
import lombok.Data;
|
||
|
||
/** Первое сообщение, с которым создаётся чат. */
|
||
@Data
|
||
public class StartChatRequest {
|
||
private String content;
|
||
}
|