Browse Source

删除无用类,修改项目结构

Young 2 years ago
parent
commit
94d7b93595
28 changed files with 41 additions and 1019 deletions
  1. 5 10
      pom.xml
  2. 3 4
      src/main/java/com/nosum/DeliverApplication.java
  3. 3 2
      src/main/java/com/nosum/common/config/JacksonConfig.java
  4. 0 34
      src/main/java/com/nosum/common/config/TransactionConfig.java
  5. 0 56
      src/main/java/com/nosum/common/config/TransactionManager.java
  6. 24 13
      src/main/java/com/nosum/common/config/WebConverterConfigurer.java
  7. 0 20
      src/main/java/com/nosum/system/init/ConfigApplicationContextInitializer.java
  8. 0 100
      src/main/java/com/nosum/system/init/InitDatabaseConfig.java
  9. 0 42
      src/main/java/com/nosum/system/init/strategy/HelloBlogAuthTokenTable.java
  10. 0 50
      src/main/java/com/nosum/system/init/strategy/HelloBlogAuthUserLogTable.java
  11. 0 47
      src/main/java/com/nosum/system/init/strategy/HelloBlogAuthUserSocialTable.java
  12. 0 50
      src/main/java/com/nosum/system/init/strategy/HelloBlogAuthUserTable.java
  13. 0 45
      src/main/java/com/nosum/system/init/strategy/HelloBlogBlackListTable.java
  14. 0 45
      src/main/java/com/nosum/system/init/strategy/HelloBlogCategoryTable.java
  15. 0 44
      src/main/java/com/nosum/system/init/strategy/HelloBlogCategoryTagsTable.java
  16. 0 76
      src/main/java/com/nosum/system/init/strategy/HelloBlogConfigTable.java
  17. 0 45
      src/main/java/com/nosum/system/init/strategy/HelloBlogFriendshipLinkTable.java
  18. 0 44
      src/main/java/com/nosum/system/init/strategy/HelloBlogMenuTable.java
  19. 0 41
      src/main/java/com/nosum/system/init/strategy/HelloBlogPostsAttributeTable.java
  20. 0 46
      src/main/java/com/nosum/system/init/strategy/HelloBlogPostsCommentsTable.java
  21. 0 52
      src/main/java/com/nosum/system/init/strategy/HelloBlogPostsTable.java
  22. 0 44
      src/main/java/com/nosum/system/init/strategy/HelloBlogPostsTagsTable.java
  23. 0 46
      src/main/java/com/nosum/system/init/strategy/HelloBlogTagsTable.java
  24. 0 16
      src/main/java/com/nosum/system/init/strategy/TableInfoService.java
  25. 0 23
      src/main/java/com/nosum/system/init/strategy/TableInitFactory.java
  26. 3 2
      src/main/java/com/nosum/system/interceptor/AuthenticationInterceptor.java
  27. 0 20
      src/main/java/com/nosum/system/interceptor/BlackListInterceptor.java
  28. 3 2
      src/main/java/com/nosum/system/interceptor/CORSInterceptor.java

+ 5 - 10
pom.xml

@@ -30,14 +30,9 @@
         </dependency>
 
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>eu.bitwalker</groupId>
             <artifactId>UserAgentUtils</artifactId>
-            <version>1.20</version>
+            <version>1.21</version>
         </dependency>
 
         <dependency>
@@ -48,26 +43,26 @@
         <dependency>
             <groupId>org.aspectj</groupId>
             <artifactId>aspectjweaver</artifactId>
-            <version>1.9.2</version>
+            <version>1.9.8</version>
         </dependency>
 
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
-            <version>1.18.4</version>
+            <version>1.18.22</version>
             <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>com.auth0</groupId>
             <artifactId>java-jwt</artifactId>
-            <version>3.4.0</version>
+            <version>3.18.3</version>
         </dependency>
 
         <dependency>
             <groupId>cn.hutool</groupId>
             <artifactId>hutool-all</artifactId>
-            <version>4.6.4</version>
+            <version>5.7.20</version>
         </dependency>
 
         <dependency>

+ 3 - 4
src/main/java/com/nosum/DeliverApplication.java

@@ -1,20 +1,19 @@
 package com.nosum;
 
