@Test public void delOne() throws Exception { Tag lastestTag = tagMapper.getLastestTag(); assertNotNull(lastestTag.getId()); String token = adminLogin(); mockMvc.perform(delete("/admin/tag/del?id=" + lastestTag.getId()).header("Authorization", token)).andDo(result -> { JSONObject object = JSONObject.fromObject(result.getResponse().getContentAsString()); assertEquals(SUCCESS.getCode(), object.getInt(Code)); assertTrue(object.getBoolean(Result)); }); long id = lastestTag.getId() * 2; mockMvc.perform(delete("/admin/tag/del?id=" + id).header("Authorization", token)).andDo(result -> assertEquals(TAG_NOT_EXIST.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)) ); }
@DeleteMapping("/admin/tag/del") public Response delOne(@RequestParam("id") long id) { return ResponseUtil.success(tagService.delete(id)); }
TagController { @DeleteMapping("/admin/tag/del") public Response delOne(@RequestParam("id") long id) { return ResponseUtil.success(tagService.delete(id)); } }
TagController { @DeleteMapping("/admin/tag/del") public Response delOne(@RequestParam("id") long id) { return ResponseUtil.success(tagService.delete(id)); }  }
TagController { @DeleteMapping("/admin/tag/del") public Response delOne(@RequestParam("id") long id) { return ResponseUtil.success(tagService.delete(id)); }  @PostMapping("/admin/tag/create") Response addOne(@RequestParam("name") String name); @DeleteMapping("/admin/tag/del") Response delOne(@RequestParam("id") long id); @PutMapping("/admin/tag/update") Response updateOne(@RequestParam("id") Long id, @RequestParam("name") String name); @GetMapping("/tag/id/{id}") Response retrieveOneById(@PathVariable("id") long id); @GetMapping("/tag/name/{name}") Response retrieveOneByName(@PathVariable("name") String name); @GetMapping("/tags") Response getPage(@RequestParam(required = false, defaultValue = "10", value = "count") int count,
                            @RequestParam(required = false, defaultValue = "1", value = "page") int page); @GetMapping("/tags/nac") Response getTagNameAndCount(); }
TagController { @DeleteMapping("/admin/tag/del") public Response delOne(@RequestParam("id") long id) { return ResponseUtil.success(tagService.delete(id)); }  @PostMapping("/admin/tag/create") Response addOne(@RequestParam("name") String name); @DeleteMapping("/admin/tag/del") Response delOne(@RequestParam("id") long id); @PutMapping("/admin/tag/update") Response updateOne(@RequestParam("id") Long id, @RequestParam("name") String name); @GetMapping("/tag/id/{id}") Response retrieveOneById(@PathVariable("id") long id); @GetMapping("/tag/name/{name}") Response retrieveOneByName(@PathVariable("name") String name); @GetMapping("/tags") Response getPage(@RequestParam(required = false, defaultValue = "10", value = "count") int count,
                            @RequestParam(required = false, defaultValue = "1", value = "page") int page); @GetMapping("/tags/nac") Response getTagNameAndCount();  }