@GetMapping("/logs/opName")
  @PreAuthorize(value = "@apolloAuditLogQueryApiPreAuthorizer.hasQueryPermission()")
  public List<ApolloAuditLogDTO> findAllAuditLogsByOpNameAndTime(@RequestParam String opName,
      @RequestParam int page, @RequestParam int size,
      @RequestParam(value = "startDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.S") Date startDate,
      @RequestParam(value = "endDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.S") Date endDate) {
    List<ApolloAuditLogDTO> logDTOList = api.queryLogsByOpName(opName, startDate, endDate, page,
        size);
    return logDTOList;
  }
@Test
  public void testFindAllAuditLogsByOpNameAndTime() throws Exception {
    final String opName = "query-op-name";
    final Date startDate = new Date(2023, Calendar.OCTOBER, 15);
    final Date endDate = new Date(2023, Calendar.OCTOBER, 16);
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");

    {
      List<ApolloAuditLogDTO> mockLogDTOList = MockBeanFactory.mockAuditLogDTOListByLength(size);
      mockLogDTOList.forEach(e -> {
        e.setOpName(opName);
      });
      Mockito.when(
          api.queryLogsByOpName(Mockito.eq(opName), Mockito.eq(startDate), Mockito.eq(endDate),
              Mockito.eq(page), Mockito.eq(size))).thenReturn(mockLogDTOList);
    }

    mockMvc.perform(MockMvcRequestBuilders.get("/apollo/audit/logs/opName").param("opName", opName)
            .param("startDate", sdf.format(startDate))
            .param("endDate", sdf.format(endDate))
            .param("page", String.valueOf(page))
            .param("size", String.valueOf(size)))
        .andExpect(MockMvcResultMatchers.status().isOk())
        .andExpect(MockMvcResultMatchers.jsonPath("$").isArray())
        .andExpect(MockMvcResultMatchers.jsonPath("$.length()").value(size))
        .andExpect(MockMvcResultMatchers.jsonPath("$.[0].opName").value(opName));

    Mockito.verify(api, Mockito.times(1))
        .queryLogsByOpName(Mockito.eq(opName), Mockito.eq(startDate), Mockito.eq(endDate),
            Mockito.eq(page), Mockito.eq(size));
  }