-import com.nosum.system.init.ConfigApplicationContextInitializer;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
- * @Author:sumbytes
- * @Date:2018/09/27 12:52
+ * 视频流量投放系统
+ *
+ * @author Young
  */
 @EnableScheduling
 @SpringBootApplication
 public class DeliverApplication {
     public static void main(String[] args) {
         SpringApplication springApplication = new SpringApplication(DeliverApplication.class);
-        springApplication.addInitializers(new ConfigApplicationContextInitializer());
         springApplication.run(args);
     }
 }

+ 3 - 2
src/main/java/com/nosum/common/config/JacksonConfig.java

@@ -23,8 +23,9 @@ import java.time.LocalDateTime;
 import java.time.ZoneId;
 
 /**
- * @Author:sumbytes
- * @Date:2018/09/27 12:52
+ * JSON 转换类.
+ *
+ * @author Young
  */
 public class JacksonConfig {
 

+ 0 - 34
src/main/java/com/nosum/common/config/TransactionConfig.java

@@ -1,34 +0,0 @@
-package com.nosum.common.config;
-
-import org.springframework.aop.Advisor;
-import org.springframework.aop.aspectj.AspectJExpressionPointcut;
-import org.springframework.aop.support.DefaultPointcutAdvisor;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.transaction.interceptor.TransactionInterceptor;
-
-/**
- * @Description:
- * @Author:sumbytes
- * @Date:2018/08/20 18:49
- */
-@Configuration
-public class TransactionConfig {
-
-    @Autowired
-    private PlatformTransactionManager transactionManager;
-
-    @Bean
-    public TransactionInterceptor txAdvice() {
-        return TransactionManager.txAdvice(transactionManager);
-    }
-
-    @Bean
-    public Advisor txAdviceAdvisor() {
-        AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
-        pointcut.setExpression("execution(* com.nosum.deliver.*.service.impl.*.*(..))");
-        return new DefaultPointcutAdvisor(pointcut, txAdvice());
-    }
-}

+ 0 - 56
src/main/java/com/nosum/common/config/TransactionManager.java

@@ -1,56 +0,0 @@
-package com.nosum.common.config;
-
-import com.nosum.common.constant.Constants;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.transaction.TransactionDefinition;
-import org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource;
-import org.springframework.transaction.interceptor.RuleBasedTransactionAttribute;
-import org.springframework.transaction.interceptor.TransactionAttribute;
-import org.springframework.transaction.interceptor.TransactionInterceptor;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @Author:sumbytes
- * @Date:2018/09/27 12:52
- */
-public class TransactionManager {
-
-    public static TransactionInterceptor txAdvice(PlatformTransactionManager transactionManager) {
-
-        // 只读事务,不做更新操作
-        RuleBasedTransactionAttribute readOnlyTx = new RuleBasedTransactionAttribute();
-        readOnlyTx.setReadOnly(true);
-        readOnlyTx.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS);
-
-        // 当前存在事务就使用当前事务,当前不存在事务就创建一个新事务
-        RuleBasedTransactionAttribute requiredTx = new RuleBasedTransactionAttribute();
-        requiredTx.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
-        requiredTx.setTimeout(Constants.TX_METHOD_TIMEOUT);
-
-        Map<String, TransactionAttribute> txMap = new HashMap<>(20);
-        txMap.put("save*", requiredTx);
-        txMap.put("add*", requiredTx);
-        txMap.put("register*", requiredTx);
-        txMap.put("create*", requiredTx);
-        txMap.put("update*", requiredTx);
-        txMap.put("remove*", requiredTx);
-        txMap.put("delete*", requiredTx);
-        txMap.put("cancel*", requiredTx);
-        txMap.put("do*", requiredTx);
-
-        txMap.put("get*", readOnlyTx);
-        txMap.put("list*", readOnlyTx);
-        txMap.put("page*", readOnlyTx);
-        txMap.put("find*", readOnlyTx);
-        txMap.put("search*", readOnlyTx);
-        txMap.put("load*", readOnlyTx);
-        txMap.put("*", readOnlyTx);
-
-        NameMatchTransactionAttributeSource source = new NameMatchTransactionAttributeSource();
-        source.setNameMap(txMap);
-
-        return new TransactionInterceptor(transactionManager, source);
-    }
-}

+ 24 - 13
src/main/java/com/nosum/common/config/WebConverterConfigurer.java

@@ -17,11 +17,10 @@ import java.time.LocalDate;
 import java.time.LocalDateTime;
 
 /**
- * @Description: 将Json序列化工具设置为FastJson
- * @Author:sumbytes
- * @Date:2019/01/15 08:00
+ * 将Json序列化工具设置为FastJson
+ *
+ * @author Young
  */
