FIX XML
ADD MAPPING
This commit is contained in:
@@ -14,11 +14,11 @@ import org.mapstruct.factory.Mappers;
|
||||
import java.util.List;
|
||||
|
||||
@Path("session")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes({"application/json", "application/xml"})
|
||||
@Produces({"application/json", "application/xml"})
|
||||
public class SessionResource {
|
||||
private final SessionDAO sessionDAO = new SessionDAO();
|
||||
private final SessionMapper mapper = Mappers.getMapper(SessionMapper.class);
|
||||
private final SessionMapper mapper = SessionMapper.INSTANCE;
|
||||
|
||||
@GET
|
||||
public List<Session> listSession() {
|
||||
@@ -34,7 +34,7 @@ public class SessionResource {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
SessionDTO result = mapper.toDTO(session);
|
||||
return Response.status(Response.Status.OK).build();
|
||||
return Response.status(Response.Status.OK).entity(result).build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user