This repository was archived by the owner on Apr 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/de/filefighter/rest/health/business Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
package de .filefighter .rest .health .business ;
2
2
3
3
import de .filefighter .rest .health .data .SystemHealth ;
4
+ import de .filefighter .rest .health .rest .HealthRestController ;
4
5
import org .jetbrains .annotations .NotNull ;
5
6
import org .springframework .hateoas .EntityModel ;
6
7
import org .springframework .hateoas .server .RepresentationModelAssembler ;
7
8
import org .springframework .stereotype .Component ;
8
9
10
+ import static org .springframework .hateoas .server .mvc .WebMvcLinkBuilder .linkTo ;
11
+ import static org .springframework .hateoas .server .mvc .WebMvcLinkBuilder .methodOn ;
12
+
9
13
@ Component
10
14
public class SystemHealthModelAssembler implements RepresentationModelAssembler <SystemHealth , EntityModel <SystemHealth >> {
11
15
12
16
@ Override
13
17
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 ());
15
20
}
16
21
}
You can’t perform that action at this time.
0 commit comments