|
|
@ -45,16 +45,15 @@ public class SystemController { |
|
|
|
@Operation(summary = "设置系统时间") |
|
|
|
@PostMapping("/set-datetime") |
|
|
|
public Result<?> setDatetime(@Valid @RequestBody TimeSetDTO timeSetDTO) { |
|
|
|
systemService.setSystemTime(timeSetDTO.getEpochMilli(), timeSetDTO.getZone()); |
|
|
|
systemService.setSystemTime(timeSetDTO.getEpochMilli()); |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@Operation(summary = "获取系统时间") |
|
|
|
@GetMapping("/get-datetime") |
|
|
|
public Result<?> getDatetime() { |
|
|
|
public Result<TimeResponseVO> getDatetime() { |
|
|
|
long epochMilli = systemService.getCurrentEpochMilli(); |
|
|
|
ZoneId systemZone = ZoneId.systemDefault(); |
|
|
|
return Result.success(new TimeResponseVO(epochMilli, systemZone)); |
|
|
|
return Result.success(new TimeResponseVO(epochMilli)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|