yingp 6 years ago
parent
commit
9b0aa6a449

+ 0 - 11
uas-office-core/src/main/java/com/usoftchina/uas/office/jdbc/SchemaUtils.java

@@ -1,8 +1,6 @@
 package com.usoftchina.uas.office.jdbc;
 
 import com.usoftchina.uas.office.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.jdbc.core.JdbcTemplate;
 
 import java.util.ArrayList;
@@ -15,8 +13,6 @@ import java.util.stream.Collectors;
  */
 public class SchemaUtils {
 
-    private final static Logger logger = LoggerFactory.getLogger(SchemaUtils.class);
-
     public static TableBuilder newTable(String tableName) {
         return new TableBuilder(tableName);
     }
@@ -48,10 +44,8 @@ public class SchemaUtils {
     }
 
     public static void create(Table table, JdbcTemplate jdbcTemplate) {
-        logger.debug("SchemaUtils create(Table table, JdbcTemplate jdbcTemplate)");
         TableBuilder builder = newTable(table.name);
         table.getColumns().forEach(column -> {
-            logger.debug("SchemaUtils create(Table table, JdbcTemplate jdbcTemplate) forEach columns");
             builder.add(newColumn(column.getName())
                     .type(column.getType())
                     .notNull(column.isNotNull())
@@ -96,7 +90,6 @@ public class SchemaUtils {
         }
 
         public void create(JdbcTemplate jdbcTemplate) {
-            logger.debug("SchemaUtils create(JdbcTemplate jdbcTemplate)");
             SchemaUtils.create(this, jdbcTemplate);
         }
     }
@@ -124,13 +117,10 @@ public class SchemaUtils {
 
         public void create(JdbcTemplate jdbcTemplate) {
             if (isTableExists(name, jdbcTemplate)) {
-                logger.debug("SchemaUtils create(JdbcTemplate jdbcTemplate) table exists " + name);
                 columnBuilderList.forEach(builder -> {
                     if (isColumnExists(name, builder.name, jdbcTemplate)) {
-                        logger.debug("SchemaUtils create(JdbcTemplate jdbcTemplate) column exists " + builder.name);
                         builder.modify(this, jdbcTemplate);
                     } else {
-                        logger.debug("SchemaUtils create(JdbcTemplate jdbcTemplate) column add " + builder.name);
                         builder.add(this, jdbcTemplate);
                     }
                 });
@@ -139,7 +129,6 @@ public class SchemaUtils {
                 statement.append(name).append(" (");
                 statement.append(columnBuilderList.stream().map(ColumnBuilder::toString).collect(Collectors.joining(",")));
                 statement.append(")");
-                logger.debug("SchemaUtils create(JdbcTemplate jdbcTemplate) create table " + statement);
                 jdbcTemplate.execute(statement.toString());
             }
 

+ 3 - 3
uas-office-server/src/main/resources/application.yaml

@@ -15,7 +15,7 @@ spring:
   datasource:
     primary:
       driver-class-name: org.h2.Driver
-      jdbc-url: jdbc:h2:file:${user.home}/.qywx/data/qywx;FILE_LOCK=NO;DB_CLOSE_ON_EXIT=FALSE
+      jdbc-url: jdbc:h2:file:${user.home}/.office/data/server;FILE_LOCK=NO;DB_CLOSE_ON_EXIT=FALSE
       username: admin
       password: select111***
     hikari:
@@ -31,6 +31,6 @@ spring:
     serialization:
       write-dates-as-timestamps: true
 logging:
-  path: ${user.home}/.qywx/logs/
+  path: ${user.home}/.office/logs/
   level:
-    com.usoftchina.uas.office: debug
+    com.usoftchina.uas.office: debug

+ 2 - 2
uas-office-server/src/main/resources/logback-spring.xml

@@ -24,7 +24,7 @@
     -->
 
     <springProperty scope="context" name="log.path" source="logging.path" defaultValue="./logs"/>
-    <springProperty scope="context" name="spring.application.name" source="spring.application.name" defaultValue="uas-pl"/>
+    <springProperty scope="context" name="spring.application.name" source="spring.application.name" defaultValue="uas-office-server"/>
     <springProperty scope="context" name="spring.profiles.active" source="spring.profiles.active" defaultValue="prod"/>
     <springProperty scope="context" name="common-pattern" source="logging.common-pattern" defaultValue="%d{yyyy-MM-dd HH:mm:ss.SSS}:[%5p] [%t:%r] [%C{1}:%M:%L] --> %m%n"/>
     <springProperty scope="context" name="log.level.console" source="logging.level.console" defaultValue="INFO"/>
@@ -45,7 +45,7 @@
     </appender>
 
     <logger name="org.springframework" level="INFO"/>
-    <logger name="com.usoftchina.uas.pl" level="DEBUG"/>
+    <logger name="com.usoftchina.uas.office" level="DEBUG"/>
 
     <root level="INFO">
         <appender-ref ref="ROOT_APPENDER"/>