Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fenghuo12
zheng
提交
248b57b2
Z
zheng
项目概览
fenghuo12
/
zheng
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zheng
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
248b57b2
编写于
7月 03, 2018
作者:
shuzheng5201314
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
初始化notify
上级
e9b08db4
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
679 addition
and
0 deletion
+679
-0
zheng-notify/pom.xml
zheng-notify/pom.xml
+25
-0
zheng-notify/zheng-notify-client/index.html
zheng-notify/zheng-notify-client/index.html
+83
-0
zheng-notify/zheng-notify-sdk/pom.xml
zheng-notify/zheng-notify-sdk/pom.xml
+60
-0
zheng-notify/zheng-notify-sdk/src/main/java/com/zheng/notify/sdk/BaseResult.java
...fy-sdk/src/main/java/com/zheng/notify/sdk/BaseResult.java
+54
-0
zheng-notify/zheng-notify-sdk/src/main/java/com/zheng/notify/sdk/NotifyConstants.java
...k/src/main/java/com/zheng/notify/sdk/NotifyConstants.java
+18
-0
zheng-notify/zheng-notify-sdk/src/main/java/com/zheng/notify/sdk/NotifyHelper.java
...-sdk/src/main/java/com/zheng/notify/sdk/NotifyHelper.java
+68
-0
zheng-notify/zheng-notify-sdk/src/main/java/com/zheng/notify/sdk/PublishDto.java
...fy-sdk/src/main/java/com/zheng/notify/sdk/PublishDto.java
+76
-0
zheng-notify/zheng-notify-server/pom.xml
zheng-notify/zheng-notify-server/pom.xml
+111
-0
zheng-notify/zheng-notify-server/src/main/java/com/zheng/notify/server/controller/IndexController.java
...a/com/zheng/notify/server/controller/IndexController.java
+26
-0
zheng-notify/zheng-notify-server/src/main/resources/config.properties
.../zheng-notify-server/src/main/resources/config.properties
+3
-0
zheng-notify/zheng-notify-server/src/main/resources/i18n/messages_en_US.properties
...-server/src/main/resources/i18n/messages_en_US.properties
+4
-0
zheng-notify/zheng-notify-server/src/main/resources/i18n/messages_zh_CN.properties
...-server/src/main/resources/i18n/messages_zh_CN.properties
+4
-0
zheng-notify/zheng-notify-server/src/main/resources/log4j.properties
...y/zheng-notify-server/src/main/resources/log4j.properties
+30
-0
zheng-notify/zheng-notify-server/src/main/resources/profiles/dev.properties
...-notify-server/src/main/resources/profiles/dev.properties
+3
-0
zheng-notify/zheng-notify-server/src/main/resources/profiles/prod.properties
...notify-server/src/main/resources/profiles/prod.properties
+3
-0
zheng-notify/zheng-notify-server/src/main/resources/profiles/test.properties
...notify-server/src/main/resources/profiles/test.properties
+3
-0
zheng-notify/zheng-notify-server/src/main/resources/springMVC-servlet.xml
...ng-notify-server/src/main/resources/springMVC-servlet.xml
+42
-0
zheng-notify/zheng-notify-server/src/main/webapp/WEB-INF/web.xml
...otify/zheng-notify-server/src/main/webapp/WEB-INF/web.xml
+66
-0
未找到文件。
zheng-notify/pom.xml
0 → 100644
浏览文件 @
248b57b2
<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"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.zheng
</groupId>
<artifactId>
zheng-notify
</artifactId>
<version>
1.0.0
</version>
<packaging>
pom
</packaging>
<name>
zheng-notify
</name>
<url>
http://www.zhangshuzheng.cn
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.source>
1.7
</maven.compiler.source>
<maven.compiler.target>
1.7
</maven.compiler.target>
<maven.compiler.compilerVersion>
1.7
</maven.compiler.compilerVersion>
</properties>
<modules>
<module>
zheng-notify-sdk
</module>
<module>
zheng-notify-server
</module>
</modules>
</project>
zheng-notify/zheng-notify-client/index.html
0 → 100644
浏览文件 @
248b57b2
<!DOCTYPE html>
<html
lang=
"zh-CN"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<title>
管理监控中心
</title>
<style>
#main
{
width
:
100%
;
height
:
400px
;
margin
:
0
auto
;}
.namespace
{
width
:
100%
;
height
:
400px
;
background
:
#000
;}
.title
{
width
:
100%
;
height
:
40px
;
font-size
:
0
;
background
:
#666
;}
.input
,
.button
{
float
:
left
;
height
:
40px
;
border
:
none
;
background
:
none
;
outline
:
none
;
color
:
#fff
;}
.input
{
width
:
25%
;
text-indent
:
10px
;
font-weight
:
bold
;}
.button
{
width
:
10%
;
cursor
:
pointer
;}
#token
{
width
:
20%
;}
#env
{
background
:
rgb
(
194
,
53
,
49
);}
.messages
{
width
:
100%
;
height
:
340px
;
overflow-y
:
auto
;
font-size
:
12px
;
line-height
:
2em
;
color
:
#fff
;}
.messages
li
{
list-style-type
:
none
;}
.messages
.connect
{
color
:
#00cc00
;}
.messages
.warn
{
color
:
#cccc00
;}
.messages
.disconnect
{
color
:
#cc0000
;}
table
{
width
:
100%
;
border-collapse
:
collapse
;
border
:
solid
#ccc
;
border-width
:
1px
0
0
1px
}
table
th
,
table
td
{
border
:
solid
#ccc
;
border-width
:
0
1px
1px
0
;
padding
:
14px
;
text-align
:
center
}
</style>
</head>
<body>
<div
id=
"main"
>
<div
class=
"namespace"
>
<div
class=
"title"
>
<select
id=
"env"
class=
"input"
>
<option
value=
"http://localhost:8882"
>
开发环境
</option>
</select>
<input
id=
"namespace"
class=
"input"
type=
"text"
placeholder=
"namespace"
value=
""
/>
<input
id=
"token"
class=
"input"
type=
"text"
placeholder=
"token"
value=
""
/>
<input
id=
"connect"
class=
"button"
type=
"button"
value=
"连接"
/>
<input
id=
"send"
class=
"button"
type=
"button"
value=
"发言"
/>
<input
id=
"disconnect"
class=
"button"
type=
"button"
value=
"断开"
/>
</div>
<div
class=
"messages"
>
<ul
id=
"list"
>
</ul>
</div>
</div>
</div>
<script
src=
"https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"
></script>
<script
src=
"https://cdn.bootcss.com/socket.io/2.1.1/socket.io.js"
></script>
<script
type=
"text/javascript"
>
$
(
function
()
{
// SocketIO客户端
var
socket
;
$
(
'
#connect
'
).
click
(
function
()
{
// 获取token,请求业务系统接口
var
token
=
$
(
'
#token
'
).
val
();
// 创建socketio连接
socket
=
io
.
connect
(
$
(
'
#env
'
).
val
()
+
$
(
'
#namespace
'
).
val
()
+
'
?token=
'
+
token
);
socket
.
on
(
'
connect
'
,
function
()
{
$
(
'
#list
'
).
prepend
(
'
<li class="connect">已连接服务器!</li>
'
);
});
socket
.
on
(
'
message
'
,
function
(
data
,
ackServerCallback
)
{
$
(
'
#list
'
).
prepend
(
'
<li class="data">收到服务器消息:
'
+
JSON
.
stringify
(
data
)
+
'
</li>
'
);
if
(
ackServerCallback
)
{
ackServerCallback
();
}
});
socket
.
on
(
'
connect_error
'
,
function
(
error
)
{
$
(
'
#list
'
).
prepend
(
'
<li class="warn">连接服务器失败!</li>
'
);
console
.
log
(
error
);
});
socket
.
on
(
'
disconnect
'
,
function
()
{
$
(
'
#list
'
).
prepend
(
'
<li class="disconnect">已断开服务器!</li>
'
);
});
$
(
'
#send
'
).
click
(
function
()
{
socket
.
emit
(
'
message
'
,
{
userName
:
'
userName
'
,
message
:
new
Date
()});
});
$
(
'
#disconnect
'
).
click
(
function
()
{
socket
.
close
();
});
// 防止重复连接
$
(
this
).
attr
(
'
disabled
'
,
'
disabled
'
);
});
});
</script>
</body>
</html>
\ No newline at end of file
zheng-notify/zheng-notify-sdk/pom.xml
0 → 100644
浏览文件 @
248b57b2
<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"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.zheng
</groupId>
<artifactId>
zheng-notify
</artifactId>
<version>
1.0.0
</version>
</parent>
<artifactId>
zheng-notify-sdk
</artifactId>
<packaging>
jar
</packaging>
<name>
zheng-notify-sdk
</name>
<url>
http://www.zhangshuzheng.cn
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.5.5
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.47
</version>
</dependency>
</dependencies>
<build>
<finalName>
zheng-notify-sdk
</finalName>
<resources>
<resource>
<directory>
src/main/java
</directory>
<includes>
<include>
**/*.xml
</include>
</includes>
<filtering>
true
</filtering>
</resource>
<resource>
<directory>
src/main/resources
</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.18.1
</version>
<configuration>
<skipTests>
true
</skipTests>
<testFailureIgnore>
true
</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</project>
zheng-notify/zheng-notify-sdk/src/main/java/com/zheng/notify/sdk/BaseResult.java
0 → 100644
浏览文件 @
248b57b2
package
com.zheng.notify.sdk
;
/**
* 统一返回结果类
* Created by shuzheng on 2017/2/18.
*/
public
class
BaseResult
{
/**
* 状态码:1成功,其他为失败
*/
public
int
code
;
/**
* 成功为success,其他为失败原因
*/
public
String
message
;
/**
* 数据结果集
*/
public
Object
data
;
public
BaseResult
(
int
code
,
String
message
,
Object
data
)
{
this
.
code
=
code
;
this
.
message
=
message
;
this
.
data
=
data
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
Object
getData
()
{
return
data
;
}
public
void
setData
(
Object
data
)
{
this
.
data
=
data
;
}
}
zheng-notify/zheng-notify-sdk/src/main/java/com/zheng/notify/sdk/NotifyConstants.java
0 → 100644
浏览文件 @
248b57b2
package
com.zheng.notify.sdk
;
/**
* 全局常量
* Created by shuzheng on 2018/6/28.
*/
public
class
NotifyConstants
{
// 通知类型:广播
public
static
final
String
PUBLISH_TYPE_BROADCAST
=
"broadcast"
;
// 通知类型:主题
public
static
final
String
PUBLISH_TYPE_TOPICS
=
"topics"
;
// 通知类型:点对点
public
static
final
String
PUBLISH_TYPE_CLIENTS
=
"clients"
;
}
zheng-notify/zheng-notify-sdk/src/main/java/com/zheng/notify/sdk/NotifyHelper.java
0 → 100644
浏览文件 @
248b57b2
package
com.zheng.notify.sdk
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.DefaultHttpClient
;
import
org.apache.http.util.EntityUtils
;
import
java.nio.charset.Charset
;
/**
* 推送工具类
* Created by shuzheng on 2018/6/28.
*/
public
class
NotifyHelper
{
/**
* 推送消息
* @param url
* @param publishDto
* @return
*/
public
BaseResult
publish
(
String
url
,
PublishDto
publishDto
)
{
HttpPost
httpPost
=
null
;
try
{
HttpClient
httpClient
=
new
DefaultHttpClient
();
httpPost
=
new
HttpPost
(
url
);
httpPost
.
setHeader
(
"Content-type"
,
"application/json; charset=utf-8"
);
HttpEntity
httpEntity
=
new
StringEntity
(
JSONObject
.
toJSONString
(
publishDto
),
"utf-8"
);
httpPost
.
setEntity
(
httpEntity
);
HttpResponse
httpResponse
=
httpClient
.
execute
(
httpPost
);
int
statusCode
=
httpResponse
.
getStatusLine
().
getStatusCode
();
if
(
statusCode
==
HttpStatus
.
SC_OK
)
{
HttpEntity
resEntity
=
httpResponse
.
getEntity
();
if
(
resEntity
!=
null
)
{
String
result
=
EntityUtils
.
toString
(
resEntity
,
Charset
.
forName
(
"utf-8"
));
return
JSONObject
.
parseObject
(
result
,
BaseResult
.
class
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
httpPost
!=
null
)
{
httpPost
.
releaseConnection
();
}
}
return
new
BaseResult
(-
1
,
"error"
,
"publish error"
);
}
public
static
void
main
(
String
[]
args
)
{
String
url
=
"http://localhost:8881/notify/publish"
;
PublishDto
publishDto
=
new
PublishDto
();
publishDto
.
setType
(
NotifyConstants
.
PUBLISH_TYPE_BROADCAST
);
publishDto
.
setNamespace
(
"/demo"
);
publishDto
.
setAccessKey
(
"1"
);
publishDto
.
setPayload
(
"hi"
);
BaseResult
result
=
new
NotifyHelper
().
publish
(
url
,
publishDto
);
System
.
out
.
println
(
result
.
message
);
}
}
zheng-notify/zheng-notify-sdk/src/main/java/com/zheng/notify/sdk/PublishDto.java
0 → 100644
浏览文件 @
248b57b2
package
com.zheng.notify.sdk
;
/**
* 推送消息
* Created by shuzheng on 2018/6/20.
*/
public
class
PublishDto
{
// 推送类型:"broadcast/topics/clients" <=> 广播、按主题、点对点
private
String
type
;
// 推送命名空间
private
String
namespace
;
// 鉴权key
private
String
accessKey
;
// 推送订阅主题的订阅者
private
String
[]
topics
;
// 推送客户端
private
String
[]
clients
;
// 消息体
private
Object
payload
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getNamespace
()
{
return
namespace
;
}
public
void
setNamespace
(
String
namespace
)
{
this
.
namespace
=
namespace
;
}
public
String
[]
getTopics
()
{
return
topics
;
}
public
void
setTopics
(
String
[]
topics
)
{
this
.
topics
=
topics
;
}
public
String
[]
getClients
()
{
return
clients
;
}
public
void
setClients
(
String
[]
clients
)
{
this
.
clients
=
clients
;
}
public
Object
getPayload
()
{
return
payload
;
}
public
void
setPayload
(
Object
payload
)
{
this
.
payload
=
payload
;
}
public
String
getAccessKey
()
{
return
accessKey
;
}
public
void
setAccessKey
(
String
accessKey
)
{
this
.
accessKey
=
accessKey
;
}
}
zheng-notify/zheng-notify-server/pom.xml
0 → 100644
浏览文件 @
248b57b2
<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"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.zheng
</groupId>
<artifactId>
zheng-notify
</artifactId>
<version>
1.0.0
</version>
</parent>
<artifactId>
zheng-notify-server
</artifactId>
<packaging>
jar
</packaging>
<name>
zheng-notify-server
</name>
<url>
http://www.zhangshuzheng.cn
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>
com.zheng
</groupId>
<artifactId>
zheng-common
</artifactId>
<version>
1.0.0
</version>
<type>
jar
</type>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
servlet-api
</artifactId>
<version>
2.5
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
jstl
</artifactId>
<version>
1.2
</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>
dev
</id>
<properties>
<env>
dev
</env>
</properties>
<activation>
<activeByDefault>
true
</activeByDefault>
</activation>
</profile>
<profile>
<id>
test
</id>
<properties>
<env>
test
</env>
</properties>
</profile>
<profile>
<id>
prod
</id>
<properties>
<env>
prod
</env>
</properties>
</profile>
</profiles>
<build>
<finalName>
zheng-notify-server
</finalName>
<filters>
<filter>
src/main/resources/profiles/${env}.properties
</filter>
</filters>
<resources>
<resource>
<directory>
src/main/resources
</directory>
<filtering>
true
</filtering>
</resource>
</resources>
<plugins>
<!-- jetty插件 -->
<plugin>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-maven-plugin
</artifactId>
<!--<version>9.0.0.v20130308</version>-->
<version>
9.2.7.v20150116
</version>
<configuration>
<scanIntervalSeconds>
3
</scanIntervalSeconds>
<webApp>
<contextPath>
/
</contextPath>
</webApp>
<httpConnector>
<port>
8881
</port>
</httpConnector>
<reload>
automatic
</reload>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.18.1
</version>
<configuration>
<skipTests>
true
</skipTests>
<testFailureIgnore>
true
</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</project>
zheng-notify/zheng-notify-server/src/main/java/com/zheng/notify/server/controller/IndexController.java
0 → 100644
浏览文件 @
248b57b2
package
com.zheng.notify.server.controller
;
import
com.zheng.common.base.BaseController
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* 测试controller
* Created by shuzheng on 2017/2/18.
*/
@Controller
public
class
IndexController
extends
BaseController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
IndexController
.
class
);
@RequestMapping
(
value
=
"/index"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
String
index
()
{
return
"index"
;
}
}
\ No newline at end of file
zheng-notify/zheng-notify-server/src/main/resources/config.properties
0 → 100644
浏览文件 @
248b57b2
app.name
=
${app.name}
env
=
${profile.env}
zheng.ui.path
=
${zheng.ui.path}
\ No newline at end of file
zheng-notify/zheng-notify-server/src/main/resources/i18n/messages_en_US.properties
0 → 100644
浏览文件 @
248b57b2
403
=
Access forbidden!
404
=
Page not found!
500
=
Internal server error!
error
=
Server error!
\ No newline at end of file
zheng-notify/zheng-notify-server/src/main/resources/i18n/messages_zh_CN.properties
0 → 100644
浏览文件 @
248b57b2
403
=
\u
6CA1
\u6709\u6743\u9650\u
FF01
404
=
\u9875\u9762\u
6CA1
\u6709\u
627E
\u5230\u
FF01
500
=
\u5185\u
90E8
\u
670D
\u
52A1
\u5668\u9519\u
8BEF
\u
FF01
error
=
\u
670D
\u
52A1
\u5668\u
53D1
\u
751F
\u9519\u
8BEF
\u
FF01
\ No newline at end of file
zheng-notify/zheng-notify-server/src/main/resources/log4j.properties
0 → 100644
浏览文件 @
248b57b2
#off/fatal/error/warn/info/debug/all
log4j.debug
=
false
log4j.rootLogger
=
info,stdout,log,errorlog
# Console
log4j.appender.stdout
=
org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target
=
System.out
log4j.appender.stdout.layout
=
org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern
=
%d [%t] %-5p [%c] - %m%n
### Log ###
log4j.appender.log
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.log.File
=
../logs/zheng-notify-server.log
log4j.appender.log.Append
=
true
log4j.appender.log.Threshold
=
DEBUG
log4j.appender.log.DatePattern
=
'.'yyyy-MM-dd
log4j.appender.log.layout
=
org.apache.log4j.PatternLayout
log4j.appender.log.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [ %p ] [ %C{1}.java :%L(%M)] %m%n
### Error ###
log4j.appender.errorlog
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.errorlog.File
=
../logs/zheng-notify-server.error.log
log4j.appender.errorlog.Append
=
true
log4j.appender.errorlog.Threshold
=
ERROR
log4j.appender.errorlog.DatePattern
=
'.'yyyy-MM-dd
log4j.appender.errorlog.layout
=
org.apache.log4j.PatternLayout
log4j.appender.errorlog.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [ %p ] [ %C{1}.java :%L(%M)] %m%n
#Spring logging configuration
log4j.category.org.springframework
=
warn
\ No newline at end of file
zheng-notify/zheng-notify-server/src/main/resources/profiles/dev.properties
0 → 100644
浏览文件 @
248b57b2
app.name
=
zheng-notify
profile.env
=
dev
zheng.ui.path
=
http://ui.zhangshuzheng.cn:1000/
\ No newline at end of file
zheng-notify/zheng-notify-server/src/main/resources/profiles/prod.properties
0 → 100644
浏览文件 @
248b57b2
app.name
=
zheng-notify
profile.env
=
prod
zheng.ui.path
=
http://ui.zhangshuzheng.cn:1000/
\ No newline at end of file
zheng-notify/zheng-notify-server/src/main/resources/profiles/test.properties
0 → 100644
浏览文件 @
248b57b2
app.name
=
zheng-notify
profile.env
=
test
zheng.ui.path
=
http://ui.zhangshuzheng.cn:1000/
\ No newline at end of file
zheng-notify/zheng-notify-server/src/main/resources/springMVC-servlet.xml
0 → 100644
浏览文件 @
248b57b2
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:context=
"http://www.springframework.org/schema/context"
xmlns:mvc=
"http://www.springframework.org/schema/mvc"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"
>
<context:property-placeholder
location=
"classpath:config.properties"
/>
<!-- thymeleaf视图 -->
<bean
id=
"templateResolver"
class=
"org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver"
>
<property
name=
"order"
value=
"0"
/>
<property
name=
"prefix"
value=
"${zheng.ui.path}"
/>
<property
name=
"suffix"
value=
""
/>
<property
name=
"templateMode"
value=
"HTML"
/>
<property
name=
"cacheable"
value=
"false"
/>
<property
name=
"characterEncoding"
value=
"UTF-8"
/>
<!--<property name="cacheable" value="true"/>-->
<!--<property name="cacheTTLMs" value="10000"/>-->
</bean>
<bean
id=
"templateEngine"
class=
"org.thymeleaf.spring4.SpringTemplateEngine"
>
<property
name=
"templateResolver"
ref=
"templateResolver"
/>
<property
name=
"enableSpringELCompiler"
value=
"true"
/>
</bean>
<bean
class=
"org.thymeleaf.spring4.view.ThymeleafViewResolver"
>
<property
name=
"templateEngine"
ref=
"templateEngine"
/>
<property
name=
"characterEncoding"
value=
"UTF-8"
/>
<property
name=
"viewNames"
value=
"*.html"
/>
</bean>
<!-- Jsp视图 -->
<bean
id=
"viewResolver"
class=
"org.springframework.web.servlet.view.InternalResourceViewResolver"
>
<property
name=
"order"
value=
"1"
/>
<property
name=
"viewNames"
value=
"*.jsp"
/>
<property
name=
"prefix"
value=
"/WEB-INF/jsp"
/>
<property
name=
"suffix"
value=
""
/>
<property
name=
"contentType"
value=
"text/html; charset=utf-8"
/>
<property
name=
"viewClass"
value=
"org.springframework.web.servlet.view.JstlView"
/>
</bean>
</beans>
\ No newline at end of file
zheng-notify/zheng-notify-server/src/main/webapp/WEB-INF/web.xml
0 → 100644
浏览文件 @
248b57b2
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version=
"3.0"
>
<!-- 强制进行转码 -->
<filter>
<filter-name>
CharacterEncodingFilter
</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>
encoding
</param-name>
<param-value>
UTF-8
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>
CharacterEncodingFilter
</filter-name>
<url-pattern>
/*
</url-pattern>
<dispatcher>
REQUEST
</dispatcher>
<dispatcher>
FORWARD
</dispatcher>
</filter-mapping>
<!-- 默认的spring配置文件是在WEB-INF下的applicationContext.xml -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>
contextConfigLocation
</param-name>
<param-value>
classpath*:applicationContext*.xml
</param-value>
</context-param>
<!-- 日志配置文件 -->
<context-param>
<param-name>
log4jConfigLocation
</param-name>
<param-value>
classpath:log4j.properties
</param-value>
</context-param>
<!-- springMVC的核心控制器 -->
<servlet>
<servlet-name>
springMVC
</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>
contextConfigLocation
</param-name>
<param-value>
classpath*:springMVC-servlet.xml
</param-value>
</init-param>
<load-on-startup>
1
</load-on-startup>
<async-supported>
true
</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>
springMVC
</servlet-name>
<url-pattern>
/
</url-pattern>
</servlet-mapping>
<!-- session配置 -->
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<!-- 欢迎页面 -->
<welcome-file-list>
<welcome-file>
index.html
</welcome-file>
</welcome-file-list>
</web-app>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录