刘力
3 years ago
commit
77a809eb3f
17 changed files with 837 additions and 0 deletions
-
103admin/pom.xml
-
18admin/src/main/java/com/canvas/web/AdminApplication.java
-
11admin/src/main/java/com/canvas/web/controller/TestController.java
-
126admin/src/main/resources/application-dev.yml
-
0admin/src/main/resources/application-prod.yml
-
27admin/src/main/resources/application.yml
-
137common/pom.xml
-
68common/src/main/java/com/canvas/web/exception/BaseException.java
-
4common/src/main/java/com/canvas/web/exception/CustomException.java
-
4common/src/main/java/com/canvas/web/exception/user/CaptchaException.java
-
15common/src/main/java/com/canvas/web/utils/MessageUtils.java
-
56common/src/main/java/com/canvas/web/utils/SpringUtils.java
-
52generator/pom.xml
-
86pom.xml
-
35quartz/pom.xml
-
43queue/pom.xml
-
52system/pom.xml
@ -0,0 +1,103 @@ |
|||||
|
<?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>yxk_canvasScreen</artifactId> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>admin</artifactId> |
||||
|
<name>启动入口</name> |
||||
|
|
||||
|
<properties> |
||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||
|
</properties> |
||||
|
|
||||
|
|
||||
|
<!-- 依赖声明 --> |
||||
|
<dependencies> |
||||
|
<!-- 核心模块 --> |
||||
|
<dependency> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<artifactId>system</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<!-- 代码生成 --> |
||||
|
<dependency> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<artifactId>generator</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<!-- 定时任务 --> |
||||
|
<dependency> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<artifactId>quartz</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<!-- 消息队列 --> |
||||
|
<dependency> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<artifactId>queue</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.springframework.amqp</groupId> |
||||
|
<artifactId>spring-rabbit-test</artifactId> |
||||
|
<scope>test</scope> |
||||
|
</dependency> |
||||
|
<!-- 引入阿里数据库连接池 --> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>druid-spring-boot-starter</artifactId> |
||||
|
<version>1.2.8</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>log4j</groupId> |
||||
|
<artifactId>log4j</artifactId> |
||||
|
<version>1.2.17</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<pluginManagement> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
<version>2.1.11.RELEASE</version> |
||||
|
<configuration> |
||||
|
<finalName>JavaWeb_Vue</finalName> |
||||
|
</configuration> |
||||
|
<executions> |
||||
|
<execution> |
||||
|
<goals> |
||||
|
<goal>repackage</goal> |
||||
|
</goals> |
||||
|
</execution> |
||||
|
</executions> |
||||
|
</plugin> |
||||
|
|
||||
|
</plugins> |
||||
|
</pluginManagement> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
</build> |
||||
|
</project> |
@ -0,0 +1,18 @@ |
|||||
|
package com.canvas.web; |
||||
|
|
||||
|
|
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
import org.springframework.scheduling.annotation.EnableScheduling; |
||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement; |
||||
|
|
||||
|
@SpringBootApplication(scanBasePackages = {"com.canvas.*"}) |
||||
|
@EnableTransactionManagement |
||||
|
@EnableScheduling |
||||
|
public class AdminApplication { |
||||
|
|
||||
|
public static void main(String[] args){ |
||||
|
SpringApplication.run(AdminApplication.class,args); |
||||
|
System.out.println("多媒体后台管理系统启动成功!"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
package com.canvas.web.controller; |
||||
|
|
||||
|
|
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
//业务测试接口 |
||||
|
@RestController |
||||
|
@RequestMapping("/test") |
||||
|
public class TestController { |
||||
|
} |
@ -0,0 +1,126 @@ |
|||||
|
#自定义配置 |
||||
|
canvasweb: |
||||
|
image-url: https://images.canvase.com/ |
||||
|
app-debug: true |
||||
|
|
||||
|
|
||||
|
|
||||
|
spring: |
||||
|
# 配置数据源 |
||||
|
datasource: |
||||
|
# 使用阿里的Druid连接池 |
||||
|
druid: |
||||
|
db-type: com.alibaba.druid.pool.DruidDataSource |
||||
|
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy |
||||
|
url: jdbc:mysql://192.168.99.207:3306/javaweb.vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false |
||||
|
username: root |
||||
|
password: ftzn83560792 |
||||
|
|
||||
|
|
||||
|
# 连接池的配置信息 |
||||
|
# 初始连接数 |
||||
|
initialSize: 5 |
||||
|
# 最小连接池数量 |
||||
|
minIdle: 5 |
||||
|
# 最大连接池数量 |
||||
|
maxActive: 20 |
||||
|
# 配置获取连接等待超时的时间 |
||||
|
maxWait: 60000 |
||||
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
||||
|
timeBetweenEvictionRunsMillis: 60000 |
||||
|
# 配置一个连接在池中最小生存的时间,单位是毫秒 |
||||
|
minEvictableIdleTimeMillis: 300000 |
||||
|
# 配置一个连接在池中最大生存的时间,单位是毫秒 |
||||
|
maxEvictableIdleTimeMillis: 900000 |
||||
|
# 配置检测连接是否有效 |
||||
|
validationQuery: SELECT 1 FROM DUAL |
||||
|
testWhileIdle: true |
||||
|
testOnBorrow: false |
||||
|
testOnReturn: false |
||||
|
# 打开PSCache,并且指定每个连接上PSCache的大小 |
||||
|
poolPreparedStatements: true |
||||
|
maxPoolPreparedStatementPerConnectionSize: 20 |
||||
|
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 |
||||
|
filters: stat,wall,log4j |
||||
|
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录 |
||||
|
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 |
||||
|
# 配置DruidStatFilter |
||||
|
webStatFilter: |
||||
|
enabled: true |
||||
|
url-pattern: "/*" |
||||
|
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" |
||||
|
# 配置DruidStatViewServlet |
||||
|
statViewServlet: |
||||
|
url-pattern: "/druid/*" |
||||
|
# IP白名单(没有配置或者为空,则允许所有访问) |
||||
|
allow: 127.0.0.1,192.168.163.1 |
||||
|
# IP黑名单 (存在共同时,deny优先于allow) |
||||
|
deny: 192.168.1.73 |
||||
|
# 禁用HTML页面上的“Reset All”功能 |
||||
|
reset-enable: false |
||||
|
# 登录名 |
||||
|
login-username: admin |
||||
|
# 登录密码 |
||||
|
login-password: 123456 |
||||
|
|
||||
|
# Redis数据源 |
||||
|
redis: |
||||
|
# 缓存库默认索引0 |
||||
|
database: 0 |
||||
|
# Redis服务器地址 |
||||
|
host: 127.0.0.1 |
||||
|
# Redis服务器连接端口 |
||||
|
port: 6379 |
||||
|
# Redis服务器连接密码(默认为空) |
||||
|
password: |
||||
|
# 连接超时时间(毫秒) |
||||
|
timeout: 6000 |
||||
|
# 默认的数据过期时间,主要用于shiro权限管理 |
||||
|
expire: 2592000 |
||||
|
jedis: |
||||
|
pool: |
||||
|
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) |
||||
|
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) |
||||
|
max-idle: 10 # 连接池中的最大空闲连接 |
||||
|
min-idle: 1 # 连接池中的最小空闲连接 |
||||
|
|
||||
|
file: |
||||
|
#上传的服务器上的映射文件夹 |
||||
|
accessPath: /uploads/ |
||||
|
#静态资源对外暴露的访问路径 |
||||
|
staticAccessPath: /** |
||||
|
#静态资源实际存储路径 |
||||
|
uploadFolder: E:\JavaWeb_Vue\JavaWeb\uploads\ |
||||
|
|
||||
|
|
||||
|
# Shiro |
||||
|
shiro: |
||||
|
cipher-key: f/SX5TIve5WWzT4aQlABJA== |
||||
|
cookie-name: shiro-cookie2 |
||||
|
user: |
||||
|
# 登录地址 |
||||
|
loginUrl: /login |
||||
|
# 权限认证失败地址 |
||||
|
unauthorizedUrl: /unauth |
||||
|
# 首页地址 |
||||
|
indexUrl: /index |
||||
|
# 验证码开关 |
||||
|
captchaEnabled: true |
||||
|
# 验证码类型 math 数组计算 char 字符 |
||||
|
captchaType: math |
||||
|
cookie: |
||||
|
# 设置Cookie的域名 默认空,即当前访问的域名 |
||||
|
domain: |
||||
|
# 设置cookie的有效访问路径 |
||||
|
path: / |
||||
|
# 设置HttpOnly属性 |
||||
|
httpOnly: true |
||||
|
# 设置Cookie的过期时间,天为单位 |
||||
|
maxAge: 30 |
||||
|
session: |
||||
|
# Session超时时间(默认30分钟) |
||||
|
expireTime: 300 |
||||
|
# 同步session到数据库的周期(默认1分钟) |
||||
|
dbSyncPeriod: 1 |
||||
|
# 相隔多久检查一次session的有效性,默认就是10分钟 |
||||
|
validationInterval: 10 |
@ -0,0 +1,27 @@ |
|||||
|
server: |
||||
|
port: 9030 |
||||
|
servlet: |
||||
|
context-path: /api |
||||
|
|
||||
|
spring: |
||||
|
profiles: |
||||
|
active: dev |
||||
|
|
||||
|
#配置 Jpa |
||||
|
jpa: |
||||
|
properties: |
||||
|
hibernate: |
||||
|
ddl-auto: none |
||||
|
open-in-view: true |
||||
|
|
||||
|
|
||||
|
task: |
||||
|
pool: |
||||
|
# 核心线程池大小 |
||||
|
core-pool-size: 10 |
||||
|
# 最大线程数 |
||||
|
max-pool-size: 30 |
||||
|
# 活跃时间 |
||||
|
keep-alive-seconds: 60 |
||||
|
# 队列容量 |
||||
|
queue-capacity: 50 |
@ -0,0 +1,137 @@ |
|||||
|
<?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>yxk_canvasScreen</artifactId> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>common</artifactId> |
||||
|
<name>公共模块</name> |
||||
|
|
||||
|
<properties> |
||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||
|
</properties> |
||||
|
|
||||
|
<!-- 依赖声明 --> |
||||
|
<dependencies> |
||||
|
<!--Spring boot 核心--> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId> |
||||
|
</dependency> |
||||
|
<!-- WEB 模块依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-web</artifactId> |
||||
|
</dependency> |
||||
|
<!-- Redis 起始依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-data-redis-reactive</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>fastjson</artifactId> |
||||
|
<version>1.2.79</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.apache.commons</groupId> |
||||
|
<artifactId>commons-lang3</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>commons-io</groupId> |
||||
|
<artifactId>commons-io</artifactId> |
||||
|
<version>20030203.000550</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-aop</artifactId> |
||||
|
</dependency> |
||||
|
<!-- UserAgent工具类 --> |
||||
|
<dependency> |
||||
|
<groupId>eu.bitwalker</groupId> |
||||
|
<artifactId>UserAgentUtils</artifactId> |
||||
|
<version>1.21</version> |
||||
|
</dependency> |
||||
|
<!-- Excel依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>easyexcel</artifactId> |
||||
|
<version>3.0.5</version> |
||||
|
</dependency> |
||||
|
<!-- 文件上传 --> |
||||
|
<dependency> |
||||
|
<groupId>commons-fileupload</groupId> |
||||
|
<artifactId>commons-fileupload</artifactId> |
||||
|
<version>1.4</version> |
||||
|
</dependency> |
||||
|
<!-- 阿里短信SDK --> |
||||
|
<dependency> |
||||
|
<groupId>com.aliyun</groupId> |
||||
|
<artifactId>aliyun-java-sdk-core</artifactId> |
||||
|
<version>4.5.30</version> |
||||
|
</dependency> |
||||
|
<!-- 邮件发送起始依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-mail</artifactId> |
||||
|
</dependency> |
||||
|
<!-- thymeleaf 模板引擎依赖(如:模板邮件) --> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-thymeleaf</artifactId> |
||||
|
</dependency> |
||||
|
<!-- 极光推送 --> |
||||
|
<dependency> |
||||
|
<groupId>cn.jpush.api</groupId> |
||||
|
<artifactId>jpush-client</artifactId> |
||||
|
<version>3.5.5</version> |
||||
|
</dependency> |
||||
|
<!-- 文件压缩、解压缩 --> |
||||
|
<dependency> |
||||
|
<groupId>org.apache.commons</groupId> |
||||
|
<artifactId>commons-compress</artifactId> |
||||
|
<version>1.21</version> |
||||
|
</dependency> |
||||
|
<!-- JWT依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>io.jsonwebtoken</groupId> |
||||
|
<artifactId>jjwt</artifactId> |
||||
|
<version>0.9.1</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.auth0</groupId> |
||||
|
<artifactId>java-jwt</artifactId> |
||||
|
<version>3.18.2</version> |
||||
|
</dependency> |
||||
|
<!-- 二维码生成依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>com.google.zxing</groupId> |
||||
|
<artifactId>core</artifactId> |
||||
|
<version>3.4.1</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.google.zxing</groupId> |
||||
|
<artifactId>javase</artifactId> |
||||
|
<version>3.4.1</version> |
||||
|
</dependency> |
||||
|
<!-- MySql驱动 --> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,68 @@ |
|||||
|
package com.canvas.web.exception; |
||||
|
|
||||
|
|
||||
|
import com.canvas.web.utils.MessageUtils; |
||||
|
import org.springframework.util.StringUtils; |
||||
|
|
||||
|
//异常基础类 |
||||
|
public class BaseException extends RuntimeException { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
|
||||
|
//所属模块 |
||||
|
private String module; |
||||
|
|
||||
|
//错误码 |
||||
|
private String code; |
||||
|
|
||||
|
//错误消息 |
||||
|
private Object[] args; |
||||
|
|
||||
|
//错误消息 |
||||
|
private String defaultMessage; |
||||
|
|
||||
|
|
||||
|
public BaseException(String module, String code, Object[] args, String defaultMessage) { |
||||
|
this.module = module; |
||||
|
this.code = code; |
||||
|
this.args = args; |
||||
|
this.defaultMessage = defaultMessage; |
||||
|
} |
||||
|
|
||||
|
public BaseException(String module, String code, Object[] args) { |
||||
|
this(module, code, args, null); |
||||
|
} |
||||
|
|
||||
|
public BaseException(String module, String defaultMessage) { |
||||
|
this(module, null, null, defaultMessage); |
||||
|
} |
||||
|
|
||||
|
public BaseException(String code, Object[] args) { |
||||
|
this(null, code, args, null); |
||||
|
} |
||||
|
|
||||
|
public BaseException(String defaultMessage){ |
||||
|
this(null,null,null,defaultMessage); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getMessage(){ |
||||
|
String message=null; |
||||
|
if (!StringUtils.hasLength(code)){ |
||||
|
message= MessageUtils.message(code,args); |
||||
|
} |
||||
|
if (message==null){ |
||||
|
message=defaultMessage; |
||||
|
} |
||||
|
return message; |
||||
|
} |
||||
|
|
||||
|
public String getModule() {return module;} |
||||
|
|
||||
|
public String getCode() {return code;} |
||||
|
|
||||
|
public Object[] getArgs() {return args;} |
||||
|
|
||||
|
public String getDefaultMessage() {return defaultMessage;} |
||||
|
} |
@ -0,0 +1,4 @@ |
|||||
|
package com.canvas.web.exception; |
||||
|
|
||||
|
public class CustomException { |
||||
|
} |
@ -0,0 +1,4 @@ |
|||||
|
package com.canvas.web.exception.user; |
||||
|
|
||||
|
public class CaptchaException { |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.canvas.web.utils; |
||||
|
|
||||
|
|
||||
|
import org.springframework.context.MessageSource; |
||||
|
import org.springframework.context.i18n.LocaleContextHolder; |
||||
|
|
||||
|
public class MessageUtils { |
||||
|
|
||||
|
|
||||
|
//根据消息键和参数 获取消息 委托给spring messageSource |
||||
|
public static String message(String code, Object... args) { |
||||
|
MessageSource messageSource = SpringUtils.getBean(MessageSource.class); |
||||
|
return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); |
||||
|
} |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package com.canvas.web.utils; |
||||
|
|
||||
|
import org.springframework.aop.framework.AopContext; |
||||
|
import org.springframework.beans.BeansException; |
||||
|
import org.springframework.beans.factory.NoSuchBeanDefinitionException; |
||||
|
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; |
||||
|
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
|
||||
|
@Component |
||||
|
public class SpringUtils implements BeanFactoryPostProcessor { |
||||
|
|
||||
|
|
||||
|
//Spring 应用上下文环境 |
||||
|
private static ConfigurableListableBeanFactory beanFactory; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { |
||||
|
SpringUtils.beanFactory = beanFactory; |
||||
|
} |
||||
|
|
||||
|
//获取对象 |
||||
|
public static <T> T getBean(String name) throws BeansException { |
||||
|
return (T) beanFactory.getBean(name); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//获取类型为requiredType对象 |
||||
|
public static <T> T getBean(Class<T> clz) throws BeansException { |
||||
|
T result = (T) beanFactory.getBean(clz); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
//判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException) |
||||
|
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException { |
||||
|
return beanFactory.isSingleton(name); |
||||
|
} |
||||
|
|
||||
|
//Class 注册对象的类型 |
||||
|
public static Class<?> getType(String name) throws NoSuchBeanDefinitionException { |
||||
|
return beanFactory.getType(name); |
||||
|
} |
||||
|
|
||||
|
//如果给定的bean名字在bean定义中有别名,则返回这些别名 |
||||
|
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException { |
||||
|
return beanFactory.getAliases(name); |
||||
|
} |
||||
|
|
||||
|
//获取aop代理对象 |
||||
|
@SuppressWarnings("unchecked") |
||||
|
public static <T> T getAopProxy(T invoker) { |
||||
|
return (T) AopContext.currentProxy(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
<?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>yxk_canvasScreen</artifactId> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>generator</artifactId> |
||||
|
<name>代码生成</name> |
||||
|
|
||||
|
<properties> |
||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||
|
</properties> |
||||
|
|
||||
|
<!-- 依赖声明 --> |
||||
|
<dependencies> |
||||
|
<!-- 基础依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<artifactId>common</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<!-- MySql驱动 --> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
</dependency> |
||||
|
<!--mybatis-plus 代码自动生成 --> |
||||
|
<dependency> |
||||
|
<groupId>com.baomidou</groupId> |
||||
|
<artifactId>mybatis-plus-generator</artifactId> |
||||
|
<version>3.2.0</version> |
||||
|
</dependency> |
||||
|
<!-- freemarker模板引擎依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>org.freemarker</groupId> |
||||
|
<artifactId>freemarker</artifactId> |
||||
|
<version>2.3.28</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</project> |
@ -0,0 +1,86 @@ |
|||||
|
<?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"> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<parent> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-parent</artifactId> |
||||
|
<version>2.6.2</version> |
||||
|
<relativePath/> <!-- 始终从仓库获取 --> |
||||
|
</parent> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<artifactId>yxk_canvasScreen</artifactId> |
||||
|
<packaging>pom</packaging> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
<modules> |
||||
|
<module>admin</module> |
||||
|
<module>common</module> |
||||
|
<module>generator</module> |
||||
|
<module>quartz</module> |
||||
|
<module>queue</module> |
||||
|
<module>system</module> |
||||
|
</modules> |
||||
|
|
||||
|
<name>多媒体后台管理系统</name> |
||||
|
|
||||
|
<properties> |
||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||
|
<!-- 表示打包时跳过mvn test --> |
||||
|
<maven.test.skip>true</maven.test.skip> |
||||
|
<!--全局配置项目版本号--> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</properties> |
||||
|
|
||||
|
<dependencyManagement> |
||||
|
<dependencies> |
||||
|
<!-- 子模块依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>com.javaweb</groupId> |
||||
|
<artifactId>javaweb-common</artifactId> |
||||
|
<version>${version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.javaweb</groupId> |
||||
|
<artifactId>javaweb-generator</artifactId> |
||||
|
<version>${version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.javaweb</groupId> |
||||
|
<artifactId>javaweb-system</artifactId> |
||||
|
<version>${version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.javaweb</groupId> |
||||
|
<artifactId>javaweb-admin</artifactId> |
||||
|
<version>${version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.javaweb</groupId> |
||||
|
<artifactId>javaweb-quartz</artifactId> |
||||
|
<version>${version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.javaweb</groupId> |
||||
|
<artifactId>javaweb-queue</artifactId> |
||||
|
<version>${version}</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- 第三方依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<version>1.18.10</version> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>fastjson</artifactId> |
||||
|
<version>1.2.62</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</dependencyManagement> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,35 @@ |
|||||
|
<?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>yxk_canvasScreen</artifactId> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>quartz</artifactId> |
||||
|
<name>定时任务</name> |
||||
|
|
||||
|
<properties> |
||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||
|
</properties> |
||||
|
|
||||
|
<!-- 依赖声明 --> |
||||
|
<dependencies> |
||||
|
<!-- 基础依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<artifactId>common</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,43 @@ |
|||||
|
<?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>yxk_canvasScreen</artifactId> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>queue</artifactId> |
||||
|
<name>消息队列</name> |
||||
|
|
||||
|
<properties> |
||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||
|
</properties> |
||||
|
|
||||
|
<!-- 依赖声明 --> |
||||
|
<dependencies> |
||||
|
<!-- 基础依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<artifactId>common</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-activemq</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-amqp</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,52 @@ |
|||||
|
<?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>yxk_canvasScreen</artifactId> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>system</artifactId> |
||||
|
<name>系统模块</name> |
||||
|
|
||||
|
<properties> |
||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||
|
</properties> |
||||
|
|
||||
|
<!-- 依赖声明 --> |
||||
|
<dependencies> |
||||
|
<!-- 引入子模块依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>com.canvas.web</groupId> |
||||
|
<artifactId>common</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<!-- Shiro 核心依赖 --> |
||||
|
<dependency> |
||||
|
<groupId>org.apache.shiro</groupId> |
||||
|
<artifactId>shiro-spring</artifactId> |
||||
|
<version>1.7.1</version> |
||||
|
</dependency> |
||||
|
<!-- Shiro-redis插件 --> |
||||
|
<dependency> |
||||
|
<groupId>org.crazycake</groupId> |
||||
|
<artifactId>shiro-redis</artifactId> |
||||
|
<version>3.3.1</version> |
||||
|
</dependency> |
||||
|
<!-- 引入阿里数据库连接池 --> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>druid-spring-boot-starter</artifactId> |
||||
|
<version>1.2.8</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue