From b4e953e27d7b4d0bfceaccf4555116c84b57a7b7 Mon Sep 17 00:00:00 2001 From: Koda Date: Mon, 25 Jul 2016 05:46:22 +0900 Subject: [PATCH 1/2] #431 Modify log level --- .../project/knowledge/logic/KnowledgeLogic.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java b/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java index b928eee06..7d8c2655b 100644 --- a/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java @@ -1313,21 +1313,21 @@ public boolean isEditor(LoginedUser loginedUser, KnowledgesEntity entity, List getPopularityKnowledges(LoginedUser loginedUser, int offset, int limit) { long now = new Date().getTime(); - LOG.info(now); + LOG.trace(now); long term = 1000L * 60L * 60L * 24L * 30L; - LOG.info(term); + LOG.trace(term); long s = now - term; - LOG.info(s); + LOG.trace(s); Timestamp start = new Timestamp(s); - LOG.info(start.getTime()); - LOG.info(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(start)); + LOG.trace(start.getTime()); + LOG.trace(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(start)); long e = now + (1000L * 60L * 60L * 24L * 1L); - LOG.info(e); + LOG.trace(e); Timestamp end = new Timestamp(e); - LOG.info(end.getTime()); - LOG.info(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(end)); + LOG.trace(end.getTime()); + LOG.trace(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(end)); if (loginedUser != null && loginedUser.isAdmin()) { return KnowledgesDao.get().selectPopularity(start, end, offset, limit); From 5671beadd6a160be24772fae57504059e29824f6 Mon Sep 17 00:00:00 2001 From: Koda Date: Wed, 27 Jul 2016 00:34:28 +0900 Subject: [PATCH 2/2] #431 Generate the key before convert data --- .../project/knowledge/deploy/v1_5_0/Migrate_1_5_0.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/support/project/knowledge/deploy/v1_5_0/Migrate_1_5_0.java b/src/main/java/org/support/project/knowledge/deploy/v1_5_0/Migrate_1_5_0.java index 2cdea8a49..f7bc29aa2 100644 --- a/src/main/java/org/support/project/knowledge/deploy/v1_5_0/Migrate_1_5_0.java +++ b/src/main/java/org/support/project/knowledge/deploy/v1_5_0/Migrate_1_5_0.java @@ -13,11 +13,14 @@ import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.SecretKeySpec; +import org.support.project.common.log.Log; +import org.support.project.common.log.LogFactory; import org.support.project.common.util.Base64Utils; import org.support.project.common.util.PasswordUtil; import org.support.project.common.util.StringUtils; import org.support.project.knowledge.config.AppConfig; import org.support.project.knowledge.deploy.Migrate; +import org.support.project.knowledge.logic.MailLogic; import org.support.project.ormapping.tool.dao.InitializeDao; import org.support.project.web.dao.LdapConfigsDao; import org.support.project.web.dao.MailConfigsDao; @@ -27,6 +30,9 @@ import org.support.project.web.entity.ProxyConfigsEntity; public class Migrate_1_5_0 implements Migrate { + /** ログ */ + private static final Log LOG = LogFactory.getLog(Migrate_1_5_0.class); + private static final String CIPHER_ALGORITHM = "AES"; public static Migrate_1_5_0 get() { @@ -60,6 +66,8 @@ public boolean doMigrate() throws Exception { // 暗号化の仕組みを変更したため、旧暗号化の仕組みを使っていた場合、それを復元して、再度暗号化し直す File keyTxt = new File(AppConfig.get().getBasePath(), "key.txt"); if (!keyTxt.exists()) { + LOG.info("start data convert."); + AppConfig.get().getKey(); List ldaps = LdapConfigsDao.get().selectAll(); for (LdapConfigsEntity entity : ldaps) { if (StringUtils.isNotEmpty(entity.getBindPassword())) {