something

This commit is contained in:
jinyu 2017-03-06 16:51:20 +08:00
parent c527924169
commit 3e022ad101
6 changed files with 68 additions and 48 deletions

View File

@ -1,17 +1,12 @@
# Jar包服务执行脚本
ulimit -n 110000
#Jdk home
JAVA_HOME="/path/to/java"
if [ ! -n "$JAVA_HOME" ]; then
export JAVA_HOME="/usr/local/java"
fi
#Executing user
RUNNING_USER=root
#App home
APP_HOME="/path/to/weixin4j/service"
APP_HOME=$(cd "$(dirname "$0")"; pwd)
#Main class
APP_MAINCLASS=xx.xxx.mainClass
APP_MAINCLASS=com.foxinmy.weixin4j.example.server.Weixin4jServerStartup
#classpath
CLASSPATH=$APP_HOME/classes
@ -49,9 +44,7 @@ start() {
echo "================================"
else
echo -n "Starting $APP_MAINCLASS ..."
# JAVA_CMD="nohup $JAVA_HOME/bin/java $JAVA_OPTS -classpath $CLASSPATH $APP_MAINCLASS >/dev/null 2>&1 &"
JAVA_CMD="$JAVA_HOME/bin/java $JAVA_OPTS -classpath $CLASSPATH $APP_MAINCLASS &"
su - $RUNNING_USER -c "$JAVA_CMD"
nohup ${JAVA_HOME}/bin/java ${JAVA_OPTS} -classpath ${CLASSPATH} ${APP_MAINCLASS} > ${APP_HOME}/nohup.log 2>&1 &
checkpid
if [ $psid -ne 0 ]; then
echo "(pid=$psid) [OK]"

View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.foxinmy</groupId>
<artifactId>weixin4j</artifactId>
<version>1.7.3</version>
<version>1.7.4</version>
</parent>
<artifactId>weixin4j-example</artifactId>
<version>1.0</version>
@ -19,7 +19,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>../script/assembly.xml</descriptor>
<descriptor>src/main/script/assembly.xml</descriptor>
</descriptors>
<finalName>weixin4j-server</finalName>
</configuration>
@ -47,13 +47,13 @@
<dependency>
<groupId>com.foxinmy</groupId>
<artifactId>weixin4j-mp</artifactId>
<version>1.7.3</version>
<version>1.7.4</version>
</dependency>
<!-- 微信企业号 -->
<dependency>
<groupId>com.foxinmy</groupId>
<artifactId>weixin4j-qy</artifactId>
<version>1.7.3</version>
<version>1.7.4</version>
</dependency>
<!-- 微信被动消息(回调模式) -->
<dependency>

View File

@ -0,0 +1,31 @@
<!-- maven-assembly-plugin:zip可执行包 -->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<dependencySets>
<dependencySet>
<includes>
<include>io.netty:netty-all</include>
<include>com.foxinmy:weixin4j-server</include>
<include>com.foxinmy:weixin4j-example</include>
</includes>
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>/lib</outputDirectory>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>src/main/script</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.sh</include>
<include>*.bat</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@ -1,14 +1,9 @@
# Jar执行脚本
ulimit -n 110000
#Jdk home
JAVA_HOME="/usr/local/java"
if [ ! -n "$JAVA_HOME" ]; then
export JAVA_HOME="/usr/local/java"
fi
#Executing user
RUNNING_USER=root
#App home
APP_HOME="/usr/local/weixin4j/weixin4j-server"
APP_HOME=$(cd "$(dirname "$0")"; pwd)
#Main class
APP_MAINCLASS=com.foxinmy.weixin4j.example.server.Weixin4jServerStartup
@ -49,9 +44,7 @@ start() {
echo "================================"
else
echo -n "Starting $APP_MAINCLASS ..."
# JAVA_CMD="nohup $JAVA_HOME/bin/java $JAVA_OPTS -classpath $CLASSPATH $APP_MAINCLASS >/dev/null 2>&1 &"
JAVA_CMD="$JAVA_HOME/bin/java $JAVA_OPTS -classpath $CLASSPATH $APP_MAINCLASS &"
su - $RUNNING_USER -c "$JAVA_CMD"
nohup ${JAVA_HOME}/bin/java ${JAVA_OPTS} -classpath ${CLASSPATH} ${APP_MAINCLASS} > ${APP_HOME}/nohup.log 2>&1 &
checkpid
if [ $psid -ne 0 ]; then
echo "(pid=$psid) [OK]"

View File

@ -12,7 +12,7 @@ import java.util.Map;
* @since JDK 1.6
*/
public enum IndustryType {
ITKEJI_HULIANWANG$DIANZISHANGWU("IT科技", "互联网/电子商务", 1), ITKEJI_ITRUANJIANYUFUWU(
ITKEJI_HULIANWANG$DIANZISHANGWU("IT科技", "互联网|电子商务", 1), ITKEJI_ITRUANJIANYUFUWU(
"IT科技", "IT软件与服务", 2), ITKEJI_ITYINGJIANYUSHEBEI("IT科技", "IT硬件与设备",
3), ITKEJI_DIANZIJISHU("IT科技", "电子技术", 4), ITKEJI_TONGXINYUYUNYINGSHANG(
"IT科技", "通信与运营商", 5), ITKEJI_WANGLUOYOUXI("IT科技", "网络游戏", 6), JINRONGYE_YINXING(

View File

@ -1,5 +1,6 @@
package com.foxinmy.weixin4j.util;
import static io.netty.handler.codec.http.HttpHeaderNames.CONNECTION;
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH;
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE;
import static io.netty.handler.codec.http.HttpHeaderNames.DATE;
@ -8,6 +9,7 @@ import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1;
import io.netty.buffer.Unpooled;
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpHeaderValues;
import io.netty.handler.codec.http.HttpResponse;
import io.netty.handler.codec.http.HttpResponseStatus;
@ -60,6 +62,7 @@ public class HttpUtil {
* (HttpHeaders.isTransferEncodingChunked(httpRequest)) {
* httpResponse.headers().set(TRANSFER_ENCODING, Values.CHUNKED); }
*/
httpResponse.headers().set(CONNECTION, HttpHeaderValues.CLOSE);
httpResponse.headers().set(DATE, new Date());
httpResponse.headers().set(SERVER, SERVER);
httpResponse.headers()