簡體   English   中英

刪除映射如何與 Spring WebFlux 和 Cassandra 數據庫一起使用?

[英]How does delete mapping work with Spring WebFlux and Cassandra database?

我正在嘗試獲取 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);
    }

原來這只是我的 curl 命令。 它應該是 curl -X "DELETE" localhost:8080/orders/delete/1 感謝任何正在調查它的人。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM