estoy creando un servicio y tengo un problema para listar los datos segun al id, lo probe en el postman y dice NO FOUND sin embargo el servicio esta levantado este seria mi codigo.
Table("expediente")
@Getter
@Setter
public class Expediente {
@Id
@Column("id_expediente")
private Integer id;
private String numero;
private String descripcion;
private String estado;
@Column("fecha_creacion")
private LocalDateTime fechaCreacion;
private String observacionmp;
private String titulo;
private boolean copiado;
private Integer plazo;
private boolean diasUtiles;
@Column("fecha_atencion")
private LocalDate fechaAtencion;
private Integer id_migracion;
private String alertaActual;
}
public class ExpedienteController {
@Autowired
private ExpedienteService expedienteService;
@GetMapping("/{id}")
public Mono<RespuestaExpediente> obtener(@PathVariable Integer id,Mono<Principal> principal){
return SecurityUtil.jwt(principal).flatMap(jwt -> expedienteService.obtenerExpediente(id,jwt.getClaimAsString(JwtClaimNames.SUB)));
}
}
public class ExpedienteController {
@Autowired
private ExpedienteService expedienteService;
@GetMapping("/{id}")
public Mono<RespuestaExpediente> obtener(@PathVariable Integer id,Mono<Principal> principal){
return SecurityUtil.jwt(principal).flatMap(jwt -> expedienteService.obtenerExpediente(id,jwt.getClaimAsString(JwtClaimNames.SUB)));
}
}
public class RespuestaExpediente {
private Integer id;
private String numero;
private String descripcion;
private String estado;
private LocalDateTime fechaCreacion;
private String observacionmp;
private String titulo;
private Integer plazo;
private boolean copiado;
private boolean diasUtiles;
}
public interface ExpedienteService {
Mono<RespuestaExpediente> obtenerExpediente(Integer id, String usuario);
}
@Service("ExpedienteService")
public class ExpedienteServiceImpl implements ExpedienteService{
@Autowired
private ExpedienteDAO expedienteDAO;
@Override
public Mono<RespuestaExpediente> obtenerExpediente(Integer id, String usuario) {
return (expedienteDAO.findById(id))
.map(e->{
RespuestaExpediente r = new RespuestaExpediente();
r.setNumero(e.getNumero());
r.setEstado(e.getEstado());
r.setFechaCreacion(e.getFechaCreacion());
return r;
});
}
}
Este es el error en el postman
"timestamp": "2022-05-06T04:19:07.989+00:00", "path": "/2", "status": 404, "error": "Not Found", "message": null, "requestId": "4c05da8b-8", "trace": "org.springframework.web.server.ResponseStatusException: 404 NOT_FOUND\r\n\tat org.springframework.web.reactive.resource.ResourceWebHandler.lambda$handle$1(ResourceWebHandler.java:408)\r\n\tSuppressed: The stacktrace has been enhanced by Reactor, refer to additional information below: \r\nError has been observed at the following site(s):\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.authorization.AuthorizationWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.authorization.ExceptionTranslationWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.authentication.logout.LogoutWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.savedrequest.ServerRequestCacheWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.context.SecurityContextServerWebExchangeWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.authentication.AuthenticationWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.context.ReactorContextWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.csrf.CsrfWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.header.HttpHeaderWriterWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.config.web.server.ServerHttpSecurity$ServerWebExchangeReactorContextWebFilter [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy [DefaultWebFilterChain]\r\n\t*__checkpoint ⇢ HTTP GET "/2""
/2
, agrega mas detalles para poderlo reproducir