spring boot后端发送json数据和接收数据

  1. 前端请求数据接收
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("admin")
public class HelloCont {
   

    @ApiOperation("admin登录请求")
    @ResponseBody
    @PostMapping(value = "hello")
    // {"User":{"name":"mm","pawd":"1234"}}
    //{"name":"mm","pawd":"1234"}
    //{"name":"mm"}
    public String hello(

你可能感兴趣的:(json,后端,spring,boot)