Skip to content

Commit d7c02e1

Browse files
committed
first commit
0 parents  commit d7c02e1

30 files changed

+1589
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
.idea

LICENSE

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
MIT License
2+
3+
Copyright (c) 2019 wildfirechat
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
1. ikidou/TypeBuilder
24+
Copyright 2016 ikidou
25+
26+
Licensed under the Apache License, Version 2.0 (the "License");
27+
you may not use this file except in compliance with the License.
28+
You may obtain a copy of the License at
29+
30+
http://www.apache.org/licenses/LICENSE-2.0
31+
32+
Unless required by applicable law or agreed to in writing, software
33+
distributed under the License is distributed on an "AS IS" BASIS,
34+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35+
See the License for the specific language governing permissions and
36+
limitations under the License.

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# 野火IM机器人应用
2+
作为野火IM机器人应用的演示,本工程仅演示机器人应用的接口。其中用到图灵的免费版。
3+
4+
#### 编译
5+
```
6+
mvn package
7+
```
8+
9+
#### 图灵
10+
本应用使用了[图灵机器人](http://www.tuling123.com),需要申请到```atuling_key```,并配置到```robot.properties```中去。用户也可以自行更换为自己的机器人应用。如果不想使用图灵机器人,可以在配置里把参数```use_tuling```设置为false.
11+
12+
#### 修改配置
13+
本演示服务有2个配置文件在工程的```config```目录下,分别是```application.properties``````robot.properties```。请正确配置放到jar包所在的目录下的```config```目录下。
14+
15+
#### 运行
16+
```target```目录找到```robot-XXXX.jar```,把jar包和放置配置文件的```config```目录放到一起,然后执行下面命令:
17+
```
18+
java -jar robot-XXXXX.jar
19+
```
20+
21+
#### 使用到的开源代码
22+
1. [TypeBuilder](https://github.com/ikidou/TypeBuilder) 一个用于生成泛型的简易Builder
23+
24+
#### LICENSE
25+
UNDER MIT LICENSE. 详情见LICENSE文件

github_webhook.iml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4+
<output url="file://$MODULE_DIR$/target/classes" />
5+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
6+
<content url="file://$MODULE_DIR$">
7+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10+
<excludeFolder url="file://$MODULE_DIR$/target" />
11+
</content>
12+
<orderEntry type="inheritedJdk" />
13+
<orderEntry type="sourceFolder" forTests="false" />
14+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.0.6.RELEASE" level="project" />
15+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.0.6.RELEASE" level="project" />
16+
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.0.10.RELEASE" level="project" />
17+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.0.6.RELEASE" level="project" />
18+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.0.6.RELEASE" level="project" />
19+
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
20+
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
21+
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
22+
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
23+
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
24+
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
25+
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.0.10.RELEASE" level="project" />
26+
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.0.10.RELEASE" level="project" />
27+
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
28+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.0.6.RELEASE" level="project" />
29+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.0.6.RELEASE" level="project" />
30+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.7" level="project" />
31+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
32+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.7" level="project" />
33+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.7" level="project" />
34+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.7" level="project" />
35+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.7" level="project" />
36+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.0.6.RELEASE" level="project" />
37+
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.34" level="project" />
38+
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.34" level="project" />
39+
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.34" level="project" />
40+
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.13.Final" level="project" />
41+
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
42+
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
43+
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.4" level="project" />
44+
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.0.10.RELEASE" level="project" />
45+
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.0.10.RELEASE" level="project" />
46+
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.0.10.RELEASE" level="project" />
47+
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.0.10.RELEASE" level="project" />
48+
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.0.10.RELEASE" level="project" />
49+
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.0.6.RELEASE" level="project" />
50+
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.0.6.RELEASE" level="project" />
51+
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.0.6.RELEASE" level="project" />
52+
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
53+
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
54+
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
55+
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
56+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
57+
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.9.1" level="project" />
58+
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.15.0" level="project" />
59+
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.7.11" level="project" />
60+
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.7.11" level="project" />
61+
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
62+
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
63+
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
64+
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
65+
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
66+
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.0.10.RELEASE" level="project" />
67+
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.5.1" level="project" />
68+
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
69+
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.5" level="project" />
70+
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
71+
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.2" level="project" />
72+
<orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
73+
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
74+
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
75+
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.10" level="project" />
76+
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
77+
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:2.5.0" level="project" />
78+
<orderEntry type="module-library">
79+
<library name="Maven: cn.wildfirechat:sdk:0.21">
80+
<CLASSES>
81+
<root url="jar://$MODULE_DIR$/src/lib/sdk-0.21.jar!/" />
82+
</CLASSES>
83+
<JAVADOC />
84+
<SOURCES />
85+
</library>
86+
</orderEntry>
87+
<orderEntry type="module-library">
88+
<library name="Maven: cn.wildfirechat:common:0.21">
89+
<CLASSES>
90+
<root url="jar://$MODULE_DIR$/src/lib/common-0.21.jar!/" />
91+
</CLASSES>
92+
<JAVADOC />
93+
<SOURCES />
94+
</library>
95+
</orderEntry>
96+
</component>
97+
</module>

mvnw

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
#!/bin/sh
2+
# ----------------------------------------------------------------------------
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
# ----------------------------------------------------------------------------
20+
21+
# ----------------------------------------------------------------------------
22+
# Maven2 Start Up Batch script
23+
#
24+
# Required ENV vars:
25+
# ------------------
26+
# JAVA_HOME - location of a JDK home dir
27+
#
28+
# Optional ENV vars
29+
# -----------------
30+
# M2_HOME - location of maven2's installed home dir
31+
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
32+
# e.g. to debug Maven itself, use
33+
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34+
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35+
# ----------------------------------------------------------------------------
36+
37+
if [ -z "$MAVEN_SKIP_RC" ] ; then
38+
39+
if [ -f /etc/mavenrc ] ; then
40+
. /etc/mavenrc
41+
fi
42+
43+
if [ -f "$HOME/.mavenrc" ] ; then
44+
. "$HOME/.mavenrc"
45+
fi
46+
47+
fi
48+
49+
# OS specific support. $var _must_ be set to either true or false.
50+
cygwin=false;
51+
darwin=false;
52+
mingw=false
53+
case "`uname`" in
54+
CYGWIN*) cygwin=true ;;
55+
MINGW*) mingw=true;;
56+
Darwin*) darwin=true
57+
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58+
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59+
if [ -z "$JAVA_HOME" ]; then
60+
if [ -x "/usr/libexec/java_home" ]; then
61+
export JAVA_HOME="`/usr/libexec/java_home`"
62+
else
63+
export JAVA_HOME="/Library/Java/Home"
64+
fi
65+
fi
66+
;;
67+
esac
68+
69+
if [ -z "$JAVA_HOME" ] ; then
70+
if [ -r /etc/gentoo-release ] ; then
71+
JAVA_HOME=`java-config --jre-home`
72+
fi
73+
fi
74+
75+
if [ -z "$M2_HOME" ] ; then
76+
## resolve links - $0 may be a link to maven's home
77+
PRG="$0"
78+
79+
# need this for relative symlinks
80+
while [ -h "$PRG" ] ; do
81+
ls=`ls -ld "$PRG"`
82+
link=`expr "$ls" : '.*-> \(.*\)$'`
83+
if expr "$link" : '/.*' > /dev/null; then
84+
PRG="$link"
85+
else
86+
PRG="`dirname "$PRG"`/$link"
87+
fi
88+
done
89+
90+
saveddir=`pwd`
91+
92+
M2_HOME=`dirname "$PRG"`/..
93+
94+
# make it fully qualified
95+
M2_HOME=`cd "$M2_HOME" && pwd`
96+
97+
cd "$saveddir"
98+
# echo Using m2 at $M2_HOME
99+
fi
100+
101+
# For Cygwin, ensure paths are in UNIX format before anything is touched
102+
if $cygwin ; then
103+
[ -n "$M2_HOME" ] &&
104+
M2_HOME=`cygpath --unix "$M2_HOME"`
105+
[ -n "$JAVA_HOME" ] &&
106+
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107+
[ -n "$CLASSPATH" ] &&
108+
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109+
fi
110+
111+
# For Migwn, ensure paths are in UNIX format before anything is touched
112+
if $mingw ; then
113+
[ -n "$M2_HOME" ] &&
114+
M2_HOME="`(cd "$M2_HOME"; pwd)`"
115+
[ -n "$JAVA_HOME" ] &&
116+
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117+
# TODO classpath?
118+
fi
119+
120+
if [ -z "$JAVA_HOME" ]; then
121+
javaExecutable="`which javac`"
122+
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
123+
# readlink(1) is not available as standard on Solaris 10.
124+
readLink=`which readlink`
125+
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
126+
if $darwin ; then
127+
javaHome="`dirname \"$javaExecutable\"`"
128+
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
129+
else
130+
javaExecutable="`readlink -f \"$javaExecutable\"`"
131+
fi
132+
javaHome="`dirname \"$javaExecutable\"`"
133+
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
134+
JAVA_HOME="$javaHome"
135+
export JAVA_HOME
136+
fi
137+
fi
138+
fi
139+
140+
if [ -z "$JAVACMD" ] ; then
141+
if [ -n "$JAVA_HOME" ] ; then
142+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
143+
# IBM's JDK on AIX uses strange locations for the executables
144+
JAVACMD="$JAVA_HOME/jre/sh/java"
145+
else
146+
JAVACMD="$JAVA_HOME/bin/java"
147+
fi
148+
else
149+
JAVACMD="`which java`"
150+
fi
151+
fi
152+
153+
if [ ! -x "$JAVACMD" ] ; then
154+
echo "Error: JAVA_HOME is not defined correctly." >&2
155+
echo " We cannot execute $JAVACMD" >&2
156+
exit 1
157+
fi
158+
159+
if [ -z "$JAVA_HOME" ] ; then
160+
echo "Warning: JAVA_HOME environment variable is not set."
161+
fi
162+
163+
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
164+
165+
# traverses directory structure from process work directory to filesystem root
166+
# first directory with .mvn subdirectory is considered project base directory
167+
find_maven_basedir() {
168+
169+
if [ -z "$1" ]
170+
then
171+
echo "Path not specified to find_maven_basedir"
172+
return 1
173+
fi
174+
175+
basedir="$1"
176+
wdir="$1"
177+
while [ "$wdir" != '/' ] ; do
178+
if [ -d "$wdir"/.mvn ] ; then
179+
basedir=$wdir
180+
break
181+
fi
182+
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
183+
if [ -d "${wdir}" ]; then
184+
wdir=`cd "$wdir/.."; pwd`
185+
fi
186+
# end of workaround
187+
done
188+
echo "${basedir}"
189+
}
190+
191+
# concatenates all lines of a file
192+
concat_lines() {
193+
if [ -f "$1" ]; then
194+
echo "$(tr -s '\n' ' ' < "$1")"
195+
fi
196+
}
197+
198+
BASE_DIR=`find_maven_basedir "$(pwd)"`
199+
if [ -z "$BASE_DIR" ]; then
200+
exit 1;
201+
fi
202+
203+
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
204+
echo $MAVEN_PROJECTBASEDIR
205+
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
206+
207+
# For Cygwin, switch paths to Windows format before running java
208+
if $cygwin; then
209+
[ -n "$M2_HOME" ] &&
210+
M2_HOME=`cygpath --path --windows "$M2_HOME"`
211+
[ -n "$JAVA_HOME" ] &&
212+
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
213+
[ -n "$CLASSPATH" ] &&
214+
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
215+
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
216+
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
217+
fi
218+
219+
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
220+
221+
exec "$JAVACMD" \
222+
$MAVEN_OPTS \
223+
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
224+
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
225+
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

0 commit comments

Comments
 (0)