-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request !89 from Foming/dev
- Loading branch information
Showing
26 changed files
with
429 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
## 后端springboot | ||
|
||
### 采用redis缓存 | ||
|
||
#### 1.pom文件 | ||
```java | ||
<dependency> | ||
<groupId>com.anji-plus</groupId> | ||
<artifactId>spring-boot-gaea</artifactId> | ||
<version>2.0.5.RELEASE</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-redis</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
``` | ||
删除exclusions内容,因为底层默认支持redis | ||
删除ehcache相关依赖 | ||
|
||
#### 2.删除 package com.anjiplus.template.gaea.business.cache | ||
CacheHelper底层默认实现为RedisCacheHelper。 | ||
@ConditionalOnMissingBean 注解起到的作用 | ||
```java | ||
package com.anji.plus.gaea; | ||
|
||
@Configuration | ||
@EnableConfigurationProperties({GaeaProperties.class}) | ||
public class GaeaAutoConfiguration { | ||
@Bean | ||
@ConditionalOnClass({RedisAutoConfiguration.class}) | ||
@ConditionalOnMissingBean | ||
public CacheHelper cacheHelper() { | ||
return new RedisCacheHelper(); | ||
} | ||
} | ||
``` | ||
|
||
#### 3.bootstrap.yml加上对应的redis配置即可 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.