-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetworkServices.java
More file actions
50 lines (43 loc) · 1.36 KB
/
NetworkServices.java
File metadata and controls
50 lines (43 loc) · 1.36 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
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.PATCH;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
/**
* Created by Aseith on 06/05/2017.
*/
public class NetworkServices {
public interface NetworkRequest {
@POST("{path}/user")
Call<ContainerModel> createUser(
@Path("path") String myPath,
@Body ContainerModel user
);
@PATCH("{path}/user/{id}")
Call<ContainerModel> updateUser(
@Path("path") String myPath,
@Path("id") int id,
@Body ContainerModel user
);
@PUT("{path}/user/{id}")
Call<ContainerModel> updateUser(
@Path("path") String myPath,
@Path("id") int userId,
@Body ContainerModel user
);
@GET("{path}/user/{id}")
Call<ContainerModel> getUser(
@Path("path") String myPath,
@Path("id") String id
);
@GET("{path}/user/search")
Call<ContainerModel> searchUser(
@Path("path") String myPath,
@Query("firstName") String firstName,
@Query("lastName") String lastName,
@Query("age") int age
);
}
}