Http请求与Spring参数接收注解
/** Http请求
* http://localhost:8080/ict/delete/1
* pId 对应着 1 注解用 @PathVariable
* 前端格式: pId
*/
@DeleteMapping("/delete/{pId}")
@ResponseBody
public Integer DeletePayPlan(@PathVariable("pId") String pId){
return ictPayPlanService.deletePayPlan(pId);
}
/** Http请求
* http://localhost:8080/ict/save
* 前端封装好 IctPayRecord 注解用@RequestBody
* 前端格式
* let IctPayRecord ={
* id:id,
* name:name,
* password:password
* }
*/
@ResponseBody
@PostMapping("/save")
public Integer saveIctPayRecord(@RequestBody IctPayRecord ictPayRecord){
return ictPayRecordService.saveIctPayRecord(ictPayRecord);
}
/** Http请求
* http://localhost:8080/ict/check?proNo=proNo
* 多参数的话
* http://localhost:8080/ict/check?proNo=proNo&&id=id
* 后面的id,proNo要换成对应的值
* 前端封装好 proNo 注解用@RequestParam
* 前端格式
* let param={
* proNo:proNo
* }
*
*/
@GetMapping("/check")
@ResponseBody
public Integer getPayPlanByProNo(@RequestParam("proNo") String proNo){
return ictPayPlanService.getPayPlanByProNo(proNo);
}