@Test public void update() throws Exception { WebUpdate webUpdate = new WebUpdate(); webUpdate.setUpdateInfo(UUID.randomUUID().toString()); webUpdate.setUpdateTime(new Date()); mapper.insert(webUpdate); List<WebUpdate> all = mapper.findAll(); WebUpdate update = all.get(all.size() - 1); assertNotEquals(0, update.getId()); assertNotNull(update.getUpdateInfo()); String info = UUID.randomUUID().toString(); mockMvc.perform(put("/admin/webUpdate/update?id=" + update.getId() + "&info=" + info).header("Authorization", adminLogin())).andDo(result -> { List<WebUpdate> list = mapper.findAll(); WebUpdate up = list.get(list.size() - 1); assertEquals(update.getId(), up.getId()); assertEquals(update.getUpdateTime(), up.getUpdateTime()); assertEquals(info, up.getUpdateInfo()); }); }
@PutMapping("/admin/webUpdate/update") public Response update(@RequestParam("id") long id, @RequestParam("info") String info) { return ResponseUtil.success(webUpdateInfoService.update(id, info)); }
WebUpdateInfoController { @PutMapping("/admin/webUpdate/update") public Response update(@RequestParam("id") long id, @RequestParam("info") String info) { return ResponseUtil.success(webUpdateInfoService.update(id, info)); } }
WebUpdateInfoController { @PutMapping("/admin/webUpdate/update") public Response update(@RequestParam("id") long id, @RequestParam("info") String info) { return ResponseUtil.success(webUpdateInfoService.update(id, info)); }  }
WebUpdateInfoController { @PutMapping("/admin/webUpdate/update") public Response update(@RequestParam("id") long id, @RequestParam("info") String info) { return ResponseUtil.success(webUpdateInfoService.update(id, info)); }  @PostMapping("/admin/webUpdate/create") Response create(@RequestParam("info") String info); @DeleteMapping("/admin/webUpdate/del/{id}") Response del(@PathVariable("id") long id); @PutMapping("/admin/webUpdate/update") Response update(@RequestParam("id") long id, @RequestParam("info") String info); @GetMapping("/webUpdate") Response findAll(); @GetMapping("/webUpdate/pages") Response page(@RequestParam("page") int page, @RequestParam("count") int count); @GetMapping("/lastestUpdateTime") Response lastestUpdateTime(); }
WebUpdateInfoController { @PutMapping("/admin/webUpdate/update") public Response update(@RequestParam("id") long id, @RequestParam("info") String info) { return ResponseUtil.success(webUpdateInfoService.update(id, info)); }  @PostMapping("/admin/webUpdate/create") Response create(@RequestParam("info") String info); @DeleteMapping("/admin/webUpdate/del/{id}") Response del(@PathVariable("id") long id); @PutMapping("/admin/webUpdate/update") Response update(@RequestParam("id") long id, @RequestParam("info") String info); @GetMapping("/webUpdate") Response findAll(); @GetMapping("/webUpdate/pages") Response page(@RequestParam("page") int page, @RequestParam("count") int count); @GetMapping("/lastestUpdateTime") Response lastestUpdateTime();  }