-
-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathRoutes.java
More file actions
58 lines (47 loc) · 1.18 KB
/
Routes.java
File metadata and controls
58 lines (47 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Jooby https://jooby.io
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
* Copyright 2014 Edgar Espina
*/
package source;
import java.util.Arrays;
import java.util.List;
import io.jooby.Context;
import io.jooby.annotation.GET;
import io.jooby.annotation.POST;
import io.jooby.annotation.Path;
@Path("/path")
public class Routes {
@GET
public String doIt(Context ctx) {
return ctx.getRequestPath();
}
@GET("/subpath")
public List<String> subpath(Context ctx) {
return Arrays.asList(ctx.getRequestPath());
}
@GET("/object")
public Object object(Context ctx) {
return ctx;
}
@POST("/post")
public JavaBeanParam post(Context ctx) {
return new JavaBeanParam();
}
@GET(path = "/pathAttributeWork")
public String pathAttributeWork(Context ctx) {
return ctx.getRequestPath();
}
@GET(path = "/path", value = "/value")
public String pathvalue(Context ctx) {
return ctx.getRequestPath();
}
@GET(value = {"/path1", "/path2"})
public String pathvalueArray(Context ctx) {
return ctx.getRequestPath();
}
@POST(path = {"/path1", "/path2"})
public String pathArray(Context ctx) {
return ctx.getRequestPath();
}
}