Add endpoint for testing
This commit is contained in:
parent
1c02296a0f
commit
7546794253
@ -14,20 +14,26 @@ import com.fasterxml.jackson.annotation.JsonView;
|
|||||||
@RestController
|
@RestController
|
||||||
public class ItemController {
|
public class ItemController {
|
||||||
|
|
||||||
@JsonView(Views.Public.class)
|
@JsonView(Views.Public.class)
|
||||||
@RequestMapping("/items/{id}")
|
@RequestMapping("/items/{id}")
|
||||||
public Item getItemPublic(@PathVariable final int id) {
|
public Item getItemPublic(@PathVariable final int id) {
|
||||||
return ItemManager.getById(id);
|
return ItemManager.getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonView(Views.Internal.class)
|
@JsonView(Views.Internal.class)
|
||||||
@RequestMapping("/items/internal/{id}")
|
@RequestMapping("/items/internal/{id}")
|
||||||
public Item getItemInternal(@PathVariable final int id) {
|
public Item getItemInternal(@PathVariable final int id) {
|
||||||
return ItemManager.getById(id);
|
return ItemManager.getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/date")
|
@RequestMapping("/date")
|
||||||
public Date getCurrentDate() {
|
public Date getCurrentDate() throws Exception {
|
||||||
return new Date();
|
return new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/delay/{seconds}")
|
||||||
|
public void getCurrentTime(@PathVariable final int seconds) throws Exception {
|
||||||
|
|
||||||
|
Thread.sleep(seconds * 1000);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user