Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
9fc1e6b9
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9fc1e6b9
编写于
12月 05, 2019
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optimise
上级
aae00f5a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
64 addition
and
10 deletion
+64
-10
whatsmars-spring-data/pom.xml
whatsmars-spring-data/pom.xml
+25
-0
whatsmars-spring-data/src/main/java/org/hongxi/whatsmars/spring/data/Application.java
...in/java/org/hongxi/whatsmars/spring/data/Application.java
+4
-0
whatsmars-spring-data/src/main/java/org/hongxi/whatsmars/spring/data/config/MogoConfiguration.java
...ongxi/whatsmars/spring/data/config/MogoConfiguration.java
+0
-9
whatsmars-spring-data/src/main/java/org/hongxi/whatsmars/spring/data/service/DataService.java
...org/hongxi/whatsmars/spring/data/service/DataService.java
+10
-1
whatsmars-spring-data/src/main/resources/log4j2.xml
whatsmars-spring-data/src/main/resources/log4j2.xml
+25
-0
未找到文件。
whatsmars-spring-data/pom.xml
浏览文件 @
9fc1e6b9
...
...
@@ -16,6 +16,14 @@
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-redis
</artifactId>
</dependency>
<dependency>
<groupId>
redis.clients
</groupId>
<artifactId>
jedis
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-pool2
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-elasticsearch
</artifactId>
...
...
@@ -29,6 +37,23 @@
<groupId>
org.hongxi
</groupId>
<artifactId>
whatsmars-common
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-slf4j-impl
</artifactId>
</dependency>
<dependency>
<groupId>
log4j
</groupId>
<artifactId>
log4j
</artifactId>
</dependency>
</dependencies>
...
...
whatsmars-spring-data/src/main/java/org/hongxi/whatsmars/spring/data/Application.java
浏览文件 @
9fc1e6b9
...
...
@@ -2,7 +2,11 @@ package org.hongxi.whatsmars.spring.data;
import
org.hongxi.whatsmars.common.profile.ProfileUtils
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.ImportResource
;
@ImportResource
(
"classpath:spring-*.xml"
)
@Configuration
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
...
...
whatsmars-spring-data/src/main/java/org/hongxi/whatsmars/spring/data/config/MogoConfiguration.java
已删除
100644 → 0
浏览文件 @
aae00f5a
package
org.hongxi.whatsmars.spring.data.config
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.ImportResource
;
@Configuration
@ImportResource
(
"classpath:spring-mongo.xml"
)
public
class
MogoConfiguration
{
}
whatsmars-spring-data/src/main/java/org/hongxi/whatsmars/spring/data/service/DataService.java
浏览文件 @
9fc1e6b9
...
...
@@ -2,6 +2,7 @@ package org.hongxi.whatsmars.spring.data.service;
import
org.elasticsearch.client.transport.TransportClient
;
import
org.hongxi.whatsmars.spring.data.repository.CustomerRepository
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
...
...
@@ -9,7 +10,7 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
@Service
public
class
DataService
{
public
class
DataService
implements
InitializingBean
{
@Resource
private
RedisTemplate
<
Integer
,
String
>
redisTemplate
;
...
...
@@ -19,4 +20,12 @@ public class DataService {
private
MongoTemplate
mongoTemplate
;
@Resource
private
CustomerRepository
customerRepository
;
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
System
.
out
.
println
(
redisTemplate
);
System
.
out
.
println
(
transportClient
);
System
.
out
.
println
(
mongoTemplate
);
System
.
out
.
println
(
customerRepository
);
}
}
whatsmars-spring-data/src/main/resources/log4j2.xml
0 → 100644
浏览文件 @
9fc1e6b9
<?xml version="1.0" encoding="UTF-8"?>
<configuration
status=
"debug"
>
<properties>
<property
name=
"log.path"
>
/data/logs/whatsmars-spring-data
</property>
</properties>
<appenders>
<console
name=
"Console"
target=
"SYSTEM_OUT"
>
<Filters>
<ThresholdFilter
level=
"DEBUG"
onMatch=
"ACCEPT"
onMismatch=
"DENY"
/>
</Filters>
<PatternLayout
pattern=
"%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
/>
</console>
</appenders>
<loggers>
<root
level=
"INFO"
>
<appender-ref
ref=
"Console"
/>
</root>
</loggers>
</configuration>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录