-
 @Configuration
 public class WebConverterConfigurer implements WebMvcConfigurer {
 
@@ -36,18 +35,30 @@ public class WebConverterConfigurer implements WebMvcConfigurer {
 
     @Override
     public void addFormatters(FormatterRegistry registry) {
-
-
-        // 注册时间反序列化转换器,时间戳字符串转换为LocalDateTime类型
-        registry.addConverter((Converter<String, LocalDate>) source -> StringUtils.isBlank(source) ? null : new Timestamp(Long.parseLong(source)).toLocalDateTime().toLocalDate());
-
-        // 注册时间反序列化转换器,时间戳字符串转换为LocalDateTime类型
-        registry.addConverter((Converter<String, LocalDateTime>) source -> StringUtils.isBlank(source) ? null : new Timestamp(Long.parseLong(source)).toLocalDateTime());
+        registry.addConverter(new LocalDateConvert());
+        registry.addConverter(new LocalDateTimeConvert());
     }
 
     @Override
     public void addInterceptors(InterceptorRegistry registry) {
-        // 可添加多个
         registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**");
     }
-}
+
+
+
+    static class LocalDateConvert implements Converter<String, LocalDate> {
+
+        @Override
+        public LocalDate convert(String source) {
+            return StringUtils.isBlank(source) ? null : new Timestamp(Long.parseLong(source)).toLocalDateTime().toLocalDate();
+        }
+    }
+
+    static class LocalDateTimeConvert implements Converter<String, LocalDateTime> {
+
+        @Override
+        public LocalDateTime convert(String source) {
+            return StringUtils.isBlank(source) ? null : new Timestamp(Long.parseLong(source)).toLocalDateTime();
+        }
+    }
+}

+ 0 - 20
src/main/java/com/nosum/system/init/ConfigApplicationContextInitializer.java

@@ -1,20 +0,0 @@
-package com.nosum.system.init;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.context.ApplicationContextInitializer;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.stereotype.Component;
-
-/**
- * @Author:sumbytes
- * @Date:2018/09/27 12:52
- */
-@Slf4j
-@Component
-public class ConfigApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
-
-    @Override
-    public void initialize(final ConfigurableApplicationContext configurableApplicationContext) {
-        log.debug("==================初始化配置==================");
-    }
-}

+ 0 - 100
src/main/java/com/nosum/system/init/InitDatabaseConfig.java

@@ -1,100 +0,0 @@
-package com.nosum.system.init;
-
-import com.nosum.system.init.strategy.TableInfoService;
-import com.nosum.system.init.strategy.TableInitFactory;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.event.ApplicationContextEvent;
-import org.springframework.core.Ordered;
-import org.springframework.stereotype.Component;
-
-import java.sql.*;
-
-/**
- * @author sumbytes
- * @date 2019/11/24
- */
-@Component
-@Slf4j
-public class InitDatabaseConfig implements ApplicationListener<ApplicationContextEvent>, Ordered {
-
-    @Value("${spring.datasource.driver-class-name}")
-    private String driver;
-
-    @Value("${spring.datasource.url}")
-    private String url;
-
-    @Value("${spring.datasource.username}")
-    private String userName;
-
-    @Value("${spring.datasource.password}")
-    private String password;
-
-    public void init() {
-
-        //连接数据库
-        try {
-            Class.forName(driver);
-        } catch (final ClassNotFoundException e) {
-            log.error("连接数据库异常 {}", e.getMessage());
-        }
-        //测试url中是否包含useSSL字段,没有则添加设该字段且禁用
-        if (url.indexOf("?") == -1) {
-            url = url + "?useSSL=false";
-        } else if (url.indexOf("useSSL=false") == -1 || url.indexOf("useSSL=true") == -1) {
-            url = url + "&useSSL=false";
-        }
-
-        Connection conn = null;
-        Statement stat = null;
-        try {
-            conn = DriverManager.getConnection(url, userName, password);
-            stat = conn.createStatement();
-        } catch (final SQLException e) {
-            log.error("数据库解析异常 {}", e.getMessage());
-        }
-
-        final String[] tables = {"config", "auth_token", "auth_user",
-                "category", "category_tags", "friendship_link", "posts"
-                , "posts_attribute", "posts_comments", "posts_tags", "tags"
-                , "auth_user_log","menu","auth_user_social","black_list"};
-
-        try {
-            for (int i = 0; i < tables.length; i++) {
-                //获取数据库表名
-                final ResultSet rs = conn.getMetaData().getTables(null, null, tables[i], null);
-                // 判断表是否存在,如果存在则什么都不做,否则创建表
-                if (!rs.next()) {
-                    final TableInfoService byTableName = TableInitFactory.getByTableName(tables[i]);
-                    byTableName.builderTable(stat);
-                }
-            }
-        } catch (final SQLException e) {
-            log.error("数据库解析异常 {}", e.getMessage());
-        } finally {
-            // 释放资源
-            try {
-                stat.close();
-            } catch (final SQLException e) {
-                log.error("释放 Statement 失败 {}", e.getMessage());
-            }
-            try {
-                conn.close();
-            } catch (final SQLException e) {
-                log.error("释放 Connection 失败 {}", e.getMessage());
-            }
-        }
-
-    }
-
-    @Override
-    public int getOrder() {
-        return -41;
-    }
-
-    @Override
-    public void onApplicationEvent(final ApplicationContextEvent applicationContextEvent) {
-        init();
-    }
-}

