s7monk opened a new pull request, #209: URL: https://github.com/apache/paimon-webui/pull/209
Relates to: https://github.com/apache/paimon-webui/issues/195 ### Purpose This PR is a subtask of https://github.com/apache/paimon-webui/issues/195. It adds a session interface, creates a session or triggers a heartbeat, and the front end calls the interface regularly. ### Tests SessionControllerTest. ### API and Format ``` @PostMapping("/check") public R<Void> checkAndRenewSession(Integer uid) { QueryWrapper<ClusterInfo> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("type", "Flink"); List<ClusterInfo> clusterInfos = clusterService.list(queryWrapper); for (ClusterInfo cluster : clusterInfos) { SessionDTO sessionDTO = new SessionDTO(); sessionDTO.setHost(cluster.getHost()); sessionDTO.setPort(cluster.getPort()); sessionDTO.setClusterId(cluster.getId()); sessionDTO.setUid(uid); if (sessionService.getSession(uid, cluster.getId()) == null) { sessionService.createSession(sessionDTO); } else { if (sessionService.triggerSessionHeartbeat(sessionDTO) < 1) { sessionService.createSession(sessionDTO); } } } return R.succeed(); } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
