@GetMapping("/login")
    public ShenyuAdminResult loginDashboardUser(final String userName, final String password, @RequestParam(required = false) final String clientId) {
        LoginDashboardUserVO loginVO = dashboardUserService.login(userName, password, clientId);
        return Optional.ofNullable(loginVO)
                .map(loginStatus -> {
                    if (Boolean.TRUE.equals(loginStatus.getEnabled())) {
                        return ShenyuAdminResult.success(ShenyuResultMessage.PLATFORM_LOGIN_SUCCESS, loginVO);
                    }
                    return ShenyuAdminResult.error(ShenyuResultMessage.LOGIN_USER_DISABLE_ERROR);
                }).orElse(ShenyuAdminResult.error(ShenyuResultMessage.PLATFORM_LOGIN_ERROR));
    }
@Test
    public void testLoginDashboardUser() throws Exception {
        final String loginUri = "/platform/login?userName=admin&password=123456";

        LoginDashboardUserVO loginDashboardUserVO = LoginDashboardUserVO.buildLoginDashboardUserVO(dashboardUserVO);
        given(this.dashboardUserService.login(eq("admin"), eq("123456"), isNull())).willReturn(loginDashboardUserVO);
        this.mockMvc.perform(MockMvcRequestBuilders.request(HttpMethod.GET, loginUri))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.code", is(CommonErrorCode.SUCCESSFUL)))
                .andExpect(jsonPath("$.message", is(ShenyuResultMessage.PLATFORM_LOGIN_SUCCESS)))
                .andExpect(jsonPath("$.data.id", is(loginDashboardUserVO.getId())))
                .andReturn();
    }