+ 0 - 42
src/main/java/com/nosum/system/init/strategy/HelloBlogAuthTokenTable.java

@@ -1,42 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogAuthTokenTable implements TableInfoService {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogAuthToken());
-            log.info("初始化auth_token完成");
-        } catch (final SQLException e) {
-            log.error("初始化auth_token失败", e);
-        }
-    }
-
-    @PostConstruct
-    public void beforePropertiesSet() {
-        TableInitFactory.register("auth_token", this);
-    }
-
-    private static String createHelloBlogAuthToken() {
-        return "CREATE TABLE `auth_token`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" +
-                "  `token` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'token',\n" +
-                "  `expire_time` datetime(0) NOT NULL COMMENT '过期时间',\n" +
-                "  `user_id` bigint(20) NOT NULL COMMENT '创建人',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签表' ROW_FORMAT = Compact;";
-    }
-}

+ 0 - 50
src/main/java/com/nosum/system/init/strategy/HelloBlogAuthUserLogTable.java

@@ -1,50 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogAuthUserLogTable implements TableInfoService {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogAuthUserLog());
-            log.info("初始化auth_user_log完成");
-        } catch (final SQLException e) {
-            log.info("初始化auth_user_log失败", e);
-        }
-    }
-
-    @PostConstruct
-    public void beforePropertiesSet() throws Exception {
-        TableInitFactory.register("auth_user_log", this);
-    }
-
-    private static String createHelloBlogAuthUserLog() {
-        return "CREATE TABLE `auth_user_log` (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',\n" +
-                "  `user_id` varchar(20) NOT NULL COMMENT '记录用户id(游客取系统id:-1)',\n" +
-                "  `ip` varchar(32) NOT NULL COMMENT 'ip地址',\n" +
-                "  `url` varchar(255) NOT NULL COMMENT '请求的url',\n" +
-                "  `parameter` varchar(5000) DEFAULT NULL COMMENT '需要记录的参数',\n" +
-                "  `device` varchar(255) DEFAULT NULL COMMENT '来自于哪个设备 eg 手机 型号 电脑浏览器',\n" +
-                "  `description` varchar(255) DEFAULT NULL COMMENT '描述',\n" +
-                "  `code` varchar(10) DEFAULT NULL COMMENT '日志类型',\n" +
-                "  `run_time` bigint(20) NOT NULL COMMENT '执行时间',\n" +
-                "  `create_time` datetime NOT NULL COMMENT '创建时间',\n" +
-                "  `browser_name` varchar(100) DEFAULT NULL COMMENT '浏览器名称',\n" +
-                "  `browser_version` varchar(100) DEFAULT NULL COMMENT '浏览器版本号',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='用户行为日志记录表';";
-    }
-}

+ 0 - 47
src/main/java/com/nosum/system/init/strategy/HelloBlogAuthUserSocialTable.java

