You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.1 KiB

package com.example.camel;
import java.util.Collection;
import jakarta.validation.Valid;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
/**
* Service interface for managing users.
*/
public interface UserService {
/**
* Find a user by the given ID
*
* @param id
* the ID of the user
* @return the user, or <code>null</code> if user not found.
*/
@GET
@Path("/user/{id}")
@Produces(MediaType.APPLICATION_JSON)
User findUser(@PathParam("id") Integer id);
/**
* Find all users
*
* @return a collection of all users
*/
@GET
@Path("/user")
@Produces(MediaType.APPLICATION_JSON)
Collection<User> findUsers();
/**
* Update the given user
*
* @param user
* the user
*/
@POST
@Path("/user")
@Consumes(MediaType.APPLICATION_JSON)
User updateUser(@Valid User user);
}