传参方式
package com.zzb.test;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/passparam")
public class PassParam {
@GetMapping("/get/{id}/{count}")
public Map get1(@PathVariable("id") Integer id, @PathVariable("count") Integer count){
Map map = new HashMap();
map.put("id",id);
map.put("count",count);
return map;
}
@GetMapping("/get")
public Map get2(@RequestParam("id") Integer id, @RequestParam("count") Integer count){
Map map = new HashMap();
map.put("id",id);
map.put("count",count);
return map;
}
}