@RequestMapping(value = "/consumer/dept/add") public Object add(Dept dept) { return this.service.add(dept); } }
@RequestMapping(value = "/dept/list", method = RequestMethod.GET) public List<Dept> list() { return service.list(); }
@RequestMapping(value = "" + "") public List<Dept> list() { return this.service.list(); }
@RequestMapping(value = "/dept/get/{id}", method = RequestMethod.GET) public Dept get(@PathVariable("id") Long id) { return service.get(id); }
@RequestMapping(value = "/dept/add", method = RequestMethod.POST) public boolean add(@RequestBody Dept dept) { return service.add(dept); }
@RequestMapping(value = "/consumer/dept/get/{id}") public Dept get(@PathVariable("id") Long id) { return this.service.get(id); }
@RequestMapping(value = "/dept/get/{id}", method = RequestMethod.GET) public Dept get(@PathVariable("id") Long id) { return service.get(id); }
@RequestMapping(value = "/dept/list", method = RequestMethod.GET) public List<Dept> list() { return service.list(); }
@RequestMapping(value = "/dept/add", method = RequestMethod.POST) public boolean add(@RequestBody Dept dept) { return service.add(dept); }
@RequestMapping(value = "/dept/get/{id}", method = RequestMethod.GET) public Dept get(@PathVariable("id") Long id) { return service.get(id); }
@RequestMapping(value = "/dept/list", method = RequestMethod.GET) public List<Dept> list() { return service.list(); }
@RequestMapping(value = "/dept/add", method = RequestMethod.POST) public boolean add(@RequestBody Dept dept) { return service.add(dept); }
@RequestMapping(value = "/dept/get/{id}", method = RequestMethod.GET) public Dept get(@PathVariable("id") Long id) { System.out.println("i am 8001 "); return service.get(id); }
@RequestMapping(value = "/dept/list", method = RequestMethod.GET) public List<Dept> list() { return service.list(); }
@RequestMapping(value = "/dept/add", method = RequestMethod.POST) public boolean add(@RequestBody Dept dept) { return service.add(dept); }
@RequestMapping(value = "/dept/get/{id}", method = RequestMethod.GET) //一旦调用服务方法失败并抛出了错误信息后,会自动调用@HystrixCommand标注好的fallbackMethod调用类中的指定方法 @HystrixCommand(fallbackMethod = "processHystrix_Get") public Dept get(@PathVariable("id") Long id) { Dept dept = this.service.get(id); if (null == dept) { throw new RuntimeException("该ID:" + id + "没有没有对应的信息"); } return dept; }