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
c09af56b
Commit
c09af56b
authored
Dec 11, 2018
by
陈文顺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
springCloud fengin
parent
477ac5bc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
7 deletions
+25
-7
demo-service/src/main/java/com/freemud/demo/cache/DictRedisCache.java
+1
-1
demo-service/src/main/java/com/freemud/demo/cache/DictRedisHashCache.java
+1
-1
demo-service/src/main/java/com/freemud/demo/util/RedisHashCache.java
+3
-3
springboot-demo/pom.xml
+13
-0
springboot-demo/src/main/java/com/freemud/springbootdemo/SpringbootDemoApplication.java
+2
-0
springboot-demo/src/main/java/com/freemud/springbootdemo/controller/DictController.java
+1
-1
springboot-demo/src/main/resources/application.yml
+4
-1
No files found.
demo-service/src/main/java/com/freemud/demo/cache/DictRedisCache.java
View file @
c09af56b
...
@@ -55,7 +55,7 @@ public class DictRedisCache extends RedisCache<DictTypeDto> {
...
@@ -55,7 +55,7 @@ public class DictRedisCache extends RedisCache<DictTypeDto> {
@Override
@Override
public
int
getExp
ri
e
()
{
public
int
getExp
ir
e
()
{
return
24
;
//24小时
return
24
;
//24小时
}
}
...
...
demo-service/src/main/java/com/freemud/demo/cache/DictRedisHashCache.java
View file @
c09af56b
...
@@ -51,7 +51,7 @@ public class DictRedisHashCache extends RedisHashCache<DictDataDto>{
...
@@ -51,7 +51,7 @@ public class DictRedisHashCache extends RedisHashCache<DictDataDto>{
}
}
@Override
@Override
public
int
getExp
ri
e
()
{
public
int
getExp
ir
e
()
{
return
24
;
return
24
;
}
}
}
}
demo-service/src/main/java/com/freemud/demo/util/RedisHashCache.java
View file @
c09af56b
...
@@ -50,7 +50,7 @@ public abstract class RedisHashCache<T> {
...
@@ -50,7 +50,7 @@ public abstract class RedisHashCache<T> {
}
else
{
}
else
{
redisTemplate
.
boundHashOps
(
getRedisKey
(
key
)).
putAll
(
map
);
redisTemplate
.
boundHashOps
(
getRedisKey
(
key
)).
putAll
(
map
);
}
}
redisTemplate
.
expire
(
getRedisKey
(
key
),
getExpri
e
(),
TimeUnit
.
HOURS
);
redisTemplate
.
expire
(
getRedisKey
(
key
),
getExpir
e
(),
TimeUnit
.
HOURS
);
result
=
(
T
)
redisTemplate
.
boundHashOps
(
getRedisKey
(
key
)).
get
(
filed
);
result
=
(
T
)
redisTemplate
.
boundHashOps
(
getRedisKey
(
key
)).
get
(
filed
);
...
@@ -78,7 +78,7 @@ public abstract class RedisHashCache<T> {
...
@@ -78,7 +78,7 @@ public abstract class RedisHashCache<T> {
}
else
{
}
else
{
redisTemplate
.
boundHashOps
(
getRedisKey
(
key
)).
putAll
(
map
);
redisTemplate
.
boundHashOps
(
getRedisKey
(
key
)).
putAll
(
map
);
redisTemplate
.
expire
(
getRedisKey
(
key
),
getExpri
e
(),
TimeUnit
.
HOURS
);
redisTemplate
.
expire
(
getRedisKey
(
key
),
getExpir
e
(),
TimeUnit
.
HOURS
);
}
}
result
=
(
Map
<
String
,
T
>)
redisTemplate
.
boundHashOps
(
getRedisKey
(
key
)).
entries
();
result
=
(
Map
<
String
,
T
>)
redisTemplate
.
boundHashOps
(
getRedisKey
(
key
)).
entries
();
...
@@ -102,7 +102,7 @@ public abstract class RedisHashCache<T> {
...
@@ -102,7 +102,7 @@ public abstract class RedisHashCache<T> {
public
abstract
Map
<
String
,
T
>
searchDB
(
Object
key
);
public
abstract
Map
<
String
,
T
>
searchDB
(
Object
key
);
public
abstract
int
getExp
ri
e
();
public
abstract
int
getExp
ir
e
();
private
String
getRedisKey
(
Object
key
){
private
String
getRedisKey
(
Object
key
){
...
...
springboot-demo/pom.xml
View file @
c09af56b
...
@@ -75,6 +75,19 @@
...
@@ -75,6 +75,19 @@
</dependency>
</dependency>
<dependency>
<dependency>
<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.cloud
</groupId>
<artifactId>
spring-cloud-starter-feign
</artifactId>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
${mybatis3.version}
</version>
<version>
${mybatis3.version}
</version>
...
...
springboot-demo/src/main/java/com/freemud/springbootdemo/SpringbootDemoApplication.java
View file @
c09af56b
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.support.spring.FastJsonpHttpMessageConverter4;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.support.spring.FastJsonpHttpMessageConverter4;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.HttpMessageConverter
;
...
@@ -11,6 +12,7 @@ import org.springframework.http.converter.HttpMessageConverter;
...
@@ -11,6 +12,7 @@ import org.springframework.http.converter.HttpMessageConverter;
@SpringBootApplication
@SpringBootApplication
@ComponentScan
(
basePackages
=
"com.freemud, cn.freemud"
)
@ComponentScan
(
basePackages
=
"com.freemud, cn.freemud"
)
@MapperScan
(
basePackages
=
"com.freemud.demo.mapper"
)
@MapperScan
(
basePackages
=
"com.freemud.demo.mapper"
)
@EnableEurekaClient
public
class
SpringbootDemoApplication
{
public
class
SpringbootDemoApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
springboot-demo/src/main/java/com/freemud/springbootdemo/controller/DictController.java
View file @
c09af56b
...
@@ -40,7 +40,7 @@ public class DictController {
...
@@ -40,7 +40,7 @@ public class DictController {
@GetMapping
(
"/dictData/{dictTypeCd}/{dictCd}"
)
@GetMapping
(
"/dictData/{dictTypeCd}/{dictCd}"
)
public
ResDto
<
DictDataDto
>
dictData
(
@PathVariable
String
dictTypeCd
,
@PathVariable
String
dictCd
){
public
ResDto
<
DictDataDto
>
dictData
(
@PathVariable
String
dictTypeCd
,
@PathVariable
String
dictCd
){
DictDataDto
dictDataDto
=
this
.
dictTypeService
.
loadDictDataByCd
(
dictTypeCd
,
dictCd
,
true
);
DictDataDto
dictDataDto
=
this
.
dictTypeService
.
loadDictDataByCd
(
dictTypeCd
,
dictCd
,
true
);
return
new
ResDto
<>
(
dictDataDto
);
return
new
ResDto
(
dictDataDto
);
}
}
...
...
springboot-demo/src/main/resources/application.yml
View file @
c09af56b
...
@@ -6,7 +6,6 @@ spring:
...
@@ -6,7 +6,6 @@ spring:
port
:
5289
port
:
5289
password
:
U252fnIDyfF1A1
password
:
U252fnIDyfF1A1
database
:
3
database
:
3
server
:
server
:
port
:
9005
port
:
9005
datasource
:
datasource
:
...
@@ -55,5 +54,9 @@ logging:
...
@@ -55,5 +54,9 @@ logging:
# ignored: /**,/swagger*,/webjars/**,/v2/**,/swagger-resources/**
# ignored: /**,/swagger*,/webjars/**,/v2/**,/swagger-resources/**
swagger_enable
:
true
swagger_enable
:
true
eureka
:
client
:
service-url
:
defaultZone
:
http://localhost:10001/eureka
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