testing hal+json
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
@@ -28,8 +28,10 @@ public class TimezoneController {
|
||||
val ip = timeZoneService.getExternalIp(clientIp);
|
||||
val timezoneInfo = timeZoneService.getTimeZoneInfoByIp(ip);
|
||||
val posix = timeZoneService.getPosixTimeZone(timezoneInfo.timezone());
|
||||
return TimezoneResponse.builder().timezone(timezoneInfo.timezone())
|
||||
.posix_tz(posix).build();
|
||||
val response = new TimezoneResponse();
|
||||
response.setTimezone(timezoneInfo.timezone());
|
||||
response.setPosix_tz(posix);
|
||||
return response;
|
||||
}
|
||||
|
||||
@GetMapping("{area}")
|
||||
@@ -44,6 +46,9 @@ public class TimezoneController {
|
||||
public TimezoneResponse getTimeZoneForLocation(@PathVariable String area, @PathVariable String location) {
|
||||
val timezone = area + "/" + location;
|
||||
val posix = timeZoneService.getPosixTimeZone(timezone);
|
||||
return TimezoneResponse.builder().timezone(timezone).posix_tz(posix).build();
|
||||
val response = new TimezoneResponse();
|
||||
response.setTimezone(timezone);
|
||||
response.setPosix_tz(posix);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
@@ -1,15 +1,15 @@
|
||||
package dev.mars3142.fhq.timezone_service.timezone.domain.model.response;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.hateoas.RepresentationModel;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Setter
|
||||
@RequiredArgsConstructor
|
||||
public class TimezoneResponse extends RepresentationModel<TimezoneResponse> {
|
||||
|
||||
private final String timezone;
|
||||
private final String posix_tz;
|
||||
private String timezone;
|
||||
private String posix_tz;
|
||||
}
|
||||
|
Reference in New Issue
Block a user