@@ -1,47 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author 青涩知夏
- */
-@Service
-@Slf4j
-public class HelloBlogAuthUserSocialTable implements TableInfoService {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogAuthUserSocial());
-            log.info("初始化auth_user_social完成");
-        } catch (final SQLException e) {
-            log.info("初始化auth_user_social失败", e);
-        }
-    }
-
-    @PostConstruct
-    public void beforePropertiesSet(){
-        TableInitFactory.register("auth_user_social", this);
-    }
-
-    private static String createHelloBlogAuthUserSocial() {
-        return "CREATE TABLE `auth_user_social` (\n" +
-                "  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',\n" +
-                "  `code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qq、csdn、wechat、weibo、email等',\n" +
-                "  `content` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '社交内容',\n" +
-                "  `show_type` smallint NOT NULL COMMENT '展示类型( 1、显示图片,2、显示账号,3、跳转链接)',\n" +
-                "  `remark` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',\n" +
-                "  `icon` varchar(100) DEFAULT NULL COMMENT '图标',\n" +
-                "  `is_enabled` smallint NOT NULL DEFAULT '0' COMMENT '是否启用',\n" +
-                "  `is_home` smallint DEFAULT '0' COMMENT '是否主页社交信息',\n" +
-                "  `create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',\n" +
-                "  `update_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户表社交信息表';";
-    }
-}

+ 0 - 50
src/main/java/com/nosum/system/init/strategy/HelloBlogAuthUserTable.java

@@ -1,50 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogAuthUserTable implements TableInfoService, InitializingBean {
-
-    private static String createHelloBlogAuthUser() {
-        return "CREATE TABLE `auth_user` (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',\n" +
-                "  `social_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '社交账户ID',\n" +
-                "  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',\n" +
-                "  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '别名',\n" +
-                "  `role_id` bigint(20) NOT NULL COMMENT '角色主键 1 普通用户 2 admin',\n" +
-                "  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱',\n" +
-                "  `introduction` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '个人简介',\n" +
-                "  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '头像',\n" +
-                "  `create_time` datetime NOT NULL COMMENT '注册时间',\n" +
-                "  `access_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ak',\n" +
-                "  `secret_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'sk',\n" +
-                "  `status` int(1) DEFAULT '0' COMMENT '0 正常 1 锁定 ',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT;";
-    }
-
-    @Override
-    public void builderTable(Statement stat) {
-        try {
-            stat.execute(createHelloBlogAuthUser());
-            log.info("初始化auth_user完成");
-        } catch (SQLException e) {
-            log.error("初始化auth_user失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("auth_user", this);
-    }
-}

+ 0 - 45
src/main/java/com/nosum/system/init/strategy/HelloBlogBlackListTable.java

@@ -1,45 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogBlackListTable implements TableInfoService {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogAuthUserLog());
-            log.info("初始化black_list完成");
-        } catch (final SQLException e) {
-            log.info("初始化black_list失败", e);
-        }
-    }
-
-    @PostConstruct
-    public void beforePropertiesSet() throws Exception {
-        TableInitFactory.register("black_list", this);
-    }
-
-    private static String createHelloBlogAuthUserLog() {
-        return "CREATE TABLE `black_list` (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',\n" +
-                "  `ip_range` varchar(150) DEFAULT NULL COMMENT 'ip范围',\n" +
-                "  `is_enable` int(1) DEFAULT '0' COMMENT '是否启用 0 启用,1不启用',\n" +
-                "  `create_user` varchar(255) DEFAULT NULL COMMENT '创建者',\n" +
-                "  `create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',\n" +
-                "  `update_user` datetime DEFAULT NULL COMMENT '更新者',\n" +
-                "  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',\n" +
-                "  PRIMARY KEY (`id`)\n" +
-                ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='黑名单拦截表'";
-    }
-}

+ 0 - 45
src/main/java/com/nosum/system/init/strategy/HelloBlogCategoryTable.java

@@ -1,45 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogCategoryTable implements TableInfoService, InitializingBean {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogCategory());
-            log.info("初始化category完成");
-        } catch (final SQLException e) {
-            log.error("初始化category失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("category", this);
-    }
-
-    private static String createHelloBlogCategory() {
-        return "CREATE TABLE `category`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" +
-                "  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称',\n" +
-                "  `sort` smallint(6) NOT NULL DEFAULT 0 COMMENT '排序',\n" +
-                "  `create_time` datetime(0) NOT NULL COMMENT '创建时间',\n" +
-                "  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',\n" +
-                "  `update_time` datetime(0) NOT NULL COMMENT '更新时间',\n" +
-                "  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;";
-    }
-}

+ 0 - 44
src/main/java/com/nosum/system/init/strategy/HelloBlogCategoryTagsTable.java

