Skip to content

Commit 8764224

Browse files
author
王浩彬
committed
[Feature] 升级2.2版本
1、加入消息总线 2、加入缓存模块
1 parent 0c14096 commit 8764224

File tree

66 files changed

+939
-651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+939
-651
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ recommend that a file or class name and description of purpose be included on
176176
the same "printed page" as the copyright notice for easier identification within
177177
third-party archives.
178178

179-
Copyright 2017 Mr.AG
179+
Copyright 2017 WangHaoBin
180180

181181
Licensed under the Apache License, Version 2.0 (the "License");
182182
you may not use this file except in compliance with the License.

README.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ AG-Admin是国内首个基于`Spring Cloud`微`服务`化`开发平台`,具有
66
- 课程地址:
77
http://edu.csdn.net/course/detail/5840
88

9-
QQ群号:169824183
9+
### QQ群号:169824183
10+
11+
## AG线上最新体验地址,感谢【[千铭云](https://www.chanmir.com/?u=45433C)】赞助的服务器。
12+
13+
http://43.248.136.159:9999/
14+
15+
## [老A专属优惠链接](https://www.chanmir.com/?u=45433C),优惠卷:2B3158
1016

1117
![img](http://upload-images.jianshu.io/upload_images/5700335-002735d1727ec11b.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1218

@@ -15,6 +21,13 @@ QQ群号:169824183
1521

1622
---------
1723

24+
# 更新日志
25+
### 2017年11月17日 v2.2-SNARSHOT
26+
27+
- ace-admin集成`ace-cache`
28+
- ace-auth集成`rabbitmq`
29+
30+
1831
# 模块说明
1932
![img](http://upload-images.jianshu.io/upload_images/5700335-5ceb4c68e4080107.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2033

@@ -38,14 +51,14 @@ QQ群号:169824183
3851
下载完后端代码后,记得先安装`lombok插件`,否则你的IDE会报代码缺失。
3952
## 后端工程启动
4053
### 环境须知
41-
- mysql数据库一个,redis数据库一个
54+
- mysql一个,redis一个,rabbitmq一个
4255
- jdk1.8
4356
- IDE插件一个,`lombok插件`,具体百度即可
4457

4558
### 运行步骤
4659
- 运行数据库脚本:依次运行数据库:ace-admin/db/init.sql、ace-auth-server/db/init.sql
4760
- 修改配置数据库配置:ace-admin/src/main/resources/application.yml、ace-gate/src/main/resources/application.yml
48-
- 依次运行main类:CenterBootstrap(ace-center)、ConfigServerBootstrap(ace-config)、GateBootstrap(ace-gate)、AdminBootstrap(ace-admin)、AuthBootstrap(ace-auth-server)
61+
- `顺序`运行main类:CenterBootstrap(ace-center)、ConfigServerBootstrap(ace-config)、AdminBootstrap(ace-admin)、AuthBootstrap(ace-auth-server)、GateBootstrap(ace-gate
4962

5063
### 项目结构
5164
```

ace-admin/pom.xml

+29-24
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@
157157
<artifactId>ace-auth-client</artifactId>
158158
<version>1.0-SNAPSHOT</version>
159159
</dependency>
160+
<dependency>
161+
<groupId>com.github.wxiaoqi</groupId>
162+
<artifactId>ace-cache</artifactId>
163+
<version>0.0.2</version>
164+
</dependency>
160165
</dependencies>
161166
<build>
162167
<finalName>ace-admin</finalName>
@@ -197,30 +202,30 @@
197202
<target>1.8</target>
198203
</configuration>
199204
</plugin>
200-
<!--<plugin>-->
201-
<!--<groupId>com.spotify</groupId>-->
202-
<!--<artifactId>docker-maven-plugin</artifactId>-->
203-
<!--<version>${docker.plugin.version}</version>-->
204-
<!--<executions>-->
205-
<!--<execution>-->
206-
<!--<phase>package</phase>-->
207-
<!--<goals>-->
208-
<!--<goal>build</goal>-->
209-
<!--</goals>-->
210-
<!--</execution>-->
211-
<!--</executions>-->
212-
<!--<configuration>-->
213-
<!--<imageName>${docker.image.prefix}/${project.artifactId}</imageName>-->
214-
<!--<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>-->
215-
<!--<resources>-->
216-
<!--<resource>-->
217-
<!--<targetPath>/</targetPath>-->
218-
<!--<directory>${project.build.directory}</directory>-->
219-
<!--<include>${project.build.finalName}.jar</include>-->
220-
<!--</resource>-->
221-
<!--</resources>-->
222-
<!--</configuration>-->
223-
<!--</plugin>-->
205+
<plugin>
206+
<groupId>com.spotify</groupId>
207+
<artifactId>docker-maven-plugin</artifactId>
208+
<version>${docker.plugin.version}</version>
209+
<executions>
210+
<execution>
211+
<phase>package</phase>
212+
<goals>
213+
<goal>build</goal>
214+
</goals>
215+
</execution>
216+
</executions>
217+
<configuration>
218+
<imageName>${docker.image.prefix}/${project.build.finalName}</imageName>
219+
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
220+
<resources>
221+
<resource>
222+
<targetPath>/</targetPath>
223+
<directory>${project.build.directory}</directory>
224+
<include>${project.build.finalName}.jar</include>
225+
</resource>
226+
</resources>
227+
</configuration>
228+
</plugin>
224229
</plugins>
225230
</build>
226231
</project>

ace-admin/src/main/java/com/github/wxiaoqi/security/admin/AdminBootstrap.java

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.github.wxiaoqi.security.admin;
22

3+
import com.ace.cache.EnableAceCache;
34
import com.github.wxiaoqi.security.auth.client.EnableAceAuthClient;
45
import org.springframework.boot.autoconfigure.SpringBootApplication;
56
import org.springframework.boot.builder.SpringApplicationBuilder;
@@ -8,6 +9,7 @@
89
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
910
import org.springframework.cloud.netflix.feign.EnableFeignClients;
1011
import org.springframework.scheduling.annotation.EnableScheduling;
12+
import org.springframework.transaction.annotation.EnableTransactionManagement;
1113

1214
/**
1315
* ${DESCRIPTION}
@@ -22,6 +24,8 @@
2224
@EnableScheduling
2325
@EnableAceAuthClient
2426
@ServletComponentScan("com.github.wxiaoqi.security.admin.config.druid")
27+
@EnableAceCache
28+
@EnableTransactionManagement
2529
public class AdminBootstrap {
2630
public static void main(String[] args) {
2731
new SpringApplicationBuilder(AdminBootstrap.class).web(true).run(args); }

ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/ElementBiz.java

+23
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.github.wxiaoqi.security.admin.biz;
22

3+
import com.ace.cache.annotation.Cache;
4+
import com.ace.cache.annotation.CacheClear;
35
import com.github.wxiaoqi.security.admin.entity.Element;
46
import com.github.wxiaoqi.security.admin.mapper.ElementMapper;
57
import com.github.wxiaoqi.security.common.biz.BaseBiz;
68
import org.springframework.stereotype.Service;
9+
import org.springframework.transaction.annotation.Transactional;
710

811
import java.util.List;
912

@@ -14,11 +17,31 @@
1417
* @create 2017-06-23 20:27
1518
*/
1619
@Service
20+
@Transactional(rollbackFor = Exception.class)
1721
public class ElementBiz extends BaseBiz<ElementMapper,Element> {
22+
@Cache(key="permission:ele:u{1}")
1823
public List<Element> getAuthorityElementByUserId(String userId){
1924
return mapper.selectAuthorityElementByUserId(userId);
2025
}
2126
public List<Element> getAuthorityElementByUserId(String userId,String menuId){
2227
return mapper.selectAuthorityMenuElementByUserId(userId,menuId);
2328
}
29+
30+
@Override
31+
@Cache(key="permission:ele")
32+
public List<Element> selectListAll() {
33+
return super.selectListAll();
34+
}
35+
36+
@Override
37+
@CacheClear(keys={"permission:ele","permission"})
38+
public void insertSelective(Element entity) {
39+
super.insertSelective(entity);
40+
}
41+
42+
@Override
43+
@CacheClear(keys={"permission:ele","permission"})
44+
public void updateSelectiveById(Element entity) {
45+
super.updateSelectiveById(entity);
46+
}
2447
}

ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/GateLogBiz.java

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.github.wxiaoqi.security.admin.mapper.GateLogMapper;
55
import com.github.wxiaoqi.security.common.biz.BaseBiz;
66
import org.springframework.stereotype.Service;
7+
import org.springframework.transaction.annotation.Transactional;
78

89
/**
910
* ${DESCRIPTION}
@@ -12,6 +13,7 @@
1213
* @create 2017-07-01 14:36
1314
*/
1415
@Service
16+
@Transactional(rollbackFor = Exception.class)
1517
public class GateLogBiz extends BaseBiz<GateLogMapper,GateLog> {
1618

1719
@Override

0 commit comments

Comments
 (0)