@PostMapping("")
    @RequiresPermissions("system:manager:add")
    public ShenyuAdminResult createDashboardUser(@Valid @RequestBody final DashboardUserDTO dashboardUserDTO) {
        return Optional.ofNullable(dashboardUserDTO)
                .map(item -> {
                    item.setPassword(DigestUtils.sha512Hex(item.getPassword()));
                    Integer createCount = dashboardUserService.createOrUpdate(item);
                    return ShenyuAdminResult.success(ShenyuResultMessage.CREATE_SUCCESS, createCount);
                })
                .orElseGet(() -> ShenyuAdminResult.error(ShenyuResultMessage.DASHBOARD_CREATE_USER_ERROR));
    }
@Test
    public void createDashboardUser() throws Exception {
        final String url = "/dashboardUser";
        given(dashboardUserService.createOrUpdate(any())).willReturn(1);
        mockMvc.perform(post(url, dashboardUserDTO)
                .content(GsonUtils.getInstance().toJson(dashboardUserDTO))
                .contentType(MediaType.APPLICATION_JSON))
                .andExpect(status().isOk())
                .andDo(print())
                .andExpect(jsonPath("$.message", is(ShenyuResultMessage.CREATE_SUCCESS)))
                .andExpect(jsonPath("$.data", is(1)));
    }