class AccountController {
    /**
     * Token validity time in seconds
     * TOKEN有效期时间 单位秒
     */
    private static final long PERIOD_TIME = 3600L;
    /**
     * account data provider
     */
    private SurenessAccountProvider accountProvider = new DocumentAccountProvider();

    @PostMapping("/form")
    @Operation(summary = "Account password login to obtain associated user information", description = "账户密码登录获取关联用户信息")
    public ResponseEntity<Message<Map<String, String>>> authGetToken(@Valid @RequestBody LoginDto loginDto) {<FILL_FUNCTION_BODY>}

    @GetMapping("/refresh/{refreshToken}")
    @Operation(summary = "Use refresh TOKEN to re-acquire TOKEN", description = "使用刷新TOKEN重新获取TOKEN")
    public ResponseEntity<Message<RefreshTokenResponse>> refreshToken(
            @Parameter(description = "Refresh TOKEN | 刷新TOKEN", example = "xxx")
            @PathVariable("refreshToken") @NotNull final String refreshToken) {
        try {
            Claims claims = JsonWebTokenUtil.parseJwt(refreshToken);
            String userId = String.valueOf(claims.getSubject());
            boolean isRefresh = claims.get("refresh", Boolean.class);
            if (userId == null || !isRefresh) {
                return ResponseEntity.ok(Message.fail(MONITOR_LOGIN_FAILED_CODE, "Illegal Refresh Token"));
            }
            SurenessAccount account = accountProvider.loadAccount(userId);
            if (account == null) {
                return ResponseEntity.ok(Message.fail(MONITOR_LOGIN_FAILED_CODE, "Not Exists This Token Mapping Account"));
            }
            List<String> roles = account.getOwnRoles();
            String issueToken = issueToken(userId, roles, PERIOD_TIME);
            String issueRefresh = issueToken(userId, roles, PERIOD_TIME << 5);
            RefreshTokenResponse response = new RefreshTokenResponse(issueToken, issueRefresh);
            return ResponseEntity.ok(Message.success(response));
        } catch (Exception e) {
            log.error("Exception occurred during token refresh: {}", e.getClass().getName(), e);
            return ResponseEntity.ok(Message.fail(MONITOR_LOGIN_FAILED_CODE, "Refresh Token Expired or Error"));
        }
    }

    private String issueToken(String userId, List<String> roles, long expirationMillis) {
        Map<String, Object> customClaimMap = new HashMap<>(1);
        customClaimMap.put("refresh", true);
        return JsonWebTokenUtil.issueJwt(userId, expirationMillis, roles, customClaimMap);
    }
}

        SurenessAccount account = accountProvider.loadAccount(loginDto.getIdentifier());
        if (account == null || account.getPassword() == null) {
            return ResponseEntity.ok(Message.fail(MONITOR_LOGIN_FAILED_CODE, "Incorrect Account or Password"));
        } else {
            String password = loginDto.getCredential();
            if (account.getSalt() != null) {
                password = Md5Util.md5(password + account.getSalt());
            }
            if (!account.getPassword().equals(password)) {
                return ResponseEntity.ok(Message.fail(MONITOR_LOGIN_FAILED_CODE, "Incorrect Account or Password"));
            }
            if (account.isDisabledAccount() || account.isExcessiveAttempts()) {
                return ResponseEntity.ok(Message.fail(MONITOR_LOGIN_FAILED_CODE, "Expired or Illegal Account"));
            }
        }
        // Get the roles the user has - rbac
        List<String> roles = account.getOwnRoles();
        // Issue TOKEN  
        String issueToken = JsonWebTokenUtil.issueJwt(loginDto.getIdentifier(), PERIOD_TIME, roles);
        Map<String, Object> customClaimMap = new HashMap<>(1);
        customClaimMap.put("refresh", true);
        String issueRefresh = JsonWebTokenUtil.issueJwt(loginDto.getIdentifier(), PERIOD_TIME << 5, customClaimMap);
        Map<String, String> resp = new HashMap<>(2);
        resp.put("token", issueToken);
        resp.put("refreshToken", issueRefresh);
        resp.put("role", JsonUtil.toJson(roles));
        return ResponseEntity.ok(Message.success(resp));
    
<no_super_class>