mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-22 22:21:09 +08:00
Add curl test comments to controllers
This commit is contained in:
@@ -4,6 +4,11 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
curl http://localhost:8080/api/admin/hello \
|
||||
-H "Authorization: Bearer <token>"
|
||||
*/
|
||||
|
||||
/**
|
||||
* Simple admin demo endpoint.
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,19 @@ import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/*
|
||||
curl -X POST http://localhost:8080/api/posts \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer <token>" \
|
||||
-d '{ "title": "First", "content": "Post" }'
|
||||
|
||||
curl http://localhost:8080/api/posts \
|
||||
-H "Authorization: Bearer <token>"
|
||||
|
||||
curl http://localhost:8080/api/posts/1 \
|
||||
-H "Authorization: Bearer <token>"
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/posts")
|
||||
@RequiredArgsConstructor
|
||||
|
||||
Reference in New Issue
Block a user