package com.lhstack.controller; import java.util.Map; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import io.reactivex.Single; @RestController @RequestMapping("crypto") public class CryptoController { @PostMapping("decrypt") public Single decrypt(@RequestBody Map body){ return Single.defer(() -> { System.out.println(body); return Single.just("hello world"); }); } @GetMapping public Single test(){ return Single.defer(() -> { return Single.just("hello world"); }); } }