Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
isc-core
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
isc-v3.1-tmp
isc-core
Commits
dfd3d058
Commit
dfd3d058
authored
Sep 26, 2024
by
hulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
独立automatic
parent
19c55d14
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
7 deletions
+89
-7
pom.xml
isc-common-automatic/pom.xml
+29
-0
FlowLimit.java
...va/com/brilliance/isc/automatic/annotation/FlowLimit.java
+1
-1
SemphoreMapper.java
...a/com/brilliance/isc/automatic/mapper/SemphoreMapper.java
+1
-1
SemaphoreServiceImpl.java
...ance/isc/automatic/service/impl/SemaphoreServiceImpl.java
+3
-3
CounterException.java
...om/brilliance/isc/counter/exception/CounterException.java
+2
-2
RedisTemplateConfig.java
...com/brilliance/isc/common/config/RedisTemplateConfig.java
+51
-0
pom.xml
pom.xml
+2
-0
No files found.
isc-common-automatic/pom.xml
0 → 100644
View file @
dfd3d058
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
isc-common-parent
</artifactId>
<groupId>
com.brilliance.isc
</groupId>
<version>
3.1.0
</version>
<relativePath></relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<artifactId>
isc-common-automatic
</artifactId>
<dependencies>
<dependency>
<groupId>
org.redisson
</groupId>
<artifactId>
redisson-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
com.brilliance.isc
</groupId>
<artifactId>
isc-common-core
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
isc-common-
counter/src/main/java/com/brilliance/isc/counter
/annotation/FlowLimit.java
→
isc-common-
automatic/src/main/java/com/brilliance/isc/automatic
/annotation/FlowLimit.java
View file @
dfd3d058
package
com
.
brilliance
.
isc
.
counter
.
annotation
;
package
com
.
brilliance
.
isc
.
automatic
.
annotation
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
...
...
isc-common-
counter/src/main/java/com/brilliance/isc/counter
/mapper/SemphoreMapper.java
→
isc-common-
automatic/src/main/java/com/brilliance/isc/automatic
/mapper/SemphoreMapper.java
View file @
dfd3d058
package
com
.
brilliance
.
isc
.
counter
.
mapper
;
package
com
.
brilliance
.
isc
.
automatic
.
mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
isc-common-
counter/src/main/java/com/brilliance/isc/counter
/service/impl/SemaphoreServiceImpl.java
→
isc-common-
automatic/src/main/java/com/brilliance/isc/automatic
/service/impl/SemaphoreServiceImpl.java
View file @
dfd3d058
package
com
.
brilliance
.
isc
.
counter
.
service
.
impl
;
package
com
.
brilliance
.
isc
.
automatic
.
service
.
impl
;
import
com.brilliance.isc.automatic.annotation.FlowLimit
;
import
com.brilliance.isc.automatic.mapper.SemphoreMapper
;
import
com.brilliance.isc.bo.auto.AutoFlow
;
import
com.brilliance.isc.counter.annotation.FlowLimit
;
import
com.brilliance.isc.counter.mapper.SemphoreMapper
;
import
com.brilliance.isc.mda.dao.AutoFlowMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.aspectj.lang.ProceedingJoinPoint
;
...
...
isc-common-counter/src/main/java/com/brilliance/isc/counter/exception/CounterException.java
View file @
dfd3d058
package
com
.
brilliance
.
isc
.
counter
.
exception
;
import
com.brilliance.isc.constant.
Error
Code
;
import
com.brilliance.isc.constant.
Biz
Code
;
import
com.brilliance.isc.exception.RestBizException
;
public
class
CounterException
extends
RestBizException
{
public
CounterException
(
String
message
)
{
super
(
Error
Code
.
COUNTER_ERROR
,
message
);
super
(
Biz
Code
.
COUNTER_ERROR
,
message
);
}
}
isc-common-service/src/main/java/com/brilliance/isc/common/config/RedisTemplateConfig.java
0 → 100644
View file @
dfd3d058
package
com
.
brilliance
.
isc
.
common
.
config
;
import
com.fasterxml.jackson.annotation.JsonAutoDetect
;
import
com.fasterxml.jackson.annotation.PropertyAccessor
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.module.SimpleModule
;
import
com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter
;
import
com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.util.List
;
@Configuration
public
class
RedisTemplateConfig
{
@Autowired
private
ObjectMapper
objectMapper
;
@Bean
(
"jacksonRedisTemplate"
)
public
RedisTemplate
<
String
,
Object
>
jacksonRedisTemplate
(
RedisConnectionFactory
factory
)
{
RedisTemplate
<
String
,
Object
>
template
=
new
RedisTemplate
<>();
template
.
setConnectionFactory
(
factory
);
// 使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
Jackson2JsonRedisSerializer
jacksonSeial
=
new
Jackson2JsonRedisSerializer
(
Object
.
class
);
jacksonSeial
.
setObjectMapper
(
objectMapper
);
// 值采用json序列化
template
.
setValueSerializer
(
jacksonSeial
);
//使用StringRedisSerializer来序列化和反序列化redis的key值
template
.
setKeySerializer
(
new
StringRedisSerializer
());
// 设置hash key 和value序列化模式
template
.
setHashKeySerializer
(
new
StringRedisSerializer
());
template
.
setHashValueSerializer
(
jacksonSeial
);
template
.
afterPropertiesSet
();
return
template
;
}
}
\ No newline at end of file
pom.xml
View file @
dfd3d058
...
...
@@ -18,6 +18,7 @@
<module>
isc-common-service
</module>
<module>
isc-common-esb
</module>
<module>
isc-common-counter
</module>
<module>
isc-common-automatic
</module>
</modules>
</project>
\ No newline at end of file
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