@@ -1,44 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogCategoryTagsTable implements TableInfoService, InitializingBean {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogCategoryTags());
-            log.info("初始化category_tags完成");
-        } catch (final SQLException e) {
-            log.error("初始化category_tags失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("category_tags", this);
-    }
-
-    private static String createHelloBlogCategoryTags() {
-        return "CREATE TABLE `category_tags`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" +
-                "  `tags_id` bigint(32) NOT NULL COMMENT '名称',\n" +
-                "  `category_id` bigint(20) NOT NULL COMMENT '分类的主键',\n" +
-                "  `sort` smallint(6) NOT NULL DEFAULT 0 COMMENT '排序',\n" +
-                "  `create_time` datetime(0) NOT NULL COMMENT '创建时间',\n" +
-                "  `update_time` datetime(0) NOT NULL COMMENT '更新时间',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;";
-    }
-}

+ 0 - 76
src/main/java/com/nosum/system/init/strategy/HelloBlogConfigTable.java

@@ -1,76 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogConfigTable implements TableInfoService {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogConfig());
-            stat.execute(initData());
-            log.info("初始化config完成");
-        } catch (final SQLException e) {
-            log.error("初始化config失败", e);
-        }
-    }
-
-    @PostConstruct
-    public void beforePropertiesSet() throws Exception {
-        TableInitFactory.register("config", this);
-    }
-
-    private static String createHelloBlogConfig() {
-        return "CREATE TABLE `config`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" +
-                "  `config_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置key',\n" +
-                "  `config_value` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '配置值',\n" +
-                "  `type` smallint(6) NOT NULL DEFAULT 0 COMMENT '配置类型',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE,\n" +
-                "  UNIQUE INDEX `UK_99vo6d7ci4wlxruo3gd0q2jq8`(`config_key`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;";
-    }
-
-    private static String initData() {
-        return "INSERT INTO `config` VALUES " +
-                "(1, 'name', 'helloblog', 0)," +
-                "(2, 'domain', 'http://127.0.0.1', 0)," +
-                "(3, 'keywords', 'java', 0)," +
-                "(4, 'description', 'java', 0)," +
-                "(5, 'metas', '1.1.1', 0)," +
-                "(6, 'copyright', 'Copyright @ ByteBlogs', 0)," +
-                "(7, 'icp', 'xxxx', 0)," +
-                "(8, 'qiniu_access_key', '', 1)," +
-                "(9, 'qiniu_secret_key', '', 1)," +
-                "(10, 'qiniu_bucket', '', 1)," +
-                "(11, 'qiniu_image_domain', '', 1)," +
-                "(12, 'cloud_music_id', '', 2)," +
-                "(14, 'store_type', 'default', 3)," +
-                "(15, 'aliyun_oss_access_key', '', 4)," +
-                "(16, 'aliyun_oss_secret_key', '', 4)," +
-                "(17, 'aliyun_oss_bucket', '', 4)," +
-                "(18, 'aliyun_oss_endpoint', '', 4)," +
-                "(19, 'aliyun_oss_path', '', 4)," +
-                "(20, 'aliyun_oss_image_domain', '', 4)," +
-                "(21, 'cos_access_key', '', 5)," +
-                "(22, 'cos_secret_key', '', 5)," +
-                "(23, 'cos_bucket', '', 5)," +
-                "(24, 'cos_region', '', 5)," +
-                "(25, 'cos_image_domain', '', 5)," +
-                "(26, 'cos_path', '', 5)," +
-                "(27, 'default_path', '', 6)," +
-                "(28, 'default_image_domain', 'http://127.0.0.1:8086/', 6)" +
-                ";";
-    }
-}

+ 0 - 45
src/main/java/com/nosum/system/init/strategy/HelloBlogFriendshipLinkTable.java

@@ -1,45 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogFriendshipLinkTable implements TableInfoService, InitializingBean {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogFriendshipLink());
-            log.info("初始化friendship_link完成");
-        } catch (final SQLException e) {
-            log.error("初始化friendship_link失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("friendship_link", this);
-    }
-
-    private static String createHelloBlogFriendshipLink() {
-        return "CREATE TABLE `friendship_link`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" +
-                "  `title` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '标题',\n " +
-                "  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',\n" +
-                "  `logo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件',\n" +
-                "  `href` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '跳转的路径',\n" +
-                "  `sort` smallint(6) NOT NULL DEFAULT 0 COMMENT '排序',\n" +
-                "  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '友情链接表' ROW_FORMAT = Compact;";
-    }
-}

