删除无用配置

pull/146/head
ruibaby 2019-04-05 23:40:26 +08:00
parent 7fad38ebec
commit 5c1b521b11
4 changed files with 2 additions and 23 deletions

View File

@ -24,6 +24,7 @@ import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Calendar; import java.util.Calendar;
import java.util.Locale;
import java.util.Objects; import java.util.Objects;
/** /**
@ -90,7 +91,7 @@ public class LocalFileHandler implements FileHandler {
Assert.notNull(file, "Multipart file must not be null"); Assert.notNull(file, "Multipart file must not be null");
// Get current time // Get current time
Calendar current = Calendar.getInstance(optionService.getLocale()); Calendar current = Calendar.getInstance(Locale.CHINESE);
// Get month and day of month // Get month and day of month
int year = current.get(Calendar.YEAR); int year = current.get(Calendar.YEAR);
int month = current.get(Calendar.MONTH) + 1; int month = current.get(Calendar.MONTH) + 1;

View File

@ -268,13 +268,4 @@ public interface OptionService extends CrudService<Option, Integer> {
*/ */
@NonNull @NonNull
Zone getQnYunZone(); Zone getQnYunZone();
/**
* Gets locale.
*
* @return locale user set or default locale
*/
@NonNull
Locale getLocale();
} }

View File

@ -269,16 +269,4 @@ public class OptionServiceImpl extends AbstractCrudService<Option, Integer> impl
}).orElseGet(Zone::autoZone); }).orElseGet(Zone::autoZone);
} }
@Override
public Locale getLocale() {
return getByProperty(BlogProperties.BLOG_LOCALE).map(localeStr -> {
try {
return Locale.forLanguageTag(localeStr);
} catch (Exception e) {
return Locale.getDefault();
}
}).orElseGet(Locale::getDefault);
}
} }

View File

@ -164,7 +164,6 @@ public class InstallController {
// Init default properties // Init default properties
Map<PropertyEnum, String> properties = new HashMap<>(11); Map<PropertyEnum, String> properties = new HashMap<>(11);
properties.put(PrimaryProperties.IS_INSTALLED, Boolean.TRUE.toString()); properties.put(PrimaryProperties.IS_INSTALLED, Boolean.TRUE.toString());
properties.put(BlogProperties.BLOG_LOCALE, installParam.getLocale());
properties.put(BlogProperties.BLOG_TITLE, installParam.getTitle()); properties.put(BlogProperties.BLOG_TITLE, installParam.getTitle());
properties.put(BlogProperties.BLOG_URL, installParam.getUrl()); properties.put(BlogProperties.BLOG_URL, installParam.getUrl());
properties.put(PrimaryProperties.THEME, DEFAULT_THEME_NAME); properties.put(PrimaryProperties.THEME, DEFAULT_THEME_NAME);