diff --git a/src/main/java/com/example/nto/utils/Utils.java b/src/main/java/com/example/nto/utils/Utils.java index 10a4f48..1437800 100644 --- a/src/main/java/com/example/nto/utils/Utils.java +++ b/src/main/java/com/example/nto/utils/Utils.java @@ -1,5 +1,6 @@ package com.example.nto.utils; +import com.example.nto.config.ObjectStorageConfig; import lombok.experimental.UtilityClass; import java.time.*; @@ -14,6 +15,8 @@ public class Utils { private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd"); private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("HH:mm:ss"); + private static final ObjectStorageConfig storageConfig = new ObjectStorageConfig(); + public static String profileFileName(long userId) { return "profile--" + userId; } @@ -24,12 +27,17 @@ public class Utils { public static String nowTime(DataFormatType type) { switch (type) { - case DATE_TIME: return LocalDateTime.now().format(DATE_TIME_FORMAT); - case DATE: return LocalDateTime.now().format(DATE_FORMAT); - case TIME: return LocalDateTime.now().format(TIME_FORMAT); - default: return "Произошла ошибка при форматировании даты или времени."; + case DATE_TIME: + return LocalDateTime.now().format(DATE_TIME_FORMAT); + case DATE: + return LocalDateTime.now().format(DATE_FORMAT); + case TIME: + return LocalDateTime.now().format(TIME_FORMAT); + default: + return "Произошла ошибка при форматировании даты или времени."; } } + public static LocalDateTime period(LocalDateTime dtStart, LocalDateTime dtEnd) { // Возвращает разницу между двумя LocalDateTime Period period = Period.between(dtStart.toLocalDate(), dtEnd.toLocalDate());