+ 0 - 44
src/main/java/com/nosum/system/init/strategy/HelloBlogMenuTable.java

@@ -1,44 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogMenuTable implements TableInfoService, InitializingBean {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogMenu());
-            log.info("初始化menu完成");
-        } catch (final SQLException e) {
-            log.error("初始化menu失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("menu", this);
-    }
-
-    private static String createHelloBlogMenu() {
-        return "CREATE TABLE `menu` (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" +
-                "  `parent_id` bigint(20) DEFAULT '0' COMMENT '父菜单Id',\n" +
-                "  `title` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',\n" +
-                "  `icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'icon图标',\n" +
-                "  `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '跳转路径',\n" +
-                "  `sort` smallint(6) NOT NULL DEFAULT '0' COMMENT '排序',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='菜单表';";
-    }
-}

+ 0 - 41
src/main/java/com/nosum/system/init/strategy/HelloBlogPostsAttributeTable.java

@@ -1,41 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogPostsAttributeTable implements TableInfoService, InitializingBean {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogPostsAttribute());
-            log.info("初始化posts_attribute完成");
-        } catch (final SQLException e) {
-            log.error("初始化posts_attribute失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("posts_attribute", this);
-    }
-
-    private static String createHelloBlogPostsAttribute() {
-        return "CREATE TABLE `posts_attribute`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',\n" +
-                "  `content` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '内容',\n" +
-                "  `posts_id` bigint(20) NOT NULL COMMENT '文章表主键',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;";
-    }
-}

+ 0 - 46
src/main/java/com/nosum/system/init/strategy/HelloBlogPostsCommentsTable.java

@@ -1,46 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogPostsCommentsTable implements TableInfoService, InitializingBean {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogPostsComments());
-            log.info("初始化posts_comments完成");
-        } catch (final SQLException e) {
-            log.error("初始化posts_comments失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("posts_comments", this);
-    }
-
-    private static String createHelloBlogPostsComments() {
-        return "CREATE TABLE `posts_comments`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" +
-                "  `author_id` bigint(20) NOT NULL,\n" +
-                "  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,\n" +
-                "  `parent_id` bigint(20) NOT NULL DEFAULT 0,\n" +
-                "  `status` int(11) NOT NULL DEFAULT 0,\n" +
-                "  `posts_id` bigint(20) NOT NULL,\n" +
-                "  `tree_path` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '层级结构',\n" +
-                "  `create_time` datetime(0) NULL DEFAULT NULL,\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '评论表' ROW_FORMAT = Compact;";
-    }
-}

+ 0 - 52
src/main/java/com/nosum/system/init/strategy/HelloBlogPostsTable.java

@@ -1,52 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogPostsTable implements TableInfoService, InitializingBean {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogPosts());
-            log.info("初始化posts完成");
-        } catch (final SQLException e) {
-            log.error("初始化posts失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("posts", this);
-    }
-
-    private static String createHelloBlogPosts() {
-        return "CREATE TABLE `posts`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',\n" +
-                "  `author_id` bigint(255) NULL DEFAULT NULL COMMENT '文章创建人',\n" +
-                "  `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文章标题',\n" +
-                "  `thumbnail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '封面图',\n" +
-                "  `comments` int(11) NOT NULL DEFAULT 0 COMMENT '评论数',\n" +
-                "  `is_comment` smallint(6) NULL DEFAULT 1 COMMENT '是否打开评论 (0 不打开 1 打开 )',\n" +
-                "  `category_id` bigint(20) DEFAULT NULL COMMENT '分类主键',\n" +
-                "  `sync_status` smallint(6) NOT NULL DEFAULT 0 COMMENT '同步到byteblogs状态',\n" +
-                "  `status` int(11) NOT NULL DEFAULT 1 COMMENT '状态 1 草稿 2 发布',\n" +
-                "  `summary` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '摘要',\n" +
-                "  `views` int(11) NOT NULL DEFAULT 0 COMMENT '浏览次数',\n" +
-                "  `weight` int(11) NOT NULL DEFAULT 0 COMMENT '文章权重',\n" +
-                "  `create_time` datetime(0) NOT NULL COMMENT '创建时间',\n" +
-                "  `update_time` datetime(0) NOT NULL COMMENT '更新时间',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;";
-    }
-}

+ 0 - 44
src/main/java/com/nosum/system/init/strategy/HelloBlogPostsTagsTable.java

