@Parameter(hidden = true)
    @PostMapping(value = "/generate")
    @ResponseStatus(HttpStatus.CREATED)
    @ApiException(GENERATE_TOKEN_ERROR)
    public Result<String> generateToken(@RequestAttribute(value = Constants.SESSION_USER) User loginUser,
                                        @RequestParam(value = "userId") int userId,
                                        @RequestParam(value = "expireTime") String expireTime) {
        String token = accessTokenService.generateToken(loginUser, userId, expireTime);
        return Result.success(token);
    }
@Test
    public void testGenerateToken() throws Exception {
        MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
        paramsMap.add("userId", "4");
        paramsMap.add("expireTime", "2019-12-28 00:00:00");
        MvcResult mvcResult = mockMvc.perform(post("/access-tokens/generate")
                .header("sessionId", sessionId)
                .params(paramsMap))
                .andExpect(status().isCreated())
                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andReturn();
        Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
        Assertions.assertEquals(Status.SUCCESS.getCode(), result.getCode().intValue());
        logger.info(mvcResult.getResponse().getContentAsString());
    }