mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-04 17:08:47 +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 org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
/*
|
||||||
|
curl http://localhost:8080/api/admin/hello \
|
||||||
|
-H "Authorization: Bearer <token>"
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple admin demo endpoint.
|
* Simple admin demo endpoint.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,6 +12,19 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
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
|
@RestController
|
||||||
@RequestMapping("/api/posts")
|
@RequestMapping("/api/posts")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|||||||
Reference in New Issue
Block a user