@@ -1,44 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogPostsTagsTable implements TableInfoService, InitializingBean {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogPostsTags());
-            log.info("初始化posts_tags完成");
-        } catch (final SQLException e) {
-            log.error("初始化posts_tags失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("posts_tags", this);
-    }
-
-    private static String createHelloBlogPostsTags() {
-        return "CREATE TABLE `posts_tags`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" +
-                "  `tags_id` bigint(32) NOT NULL COMMENT '名称',\n" +
-                "  `posts_id` bigint(20) NOT NULL COMMENT '文章主键',\n" +
-                "  `sort` smallint(6) NOT NULL DEFAULT 0 COMMENT '排序',\n" +
-                "  `create_time` datetime(0) NOT NULL COMMENT '创建时间',\n" +
-                "  `update_time` datetime(0) NOT NULL COMMENT '更新时间',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;";
-    }
-}

+ 0 - 46
src/main/java/com/nosum/system/init/strategy/HelloBlogTagsTable.java

@@ -1,46 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.stereotype.Service;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-@Service
-@Slf4j
-public class HelloBlogTagsTable implements TableInfoService, InitializingBean {
-
-    @Override
-    public void builderTable(final Statement stat) {
-        try {
-            stat.execute(createHelloBlogTags());
-            log.info("初始化tags完成");
-        } catch (final SQLException e) {
-            log.error("初始化tags失败", e);
-        }
-    }
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        TableInitFactory.register("tags", this);
-    }
-
-
-    private static String createHelloBlogTags() {
-        return "CREATE TABLE `tags`  (\n" +
-                "  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" +
-                "  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称',\n" +
-                "  `sort` smallint(6) NOT NULL DEFAULT 0 COMMENT '排序',\n" +
-                "  `create_time` datetime(0) NOT NULL COMMENT '创建时间',\n" +
-                "  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',\n" +
-                "  `update_time` datetime(0) NOT NULL COMMENT '更新时间',\n" +
-                "  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',\n" +
-                "  PRIMARY KEY (`id`) USING BTREE\n" +
-                ") ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签表' ROW_FORMAT = Compact;";
-    }
-}

+ 0 - 16
src/main/java/com/nosum/system/init/strategy/TableInfoService.java

@@ -1,16 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import java.sql.Statement;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-public interface TableInfoService {
-
-    /**
-     * 生成表的DDL语句
-     */
-    void builderTable(Statement stat);
-
-}

+ 0 - 23
src/main/java/com/nosum/system/init/strategy/TableInitFactory.java

@@ -1,23 +0,0 @@
-package com.nosum.system.init.strategy;
-
-import com.nosum.common.validator.annotion.NotNull;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * @author zhangshuguang
- * @date 2019/12/25
- */
-public class TableInitFactory {
-    private static final Map<String, TableInfoService> tableInfoServiceMap = new ConcurrentHashMap<>();
-
-    public static TableInfoService getByTableName(@NotNull final String tableName) {
-        return tableInfoServiceMap.get(tableName);
-    }
-
-    public static void register(@NotNull final String tableName, final TableInfoService defaultConvertService) {
-        tableInfoServiceMap.put(tableName, defaultConvertService);
-    }
-
-}

+ 3 - 2
src/main/java/com/nosum/system/interceptor/AuthenticationInterceptor.java

@@ -17,8 +17,9 @@ import javax.servlet.http.HttpServletResponse;
 import java.lang.reflect.Method;
 
 /**
- * @Author:sumbytes
- * @Date:2018/09/27 12:52
+ * 认证信息拦截器.
+ *
+ * @author Young
  */
 @Configuration
 public class AuthenticationInterceptor implements HandlerInterceptor {

+ 0 - 20
src/main/java/com/nosum/system/interceptor/BlackListInterceptor.java

@@ -1,20 +0,0 @@
-package com.nosum.system.interceptor;
-
-import org.springframework.stereotype.Component;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-
-/**
- * 黑名单拦截配置
- */
-@Component
-public class BlackListInterceptor extends HandlerInterceptorAdapter {
-    @Override
-    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-        //
-        return true;
-    }
-}

+ 3 - 2
src/main/java/com/nosum/system/interceptor/CORSInterceptor.java

@@ -7,8 +7,9 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 /**
- * @Author:sumbytes
- * @Date:2018/09/27 12:52
+ * 跨域拦截器
+ *
+ * @author Young
  */
 @Component
 public class CORSInterceptor extends HandlerInterceptorAdapter {