feat: полная реализация

This commit is contained in:
2026-11-10 15:27:10 +03:00
parent 7734b222f8
commit 5cf99b5384
18 changed files with 935 additions and 211 deletions
+31 -13
View File
@@ -1,23 +1,41 @@
POST /api/auth/login HTTP/1.1
Host: localhost:8080
### Health
GET http://localhost:8080/health
### Login
POST http://localhost:8080/api/auth/login
Content-Type: application/json
{
"login": "user",
"password": "password"
"login": "test",
"password": "test123"
}
POST /api/messages HTTP/1.1
Host: localhost:8080
### Get messages
GET http://localhost:8080/api/messages
Authorization: Bearer TOKEN_HERE
### Send message
POST http://localhost:8080/api/messages
Authorization: Bearer TOKEN_HERE
Idempotency-Key: unique-key-123
Content-Type: application/json
Authorization: Bearer <token>
Idempotency-Key: <idempotency-key>
{
"recipient": "user",
"body": "Hello, World!"
"recipient": "test",
"body": "Hello Bob"
}
GET /api/messages HTTP/1.1
Host: localhost:8080
Authorization: Bearer <token>
### Send the same message again (idempotent replay, same body and same key)
POST http://localhost:8080/api/messages
Authorization: Bearer TOKEN_HERE
Idempotency-Key: unique-key-123
Content-Type: application/json
{
"recipient": "test",
"body": "Hello Bob"
}
### Logout
POST http://localhost:8080/api/auth/logout
Authorization: Bearer TOKEN_HERE