Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
bf99ad53
Commit
bf99ad53
authored
Jun 30, 2021
by
xd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import common
parent
198af5af
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
35 deletions
+57
-35
pom.xml
community-api/pom.xml
+0
-12
CommunityApi.java
...i/src/main/java/com/tanpu/community/api/CommunityApi.java
+0
-19
CommonImportConfig.java
...n/java/com/tanpu/community/config/CommonImportConfig.java
+39
-0
CommunityDataSourceConfig.java
...va/com/tanpu/community/dao/CommunityDataSourceConfig.java
+14
-0
logback.xml
community-service/src/main/resources/logback.xml
+4
-4
No files found.
community-api/pom.xml
View file @
bf99ad53
...
@@ -17,18 +17,6 @@
...
@@ -17,18 +17,6 @@
<groupId>
com.tanpu
</groupId>
<groupId>
com.tanpu
</groupId>
<artifactId>
common
</artifactId>
<artifactId>
common
</artifactId>
</dependency>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger.core.v3/swagger-annotations -->
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-annotations
</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
community-api/src/main/java/com/tanpu/community/api/CommunityApi.java
deleted
100644 → 0
View file @
198af5af
package
com
.
tanpu
.
community
.
api
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.req.AlertReq
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.util.List
;
@Api
(
tags
=
"告警"
)
public
interface
CommunityApi
{
@ApiOperation
(
"企业微信机器人告警"
)
@PostMapping
(
"/api/wework-robot-alert"
)
CommonResp
<
List
<
AlertReq
>>
weworkRobotAlert
(
@RequestBody
AlertReq
alertReq
);
}
community-service/src/main/java/com/tanpu/community/config/CommonImportConfig.java
0 → 100644
View file @
bf99ad53
package
com
.
tanpu
.
community
.
config
;
import
com.tanpu.common.auth.LoginInterceptor
;
import
com.tanpu.common.error.GlobalExceptionHandler
;
import
com.tanpu.common.log.WebLogInterceptor
;
import
com.tanpu.common.uuid.UuidGenHelper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.aop.aspectj.AspectJExpressionPointcut
;
import
org.springframework.aop.support.DefaultPointcutAdvisor
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.core.Ordered
;
/**
* 引入登录拦截、唯一id生成、日志记录、异常处理
* created by xd on 2021/6/19
*/
@Slf4j
@Configuration
@Import
({
LoginInterceptor
.
class
,
UuidGenHelper
.
class
,
WebLogInterceptor
.
class
,
GlobalExceptionHandler
.
class
})
public
class
CommonImportConfig
{
@Bean
public
DefaultPointcutAdvisor
webLogAdvisor
(
WebLogInterceptor
webLogInterceptor
)
{
log
.
info
(
"build webLogAdvisor"
);
DefaultPointcutAdvisor
webLogAdvisor
=
new
DefaultPointcutAdvisor
();
webLogAdvisor
.
setOrder
(
Ordered
.
HIGHEST_PRECEDENCE
);
AspectJExpressionPointcut
pointcut
=
new
AspectJExpressionPointcut
();
pointcut
.
setExpression
(
"execution(* com.tanpu.trade.web.*Controller.*(..))"
);
webLogAdvisor
.
setPointcut
(
pointcut
);
webLogAdvisor
.
setAdvice
(
webLogInterceptor
);
return
webLogAdvisor
;
}
}
community-service/src/main/java/com/tanpu/community/dao/CommunityDataSourceConfig.java
View file @
bf99ad53
...
@@ -13,6 +13,8 @@ import org.springframework.context.annotation.Bean;
...
@@ -13,6 +13,8 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
...
@@ -54,4 +56,16 @@ public class CommunityDataSourceConfig {
...
@@ -54,4 +56,16 @@ public class CommunityDataSourceConfig {
public
SqlSessionTemplate
communitySqlSessionTemplate
(
@Qualifier
(
"communitySqlSessionFactory"
)
SqlSessionFactory
sqlSessionFactory
)
{
public
SqlSessionTemplate
communitySqlSessionTemplate
(
@Qualifier
(
"communitySqlSessionFactory"
)
SqlSessionFactory
sqlSessionFactory
)
{
return
new
SqlSessionTemplate
(
sqlSessionFactory
);
return
new
SqlSessionTemplate
(
sqlSessionFactory
);
}
}
@Bean
(
name
=
"jdbcTemplate"
)
@Primary
public
JdbcTemplate
jdbcTemplate
(
@Qualifier
(
"communityDataSource"
)
DataSource
dataSource
)
{
return
new
JdbcTemplate
(
dataSource
);
}
@Bean
(
name
=
"jdbcTemplateNamed"
)
@Primary
public
NamedParameterJdbcTemplate
jdbcTemplateNamed
(
@Qualifier
(
"communityDataSource"
)
DataSource
dataSource
)
{
return
new
NamedParameterJdbcTemplate
(
dataSource
);
}
}
}
community-service/src/main/resources/logback.xml
View file @
bf99ad53
...
@@ -7,11 +7,11 @@
...
@@ -7,11 +7,11 @@
<property
name=
"LOG_FILE"
value=
"app"
/>
<property
name=
"LOG_FILE"
value=
"app"
/>
<property
name=
"CONSOLE_LOG_PATTERN"
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p})
%clr(${PID:- }){magenta} %clr(-){faint} %clr([%t]){faint} %clr(%logger{60}:%line){cyan}
%clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"
/>
value=
"%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p})
[uid:%X{X-UserID:- }] %clr(${PID:- }){magenta} %clr(-){faint} %clr([%t]){faint} %clr(%logger{40}:%line %M){cyan}
%clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"
/>
<property
name=
"CONSOLE_LOG_CHARSET"
value=
"${CONSOLE_LOG_CHARSET:-
default
}"
/>
<property
name=
"CONSOLE_LOG_CHARSET"
value=
"${CONSOLE_LOG_CHARSET:-
UTF-8
}"
/>
<property
name=
"FILE_LOG_PATTERN"
<property
name=
"FILE_LOG_PATTERN"
value=
"%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p}
${PID:- } - [%t] %logger{60}:%line :
%m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"
/>
value=
"%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p}
[uid:%X{X-UserID:- }] ${PID:- } - [%t] %logger{40}:%line %M:
%m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"
/>
<property
name=
"FILE_LOG_CHARSET"
value=
"${FILE_LOG_CHARSET:-
default
}"
/>
<property
name=
"FILE_LOG_CHARSET"
value=
"${FILE_LOG_CHARSET:-
UTF-8
}"
/>
<appender
name=
"console"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<appender
name=
"console"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<encoder>
...
...
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