Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit ae9b14f

Browse files
committed
added RESTful response to SystemHealth.
1 parent 6c79a77 commit ae9b14f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
package de.filefighter.rest.health.business;
22

33
import de.filefighter.rest.health.data.SystemHealth;
4+
import de.filefighter.rest.health.rest.HealthRestController;
45
import org.jetbrains.annotations.NotNull;
56
import org.springframework.hateoas.EntityModel;
67
import org.springframework.hateoas.server.RepresentationModelAssembler;
78
import org.springframework.stereotype.Component;
89

10+
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;
11+
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn;
12+
913
@Component
1014
public class SystemHealthModelAssembler implements RepresentationModelAssembler<SystemHealth, EntityModel<SystemHealth>> {
1115

1216
@Override
1317
public @NotNull EntityModel<SystemHealth> toModel(@NotNull SystemHealth entity) {
14-
return EntityModel.of(entity);
18+
return EntityModel.of(entity,
19+
linkTo(methodOn(HealthRestController.class).getSystemHealthInfo()).withSelfRel());
1520
}
1621
}

0 commit comments

Comments
 (0)