MethodLogController extends BaseControllerImpl<MethodLog> { @Override @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("根据ID查询方法日志") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") public Result<MethodLog> findById(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) { return super.findById(id); }  @Autowired void setMethodLogService(MethodLogService methodLogService); @Override @GetMapping("/dict") @ApiOperation("获取方法日志的数据字典") @PreAuthorize("hasAnyAuthority('" + LIST_PERM + "')") Result<TableInfo> getTableInfo(); @Override @DeleteMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("删除方法日志") @PreAuthorize("hasAnyAuthority('" + DELETE_PERM + "')") Result<Void> delete(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) {; @Override @GetMapping @ApiOperation("查询所有方法日志") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") Result<List<MethodLog>> findAll(MethodLog model); @Override @GetMapping("/{page:[0-9]+}/{size:[0-9]+}") @ApiOperation("分页查询方法日志列表") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") Result<QueryResult<MethodLog>> query(@ApiParam(value = "页码", required = true) @PathVariable("page") int page, @ApiParam(value = "每页数据条数", required = true) @PathVariable("size") int size, MethodLog model) {; @Override @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("根据ID查询方法日志") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") Result<MethodLog> findById(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) {; @Override @GetMapping("/export") @ApiOperation("导出方法日志到文件") @PreAuthorize("permitAll()") void exportData(@RequestBody(required = false) List<String> ids, HttpServletResponse response);  }
@Test public void testFindById() throws Exception { String id = "{}"; String result = mockMvc.perform(get("/monitor/methodLog/"+ id) .header(HttpHeaders.AUTHORIZATION, String.join(" ", accessToken.getTokenType(), accessToken.getValue())) .contentType(MediaType.APPLICATION_JSON_UTF8) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()) .andExpect(jsonPath("$.data.id").value(id)) .andReturn().getResponse().getContentAsString(); log.info(result); }