我使用的是最新版本的Spring.我必须与公司A的第三方服务器集成.现在,公司A给了我这样的代码:
Path("/user")
public class CallBacks {
String hostDB="jdbc:mysql://localhost:3306/matchmove";
String username="root";
String password="password";
@POST
@Path("/add")
// @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response receive(
@FormParam("id") String id,
@FormParam("amount") String amount,
@FormParam("asset_code") String assetCode,
@FormParam("asset_issuer") String assetIssuer,
@FormParam("memo") String memo) throws NumberFormatException, SQLException {
return Response.ok().build();
}
Run Code Online (Sandbox Code Playgroud)
我想使用Spring,因为我的项目的其余部分是在Spring!有人可以就以下建议提出建议:
@FormParam?Response.ok().build()?谢谢
@FormParam - > @RequestParamResponse.ok - > ResponseEntity.ok@PostMapping(value = "/add")
public ResponseEntity receive(@RequestParam("id") String id) {
return ResponseEntity.ok().build();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2396 次 |
| 最近记录: |