diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index c52f058..50df209 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -6,9 +6,16 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index ba2b61f..14868f1 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -2,16 +2,18 @@
-
+
+
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b451d3f..baaaeec 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,11 +1,35 @@
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14,68 +38,107 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
-
-
+
+
-
-
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
+
@@ -85,34 +148,89 @@
+
+
+
+
+ 连接数据库成功
+ logger.debug
+ debug
+
+
+ info
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -122,54 +240,126 @@
true
DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -177,25 +367,21 @@
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
-
+
+
@@ -205,15 +391,22 @@
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
@@ -228,11 +421,119 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -242,13 +543,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -261,15 +639,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -282,44 +770,210 @@
1523369519463
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1538124639834
+
+
+
+ 1538124639835
+
+ 1538125752415
+
+
+
+ 1538125752416
+
+
+ 1538985188357
+
+
+
+ 1538985188357
+
+
+ 1538990996406
+
+
+
+ 1538990996406
+
+
+ 1538991026238
+
+
+
+ 1538991026238
+
+
+ 1540518013567
+
+
+
+ 1540518013567
+
+
+ 1540519922928
+
+
+
+ 1540519922928
+
+
+ 1540520118981
+
+
+
+ 1540520118981
+
+
+ 1540532620330
+
+
+
+ 1540532620330
+
+
+ 1563847387230
+
+
+
+ 1563847387230
+
+
+ 1563847739128
+
+
+
+ 1563847739128
+
+
+ 1564388782576
+
+
+
+ 1564388782576
+
+
+ 1564388890435
+
+
+
+ 1564388890435
+
+
+ 1564389259350
+
+
+
+ 1564389259350
+
+
+ 1564392588605
+
+
+
+ 1564392588605
+
+
+ 1564451293646
+
+
+
+ 1564451293646
+
+
+ 1564451836853
+
+
+
+ 1564451836853
+
+
+ 1564650595413
+
+
+
+ 1564650595413
+
+
+ 1564715769753
+
+
+
+ 1564715769753
+
+
-
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -328,271 +982,345 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/swift-framework/src/main/java/org/swift/framework/proxy/ControllerAspect.java
+ 22
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
-
-
-
+
+
+
-
+
-
-
-
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
+
-
+
-
-
+
+
+
-
+
-
+
+
-
+
-
-
-
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
+
+
-
+
+
@@ -603,10 +1331,12 @@
+ swift-web:war
+
@@ -614,7 +1344,7 @@
- No facets are configured
+ Web
@@ -626,10 +1356,11 @@
+ Maven: org.apache.commons:commons-collection4:4.0
-
+
@@ -649,12 +1380,11 @@
- swiftweb
+ swift-web
-
-
+
@@ -674,11 +1404,11 @@
- Maven: com.fasterxml.jackson.core:jackson-annotations:2.4.0
+ Maven: asm:asm:3.3.1
-
+
diff --git a/README.md b/README.md
index 2f197be..1b10db7 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# swift-framework
-this is a simple web framework。
+swift是一个轻量级的web框架,实现了 IOC、MVC、ORM、AOP、RabbitMQ 功能,并且已经可以使用,满足基本的开发需要和学习使用,适合了解spring的基本原理。
+未来将会逐步实现 安全管理 等功能。
+如果你想观看源码,可以从 org.swift.framework.mvc.DispatcherServlet类 开始阅读。
-swift是一个轻量级的web框架,实现了 IOC、MVC、ORM 功能,并且已经可以使用,满足基本的开发需要和学习使用,适合了解spring的基本原理。
-未来将会逐步实现 aop、安全管理等功能。
+源码分析在博客中有介绍,可以参考:https://www.cnblogs.com/zhaww/p/11320825.html
-如果你想观看源码,可以从 org.swift.framework.mvc.DispatcherServlet类 开始阅读。
diff --git a/swift-framework.jar b/swift-framework.jar
new file mode 100644
index 0000000..84cbada
Binary files /dev/null and b/swift-framework.jar differ
diff --git a/swift-framework/pom.xml b/swift-framework/pom.xml
index f05cfd6..7165314 100644
--- a/swift-framework/pom.xml
+++ b/swift-framework/pom.xml
@@ -102,7 +102,7 @@
com.fasterxml.jackson.core
jackson-databind
- 2.9.9.1
+ 2.9.9.2
@@ -122,6 +122,20 @@
poi-ooxml
3.11
+
+
+
+ com.rabbitmq
+ amqp-client
+ 4.8.0
+
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.60
+
\ No newline at end of file
diff --git a/swift-framework/src/main/java/org/swift/framework/annotation/RabbitEnable.java b/swift-framework/src/main/java/org/swift/framework/annotation/RabbitEnable.java
new file mode 100644
index 0000000..2be20b1
--- /dev/null
+++ b/swift-framework/src/main/java/org/swift/framework/annotation/RabbitEnable.java
@@ -0,0 +1,16 @@
+package org.swift.framework.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @Description - 类注解,确认该类时配置 mq监听的类
+ * @Author zww
+ * @Date 2019/9/12
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface RabbitEnable {
+}
diff --git a/swift-framework/src/main/java/org/swift/framework/annotation/RabbitListener.java b/swift-framework/src/main/java/org/swift/framework/annotation/RabbitListener.java
new file mode 100644
index 0000000..acfc062
--- /dev/null
+++ b/swift-framework/src/main/java/org/swift/framework/annotation/RabbitListener.java
@@ -0,0 +1,27 @@
+package org.swift.framework.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @Description - 注解在方法上,配置mq监听的详细信息
+ * @Author zww
+ * @Date 2019/9/12
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface RabbitListener {
+ /**
+ * 队列名称
+ * @return
+ */
+ String queue();
+
+ /**
+ * 交换器名称
+ * @return
+ */
+ String exchange();
+}
diff --git a/swift-framework/src/main/java/org/swift/framework/helper/AopHelper.java b/swift-framework/src/main/java/org/swift/framework/helper/AopHelper.java
index aefce3a..a11ef76 100644
--- a/swift-framework/src/main/java/org/swift/framework/helper/AopHelper.java
+++ b/swift-framework/src/main/java/org/swift/framework/helper/AopHelper.java
@@ -4,7 +4,7 @@
import org.slf4j.LoggerFactory;
import org.swift.framework.annotation.Aspect;
import org.swift.framework.annotation.Service;
-import org.swift.framework.proxy.AspecProxy;
+import org.swift.framework.proxy.AbstractAspecProxy;
import org.swift.framework.proxy.Proxy;
import org.swift.framework.proxy.ProxyManager;
import org.swift.framework.proxy.TransactionProxy;
@@ -50,7 +50,7 @@ private static Map, Set>> createProxyMap() throws Exception {
//添加切面代理
private static void addAspectProxy(Map, Set>> proxyMap) throws Exception {
- Set> proxyClassSet = ClassHelper.getClassSetBySuper(AspecProxy.class);
+ Set> proxyClassSet = ClassHelper.getClassSetBySuper(AbstractAspecProxy.class);
for (Class> proxyClass : proxyClassSet) {
if (proxyClass.isAnnotationPresent(Aspect.class)) {
Aspect aspect = proxyClass.getAnnotation(Aspect.class);
diff --git a/swift-framework/src/main/java/org/swift/framework/helper/ClassHelper.java b/swift-framework/src/main/java/org/swift/framework/helper/ClassHelper.java
index 2fbebdb..f2f9b3c 100644
--- a/swift-framework/src/main/java/org/swift/framework/helper/ClassHelper.java
+++ b/swift-framework/src/main/java/org/swift/framework/helper/ClassHelper.java
@@ -11,6 +11,7 @@
/**
* 解析包下Class文件
+ * 用来存放项目根目录下所有的类的class信息
* create by ww
**/
public class ClassHelper {
diff --git a/swift-framework/src/main/java/org/swift/framework/helper/DataBaseHelper.java b/swift-framework/src/main/java/org/swift/framework/helper/DataBaseHelper.java
index fee0e10..4490f08 100644
--- a/swift-framework/src/main/java/org/swift/framework/helper/DataBaseHelper.java
+++ b/swift-framework/src/main/java/org/swift/framework/helper/DataBaseHelper.java
@@ -22,7 +22,7 @@ public final class DataBaseHelper {
//private static Connection conn;
//apache提供的一个工具,通过反射把查询出的数据实体化
- private static final QueryRunner queryRunner;
+ private static final QueryRunner QUERY_RUNNER;
//每个线程享有独立的连接
private static final ThreadLocal CONNECTION_REGISTER;
private static final BasicDataSource DATA_SOURCE;
@@ -33,7 +33,7 @@ public final class DataBaseHelper {
private static final String PASSWORD;
static {
- queryRunner = new QueryRunner();
+ QUERY_RUNNER = new QueryRunner();
CONNECTION_REGISTER = new ThreadLocal();
DATA_SOURCE = new BasicDataSource();
@@ -155,7 +155,7 @@ public static List queryEntityList(Class entityClass, String sql, Obje
List entityList = null;
Connection conn = getConnection();
try {
- entityList = queryRunner.query(conn,sql,new BeanListHandler(entityClass),params);
+ entityList = QUERY_RUNNER.query(conn,sql,new BeanListHandler(entityClass),params);
logger.info("查询:" + sql);
} catch (SQLException e) {
e.printStackTrace();
@@ -190,7 +190,7 @@ public static T queryEntity(Class entityClass, String sql, Object... para
T entity = null;
Connection conn = getConnection();
try {
- entity = queryRunner.query(conn,sql,new BeanHandler(entityClass),params);
+ entity = QUERY_RUNNER.query(conn,sql,new BeanHandler(entityClass),params);
logger.info("查询:" + sql);
} catch (SQLException e) {
e.printStackTrace();
@@ -211,7 +211,7 @@ public static List