refactor: use HeartbeatRequest from cameleer3-common
Some checks failed
CI / docker (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / deploy-feature (push) Has been cancelled
CI / cleanup-branch (push) Has been cancelled
CI / build (push) Has been cancelled

Replace local HeartbeatRequest DTO with the shared model from
cameleer3-common. Message types exchanged between server and agent
belong in the common module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-02 22:05:26 +02:00
parent 520b80444a
commit 8d899cc70c
2 changed files with 3 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ import com.cameleer3.server.app.dto.AgentRefreshResponse;
import com.cameleer3.server.app.dto.AgentRegistrationRequest;
import com.cameleer3.server.app.dto.AgentRegistrationResponse;
import com.cameleer3.server.app.dto.ErrorResponse;
import com.cameleer3.server.app.dto.HeartbeatRequest;
import com.cameleer3.common.model.HeartbeatRequest;
import com.cameleer3.server.app.security.BootstrapTokenValidator;
import com.cameleer3.server.core.admin.AuditCategory;
import com.cameleer3.server.core.admin.AuditResult;
@@ -203,10 +203,10 @@ public class AgentRegistrationController {
return ResponseEntity.notFound().build();
}
if (request != null && request.routeStates() != null && !request.routeStates().isEmpty()) {
if (request != null && request.getRouteStates() != null && !request.getRouteStates().isEmpty()) {
AgentInfo agent = registryService.findById(id);
if (agent != null) {
for (var entry : request.routeStates().entrySet()) {
for (var entry : request.getRouteStates().entrySet()) {
RouteStateRegistry.RouteState state = parseRouteState(entry.getValue());
if (state != null) {
routeStateRegistry.setState(agent.applicationId(), entry.getKey(), state);

View File

@@ -1,7 +0,0 @@
package com.cameleer3.server.app.dto;
import java.util.Map;
public record HeartbeatRequest(
Map<String, String> routeStates
) {}