1、restful的get,post,delete,put只是一种用法规范,对语法没影响
2、url地址中有指定传参时,对应参数加注解:@PathVariable(id)。如:
@GetMapping("/get/{trxSeq}")
public BaseResult getApproveHistory(@ApiParam("交易流水号") @PathVariable("trxSeq") String trxSeq) throws Exception {
}
3、url格式中没有指定传参时,若传基本类型,对应参数加注解:@RequestParam()。若传自定义类型,对应参数加注解:@RequestBody。
@GetMapping("/path")
public BaseResult getChannel(@RequestParam("code") String code,@RequestBody MyClass myclass)throws Exception {
}