0
respostas

Como consumir e expor serviço rest java spring

Olá, gostaria de uma ajuda. Como faço para expor este serviço usando o SpringBoot?

@Path("/autenticacao") @WebService @Service public class AutenticacaoWebService {

@Autowired
private AutenticacaoService service;

@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Path("/loginRequest")
public Response auteticacaoResponse(LoginRequest loginRequest) {
    try {
        service.autenticarLdap(loginRequest.getUsername(), loginRequest.getPassword()); // teste se vai passar algo
                                                                                        // aqui
        return Response.status(Response.Status.FORBIDDEN).build();
    } catch (Exception e) {
        return null;
    }
}

}