🔨 调整后台的代码结构,抽取脚手架自带功能至core模块,当二次开发时,在boot模块中直接开发。也可直接创建新的项目,引入admin-corejar包进行开发,方便后续跟随脚手架代码升级。

This commit is contained in:
b2baccline
2020-03-02 20:15:30 +08:00
parent daae84366a
commit a0a249239e
92 changed files with 154 additions and 147 deletions

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ballcat-admin</artifactId>
<groupId>com.hccake</groupId>
<version>0.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ballcat-admin-boot</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-admin-core</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-log</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-swagger</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-job</artifactId>
</dependency>
<!--webmvc-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!--mysql驱动-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--监控Client-->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,4 +1,4 @@
package com.hccake.ballcat.admin;
package com.your.packages.admin;
import com.hccake.ballcat.commom.log.access.annotation.EnableAccessLog;
import com.hccake.ballcat.common.job.annotation.EnableXxlJob;
@@ -14,7 +14,7 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
@EnableSwagger2Aggregator
@EnableAccessLog
@ServletComponentScan("com.hccake.ballcat.admin.oauth.filter")
@SpringBootApplication
@SpringBootApplication(scanBasePackages = {"com.hccake.ballcat.admin", "com.your.packages.admin"})
public class AdminApplication {
public static void main(String[] args) {

View File

@@ -36,7 +36,7 @@ management:
# mybatis-plus相关配置
mybatis-plus:
mapper-locations: classpath:/mapper/*/*Mapper.xml
mapper-locations: classpath*:/mapper/*/*Mapper.xml
global-config:
banner: false
db-config:

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ballcat-admin</artifactId>
<groupId>com.hccake</groupId>
<version>0.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ballcat-admin-core</artifactId>
<dependencies>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-job</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-conf</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-modules</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-log</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-storage</artifactId>
</dependency>
<!-- swagger 文档聚合 -->
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-swagger</artifactId>
</dependency>
<!-- 邮件发送 -->
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-mail</artifactId>
</dependency>
<!-- swagger 增强版 ui -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-ui</artifactId>
<version>1.9.6</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!--mybatis plus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!--redis-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- spring-security oauth -->
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -89,5 +89,6 @@ private static final long serialVersionUID = 1L;
* 更新时间
*/
@ApiModelProperty(value="更新时间")
@TableField(fill = FieldFill.UPDATE)
private LocalDateTime updateTime;
}

View File

@@ -32,7 +32,7 @@ public class MobileAuthenticationProvider implements AuthenticationProvider {
MobileAuthenticationToken mobileAuthenticationToken = (MobileAuthenticationToken) authentication;
String principal = mobileAuthenticationToken.getPrincipal().toString();
UserDetails userDetails = userDetailsService.loadUserByUsername("admin");
UserDetails userDetails = userDetailsService.loadUserByUsername("com/hccake/ballcat/admin");
if (userDetails == null) {
log.debug("Authentication failed: no credentials provided");

View File

@@ -10,92 +10,11 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>ballcat-admin</artifactId>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-job</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-conf</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-modules</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-log</artifactId>
</dependency>
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-storage</artifactId>
</dependency>
<!-- swagger 文档聚合 -->
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-swagger</artifactId>
</dependency>
<!-- swagger 增强版 ui -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-ui</artifactId>
<version>1.9.6</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!--mybatis plus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!--webmvc-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!--redis-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--mysql驱动-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- spring-security oauth -->
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
</dependency>
<!--监控Client-->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<modules>
<module>ballcat-admin-core</module>
<module>ballcat-admin-boot</module>
</modules>
</project>

View File

@@ -1,27 +0,0 @@
package com.hccake.ballcat.admin.test;
import com.hccake.ballcat.admin.modules.sys.model.converter.SysPermissionConverter;
import com.hccake.ballcat.admin.modules.sys.model.vo.PermissionVO;
import com.hccake.ballcat.admin.modules.sys.model.vo.Router;
import org.junit.Test;
/**
* @author Hccake
* @version 1.0
* @date 2019/9/19 11:42
*/
public class ConvertTest {
@Test
public void test(){
PermissionVO sysPermission = new PermissionVO();
sysPermission.setIcon("icon");
sysPermission.setCode("code");
sysPermission.setParentId(-1);
Router router = SysPermissionConverter.INSTANCE.toRouter(sysPermission);
System.out.println(router);
}
}

View File

@@ -1,29 +0,0 @@
package com.hccake.ballcat.admin.test;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hccake.ballcat.admin.modules.sys.model.entity.SysRole;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
/**
* @author Hccake
* @version 1.0
* @date 2019/9/17 9:58
*/
@SpringBootTest
public class TestUpdate {
@Test
public void test() {
Wrapper<SysRole> wrapper = Wrappers.query();
System.out.println(wrapper.getSqlSelect());
System.out.println(wrapper.getCustomSqlSegment());
System.out.println(wrapper.getExpression().getSqlSegment());
}
}

View File

@@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration;
* @date 2017/10/29
*/
@Configuration
@MapperScan("com.hccake.ballcat.**.mapper")
@MapperScan(basePackages = {"com.hccake.ballcat.**.mapper", "com.your.packages.**.mapper"})
public class MybatisPlusConfig {
/**