package springboot
.controller
;
import com
.alibaba
.fastjson
.JSONArray
;
import com
.alibaba
.fastjson
.JSONObject
;
import org
.springframework
.beans
.factory
.annotation
.Autowired
;
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
.RestController
;
import springboot
.service
.IService
;
@RestController
public class HelloController {
@Autowired
private IService iService
;
@PostMapping("hello")
public String
hello(@RequestBody JSONArray jsonArray
){
System
.out
.println(jsonArray
);
return "jsonArray "+jsonArray
;
}
@PostMapping("hello1")
public String
hello1(@RequestBody JSONObject jsonObejct
){
System
.out
.println(jsonObejct
);
return "jsonObejct="+jsonObejct
;
}
@GetMapping("test")
public String
test(){
iService
.testAsync();
return "调用接口返回";
}
}
转载请注明原文地址: https://lol.8miu.com/read-34490.html