-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathStudentService.java
58 lines (49 loc) · 1.69 KB
/
StudentService.java
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
/*******************************************************************************
* Copyright (c) 2018 Composent, Inc. and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Composent, Inc. - initial API and implementation
******************************************************************************/
package com.mycorp.examples.student;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/studentservice")
public interface StudentService {
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/students")
List<Student> getStudents();
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/studentscf")
CompletableFuture<List<Student>> getStudentsCF();
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/students/{studentId}")
Student getStudent(@PathParam("studentId") String id);
@POST
@Produces(MediaType.APPLICATION_JSON)
@Path("/students/{studentName}")
Student createStudent(@PathParam("studentName") String studentName);
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/students")
Student updateStudent(Student student);
@DELETE
@Path("/students/{studentId}")
@Produces(MediaType.APPLICATION_JSON)
Student deleteStudent(@PathParam("studentId") String studentId);
}