我正在尝试处理 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);
}