Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dict
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈文顺
dict
Commits
c78812d4
Commit
c78812d4
authored
Mar 19, 2019
by
陈文顺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redisson
parent
d848b58f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
144 additions
and
6 deletions
+144
-6
demo-service/pom.xml
+15
-2
demo-service/src/main/java/com/freemud/demo/util/RedisCache.java
+4
-0
pom.xml
+14
-0
springboot-demo/pom.xml
+11
-4
springboot-demo/src/main/java/com/freemud/springbootdemo/config/DataSourceConfig.java
+14
-0
springboot-demo/src/main/resources/application-pro.yml
+85
-0
springboot-demo/src/main/resources/application.yml
+1
-0
No files found.
demo-service/pom.xml
View file @
c78812d4
...
...
@@ -24,8 +24,21 @@
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
<groupId>
org.redisson
</groupId>
<artifactId>
redisson-spring-boot-starter
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.redisson
</groupId>
<artifactId>
redisson-spring-data-21
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.redisson
</groupId>
<!-- for Spring Data Redis v.1.8.x -->
<artifactId>
redisson-spring-data-18
</artifactId>
<version>
3.10.4
</version>
</dependency>
<dependency>
...
...
demo-service/src/main/java/com/freemud/demo/util/RedisCache.java
View file @
c78812d4
package
com
.
freemud
.
demo
.
util
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
...
@@ -16,6 +17,9 @@ public abstract class RedisCache<T> {
@Autowired
protected
RedisTemplate
redisTemplate
;
@Autowired
protected
RedissonClient
redissonClient
;
private
Class
<
T
>
clazz
;
public
RedisCache
()
{
...
...
pom.xml
View file @
c78812d4
...
...
@@ -30,6 +30,7 @@
<spring-cloud.version>
Edgware.SR2
</spring-cloud.version>
<mybatis3.version>
1.3.2
</mybatis3.version>
<mapper.version>
1.1.1
</mapper.version>
<elasticSearch.version>
3.1.5.RELEASE
</elasticSearch.version>
</properties>
...
...
@@ -46,6 +47,19 @@
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.7.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-elasticsearch
</artifactId>
<version>
${elasticSearch.version}
</version>
</dependency>
<dependency>
<groupId>
org.redisson
</groupId>
<artifactId>
redisson-spring-boot-starter
</artifactId>
<version>
3.10.4
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
springboot-demo/pom.xml
View file @
c78812d4
...
...
@@ -69,6 +69,11 @@
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework.data</groupId>-->
<!--<artifactId>spring-data-elasticsearch</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-sleuth
</artifactId>
...
...
@@ -78,10 +83,10 @@
<!--<groupId>org.springframework.cloud</groupId>-->
<!--<artifactId>spring-cloud-starter-eureka</artifactId>-->
<!--</dependency>-->
<
!--<dependency>--
>
<
!--<groupId>org.springframework.boot</groupId>--
>
<
!--<artifactId>spring-boot-starter-actuator</artifactId>--
>
<
!--</dependency>--
>
<
dependency
>
<
groupId>
org.springframework.boot
</groupId
>
<
artifactId>
spring-boot-starter-actuator
</artifactId
>
<
/dependency
>
<!--<dependency>-->
<!--<groupId>org.springframework.cloud</groupId>-->
<!--<artifactId>spring-cloud-starter-feign</artifactId>-->
...
...
@@ -138,6 +143,8 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
...
...
springboot-demo/src/main/java/com/freemud/springbootdemo/config/DataSourceConfig.java
View file @
c78812d4
...
...
@@ -3,16 +3,22 @@ package com.freemud.springbootdemo.config;
import
com.alibaba.druid.pool.DruidDataSource
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.core.io.Resource
;
import
javax.sql.DataSource
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* Created by chenwenshun on 2018/8/31.
...
...
@@ -29,6 +35,14 @@ public class DataSourceConfig {
.
build
();
}
// @Bean
// public DataSource dataSource2(@Value("classpath:/application.yml") Resource configFile) throws IOException{
// String result = new BufferedReader(new InputStreamReader(configFile.getInputStream()))
// .lines().collect(Collectors.joining(System.lineSeparator()));
//
// return null;
// }
...
...
springboot-demo/src/main/resources/application-pro.yml
0 → 100644
View file @
c78812d4
spring
:
application
:
name
:
dictionary
redis
:
# host: 10.20.10.212
host
:
115.159.67.166
port
:
5289
password
:
U252fnIDyfF1A1
database
:
3
datasource
:
initialize
:
false
server
:
port
:
9005
datasource
:
druid
:
url
:
jdbc:mysql://10.30.30.14:6630/dict?useUnicode=true&characterEncoding=utf8
driver-class
:
com.mysql.jdbc.Driver
username
:
yanfa
password
:
yqKjKHX.1:bv
initial-size
:
1
min-idle
:
1
max-active
:
20
test-on-borrow
:
true
filters
:
stat
datasource2
:
druid
:
url
:
jdbc:mysql://111.231.82.13:6630/dict2?useUnicode=true&characterEncoding=utf8
driver-class
:
com.mysql.jdbc.Driver
username
:
yanfa
password
:
yqKjKHX.1:bv
initial-size
:
1
min-idle
:
1
max-active
:
20
test-on-borrow
:
true
filters
:
stat
#mybatis
mybatis
:
config-location
:
classpath:mybatis.xml
mapper-locations
:
classpath:mapper/*.xml
type-aliases-package
:
com.freemud.demo.model
#dao
mapper
:
mappers
:
com.freemud.demo.util.MyMapper
not-empty
:
false
identity
:
MYSQL
# before: true
#pagehelper
pagehelper
:
helper-dialect
:
mysql
reasonable
:
true
support-methods-arguments
:
true
params
:
count=countSql
#log
logging
:
config
:
classpath:logback.xml
#security:
# user:
# name: admin
# password: admin
# ignored: /**,/swagger*,/webjars/**,/v2/**,/swagger-resources/**
swagger_enable
:
true
#eureka:
# client:
# service-url:
# defaultZone: http://localhost:10001/eureka
#apollo:
# bootstrap:
# enabled: true
# meta: http://localhost:8080
#apollo appId
#app:
# id: order_service
springboot-demo/src/main/resources/application.yml
View file @
c78812d4
...
...
@@ -2,6 +2,7 @@ spring:
application
:
name
:
dictionary
redis
:
# host: 10.20.10.212
host
:
115.159.67.166
port
:
5289
password
:
U252fnIDyfF1A1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment