@GetMapping()
    @Secured(action = ActionTypes.READ, resource = "nacos/admin")
    public Result<ObjectNode> getClientDetail(@RequestParam("clientId") String clientId) throws NacosApiException {
        checkClientId(clientId);
        Client client = clientManager.getClient(clientId);
        
        ObjectNode result = JacksonUtils.createEmptyJsonNode();
        result.put("clientId", client.getClientId());
        result.put("ephemeral", client.isEphemeral());
        result.put("lastUpdatedTime", client.getLastUpdatedTime());
        
        if (client instanceof ConnectionBasedClient) {
            // 2.x client
            result.put("clientType", "connection");
            Connection connection = connectionManager.getConnection(clientId);
            ConnectionMeta connectionMetaInfo = connection.getMetaInfo();
            result.put("connectType", connectionMetaInfo.getConnectType());
            result.put("appName", connectionMetaInfo.getAppName());
            result.put("version", connectionMetaInfo.getVersion());
            result.put("clientIp", connectionMetaInfo.getClientIp());
            result.put("clientPort", clientId.substring(clientId.lastIndexOf('_') + 1));
        } else if (client instanceof IpPortBasedClient) {
            // 1.x client
            result.put("clientType", "ipPort");
            IpPortBasedClient ipPortBasedClient = (IpPortBasedClient) client;
            String responsibleId = ipPortBasedClient.getResponsibleId();
            int idx = responsibleId.lastIndexOf(':');
            result.put("clientIp", responsibleId.substring(0, idx));
            result.put("clientPort", responsibleId.substring(idx + 1));
        }
        return Result.success(result);
    }
@Test
    void testGetClientDetail() throws Exception {
        when(clientManager.getClient("test1")).thenReturn(ipPortBasedClient);
        MockHttpServletRequestBuilder mockHttpServletRequestBuilder = MockMvcRequestBuilders.get(URL).param("clientId", "test1");
        MockHttpServletResponse response = mockmvc.perform(mockHttpServletRequestBuilder).andReturn().getResponse();
        assertEquals(200, response.getStatus());
    }