0

我正在尝试处理 Spring Web Flux。我能够得到@getmapping 来把我的json 参数还给我。在 cassandra 数据库中,我能够使用存储库中的该命令删除一行,但我无法从命令行中删除一行。你们会推荐什么?

//This code is in my controller 
//It's supposed to call method when I type in my terminal "curl localhost:8080/orders/delete/1"
   @DeleteMapping("/delete/{id}")
    public Mono<Integer> deleteOrder(@PathVariable("id") int id){

//This code is in my service called after the top portion
    public Mono<Integer> deleteOrder(int id) {return orderRepository.deleteOrder(id);} {
//And then in my repository this should be the last called method 
public Mono<Integer> deleteOrder(int uuid) {
      //  log.info("Attempting to delete");
        Flux.from(
                session.executeReactive(
                        SimpleStatement.builder("DELETE FROM LightNfresh.orders WHERE order_id = ?")
                            .addPositionalValue(uuid)
                            .build()))
                .subscribe();
        return Mono.just(uuid);
    }
4

1 回答 1

0

原来这只是我的 curl 命令。它应该是 curl -X "DELETE" localhost:8080/orders/delete/1 感谢任何正在调查它的人。

于 2021-08-20T03:50:50.513 回答