diff --git a/WEB-INF/web.xml b/WEB-INF/web.xml
new file mode 100644
index 0000000..87c4aa6
--- /dev/null
+++ b/WEB-INF/web.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ org.springframework.web.context.ContextLoaderListener
+
+
+
+
+
+
+
diff --git a/chatbotbackend.iml b/chatbotbackend.iml
new file mode 100644
index 0000000..d0d10d3
--- /dev/null
+++ b/chatbotbackend.iml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config.properties b/config.properties
index ef5659e..aa9d2b4 100644
--- a/config.properties
+++ b/config.properties
@@ -1,24 +1,53 @@
-test_var=1111
+
+# qa问答地址
qa_url=http://192.168.1.78:59000/game
+# 中控url
cc_url=http://localhost:8070/api/update/data
-//condition_backend=http://192.168.1.82
+# condition后台url
+condition_backend_url=http://192.168.1.82:6636/api
+
+# 数据模型url
+automatch_url=http://dev01.centaurstech.com:5700/mermaid/?model=auto-train
+
+# action生成指定的后台地址
+service_url=http://192.168.1.178:8081/bot/dialog
+
+#
+#qa_url=http://localhost:59100/game
+#cc_url=http://localhost:8070/api/update/data
+#condition_backend_url=http://localhost:6636/api
+#automatch_url=http://dev01.centaurstech.com:5700/mermaid/?model=auto-train
+#service_url=http://localhost:8081/bot/dialog
+
+
+bot_backup_dir=tmp/
+config_dir=config/
unknown_text=不好意思,我没听懂你刚才说的话,请换个别的问题试试吧~哎呀,刚才开了小差,没理解你的意思,请换个问题吧~请根据上文信息,认真回答吧,谢谢~我们好像不在一个频道上,换个问题试试,希望我们能够接轨上吧
location_hint=请到%s
game_start_hint=请说开始剧情或者继续剧情
+game_welcome_text=欢迎来到%s,请说继续剧情或者重新开始
game_module_error=游戏模块出错
+program_error=程序出现异常
+intent_not_understand=我不理解
# -------------------------------游戏生成---------------------------
+token_time_out=token超时了
+game_bot_category=游戏
delete_old_config_term_error=删除旧数据config失败
delete_old_variable_error=删除旧变量失败
delete_old_category_error=删除旧类别失败
-# ----------------------------------------------------------------
+name_mission_error=没找到bot名?
+log_path=/var/www/html/logs/
+
+
+# ----------------------------------------------------------------
unknown_text_description=对于无法识别的问题做出的回答
game_step_description=QA问答游戏进度
@@ -41,6 +70,7 @@ plot_status=剧情%s状态
# ---------------------------------------------------
plot_generation_error=剧情接口处理出现异常
+action_text_generate_error=action生成失败
默认condition
default_condition=yaobuyao
@@ -74,26 +104,64 @@ task_description_slot=[任务描述]"
find_item_owner=[物品名]在[人名]身上
#----------------------------------------------
-# ---------------------文本解析---------------------
-text_parse_error=文本解析出错
-automatch_threshold=0.5
-game_condition_category=97
-service_url=http://192.168.1.178:8081/bot/dialog
+#--------------------condition文本默认配置--------------------------
+
options=disable_knowledge_qa,fast_understanding,pattern_cover,no_repeat
-automatch_url=http://dev01.centaurstech.com:5700/mermaid/?model=auto-train
-idlelimit=180000
-condition_generate_url=http://192.168.1.178:1111/conditionProcess
-condition_backend_url=http://192.168.1.82:6636/api
-style=interrupt,multimatchvalues,bothvalue
-fellow=pivot_httppost
+
+idle_limit=180000
+condition_fellow=pivot_httppost
+automatch_threshold=0.5
+default_style=style=interrupt,bothvalue,multimatchvalues
post_style1=style=httppost,bothvalue,multimatchvalues
post_style2=style=httppost,multimatchvalues
-post_action_head=#actions\r\nname=pivot_httppost\r\nstatus=waiting\r\n%s\r\nserviceURL=%s
+# ---------------------condition解析生成---------------------
+bot_info_not_exist=bot信息不存在
+conditon_backend_error=condition后台报错
+text_parse_error=文本解析出错
+
+game_condition_category=97
-# ----------------------condition增删改查异常----------------------------
+post_action_head=#actions\r\nname=pivot_httppost\r\nstatus=waiting\r\n%s\r\nserviceURL=%s\r\n
+
update_keyword_error=更新关键词单元失败
delete_user_data_error=删除用户数据失败
-game_condition_category_id=123
-platform_sql_init_error=新平台获取sql连接失败
\ No newline at end of file
+platform_sql_init_error=新平台获取sql连接失败
+
+json_format_error=json格式有误
+condition_insert_error=condition插入失败
+condition_update_error=condition更新失败
+
+condition_name_dumplicate=condition名字重复
+update_error=更新失败
+
+
+# --------------------------配置文件增删改查-----------------------------------
+config_pattern=%s|%s|%s|=>|%s|nextStep=%s|status=%s|configId=%s
+config_delete_error=删除配置文件失败
+condition_name_update_error=更新语义关系名字失败
+config_insert_error=插入配置文件失败
+config_file_not_found=没有找到配置文件
+
+
+# -------------------------配置文件类别操作-------------------------------------
+category_update_conflict="不可将父分组设为了当前分组的子分组"
+category_update_error="类别更新失败"
+category_insert_error="新建类别失败"
+category_delete_error="类别删除失败"
+category_query_error="类别查询失败"
+
+
+# -------------------------变量操作------------------------------------------
+variable_name_dumplicate=变量名重复
+varibale_insert_error=变量插入失败
+variable_delete_error=变量删除失败
+variable_update_error=变量更新失败
+variable_sql_delete_error=从数据库删除变量失败
+variable_save_format=-varInitial-|%s|%s\n
+extra_info_format=-extraInfo-|%s|%s\n
+variable_update_format=%s---%s
+
+# ---------------------------数据库连接获取失败--------------------------------
+sql_connection_error=数据库连接获取失败
diff --git a/keywords2.txt b/keywords2.txt
new file mode 100644
index 0000000..c42da21
--- /dev/null
+++ b/keywords2.txt
@@ -0,0 +1,202 @@
+
+
+# ------------------------------------------------------------------------------
+# 第一块,意图|相关的语义关系名
+意图语义关系名
+
+# 第二块, 意图|语义关系名|关键词
+
+
+# ------------------------------------------------------------------------------
+WHERE_I_AM|zainali|+在:哪里+在:哪儿+在:哪+在:位置+在:地点+在:地方+到:哪里+到:地点+到:地方
+WHERE_I_AM|wenzainali|+哪:qiwu+地方:qiwu+位置:qiwu+地点:qiwu+哪里:qiwu+哪儿:qiwu
+
+WHERE_CAN_I_GO|choose_gowhere|+哪里:qiwu+哪:qiwu+哪儿:qiwu+地方:qiwu+哪里:去+哪:能去+哪里:能去+哪儿:能去+地方:能去+地方:去+地方:能去+哪里:能去+哪:去+哪:能去+哪儿:去+哪:qiwu
+
+SURROUNDING_NPC|know_exist_what|+周围:人+附近:人+周围:谁+这里:谁+这里:人+有什么:人+里面:人+里面:谁+哪些:人+qiwu:人+qiwu:谁+有:谁+有:人
+SURROUNDING_THINGS|know_exist_what_mohu|+有什么:周围+有什么:附近+有什么:这里+有:哪些:这里+有谁:周围+有什么:里面
+SURROUNDING_NPC_CLASS|know_exist_what|+周围:name+附近:name
+SURROUNDING_ITEM|know_exist_what|+周围:name+附近:name
+SURROUNDING_PLACE|know_exist_what|+周围:地点+周围:地方+哪些:地方+哪些:地点
+SURROUNDING_ITEM_CLASS|know_exist_what|+周围:name+附近:name
+
+WHAT_ITEM_I_HAVE|know_exist_what_mohu|+有什么:qiwu+什么:qiwu+qiwu:东西+qiwu:地方
+WHO_IN_THERE|shishui|+谁:里面+里面:人
+
+GO_TO|yaobuyao|+去:name+到:name
+
+WHO_TO_FIND_NPC|xxx|+找到:name
+
+WHO_ARE_YOU|zhiwen|+botname:谁+botname:干嘛+那个人:谁+人:谁+botname:是+人:是
+TASK_IS_WHAT|shishenme|+是什么:任务+qiwu:任务
+
+FIND_NPC_LOCATION|xxx|+哪里:name+哪:name+地方:name+地点:name
+FIND_ITEM_LOCATION|xxx|+哪里:name+哪:name+地方:name+地点:name+位置:name+哪儿:name
+
+WHAT_NPC_IN_LOCATION|xxx|地点
+WAHT_ITEM_IN_LOCATION|xxx|地点
+WHAT_THINGS_IN_LOCATION|xxx|地点
+
+
+
+
+
+# --------------------------------------------------------------------------
+# 地图在哪里
+map_zainali|+在:哪里+在:哪儿+在:哪+在:位置+在:地点+在:地方+到:哪里+到:地点+到:地方
+map_wenzainali|+哪:qiwu+地方:qiwu+位置:qiwu+地点:qiwu+哪里:qiwu+哪儿:qiwu
+
+
+# 能去哪里
+map_choose_gowhere|+哪里:qiwu+哪:qiwu+哪儿:qiwu+地方:qiwu+哪里:去+哪:能去+哪里:能去+哪儿:能去+地方:能去+地方:去+地方:能去+哪里:能去+哪:去+哪:能去+哪儿:去+哪:qiwu
+
+# 周围有什么人
+people_know_exist_what|+周围:人+附近:人+周围:谁+这里:谁+这里:人+有什么:人+里面:人+里面:谁+哪些:人+qiwu:人+qiwu:谁+有:谁+有:人
+
+# 周围有什么物品
+item_know_exist_what|+周围:物品+周围:东西+附近:物品+附近:东西+这里:物品+这里:东西+有什么:东西+有什么:物品+哪些:物品+哪些:东西
+
+# 我有什么东西
+item_rencheng|+qiwu:东西
+
+# 我有什么
+we_have_know_exist_what_mohu|+有什么:qiwu+什么:qiwu+qiwu:东西+qiwu:地方
+
+# 里面的是谁
+inner_shishui|+谁:里面+里面:人
+
+# 去某个地方
+map_yaobuyao|+去:name+到:name
+
+# 你是谁
+talker_zhiwen|+botname:谁+botname:干嘛+那个人:谁+人:谁+botname:是+人:是
+
+# 任务是什么
+task_shishenme|+是什么:任务+qiwu:任务
+
+# 周围有什么
+things|know_exist_what_mohu|+有什么:周围+有什么:附近+有什么:这里+有:哪些:这里+有谁:周围+有什么:里面
+
+# 周围有什么地方
+place_know_exist_what|+周围:地点+周围:地方+哪些:地方+哪些:地点
+
+# 周围有什么npc类名
+npc_class_pattern|+周围:name+附近:name
+
+# 周围有什么item类名
+item_class_pattern|+周围:name+附近:name
+
+# 怎么找到xxx
+find_pattern|+找到:name
+
+# npc在哪里
+npc_location_pattern|+哪里:name+哪:name+地方:name+地点:name
+
+# 物品在哪里
+item_location_pattern|+哪里:name+哪:name+地方:name+地点:name+位置:name+哪儿:name
+
+# 某地点有什么
+things_in_place_xxxx|+地点:什么
+
+# 地点有什么人
+NPC_in_place_xxx|+地点:什么
+
+# 地点有什么物品
+items_in_place_xxx|+地点:什么
+
+# =====================================new add============================================
+people_rencheng|+机器人:谁+那个人:谁+人:谁+机器人:干嘛
+
+
+
+
+
+
+# ------------------------------------------------------------------------------
+# 格式
+# 意图|语义关系名字|关键词
+# name表示可以替换的名字,如物品名、角色名
+# attrName是属性名
+# qiwu就是玩家“我”
+
+
+
+# ------------------------------------------------------------------------------
+# 我在哪里
+WHERE_I_AM|zainali|+在:哪里+在:哪儿+在:哪+在:位置+在:地点+在:地方+到:哪里+到:地点+到:地方
+WHERE_I_AM|wenzainali|+哪:qiwu+地方:qiwu+位置:qiwu+地点:qiwu+哪里:qiwu+哪儿:qiwu
+
+# 我能去哪里
+WHERE_CAN_I_GO|choose_gowhere|+哪里:qiwu+哪:qiwu+哪儿:qiwu+地方:qiwu+哪里:去+哪:能去+哪里:能去+哪儿:能去+地方:能去+地方:去+地方:能去+哪里:能去+哪:去+哪:能去+哪儿:去+哪:qiwu
+
+# 周围有什么人
+AROUND_NPC|know_exist_what|+周围:人+附近:人+周围:谁+这里:谁+这里:人+有什么:人+里面:人+里面:谁+哪些:人+qiwu:人+qiwu:谁+有:谁+有:人
+
+# 周围有什么npc类别
+AROUND_NPC_CLASS|know_exist_what|+周围:name+附近:name
+
+# 周围有什么
+AROUND_THINGS|know_exist_what_mohu|+有什么:周围+有什么:附近+有什么:这里+有:哪些:这里+有谁:周围+有什么:里面
+
+# 周围有什么物品
+AROUND_ITEM|know_exist_what|+周围:物品+周围:东西+附近:物品+附近:东西+这里:物品+这里:东西+有什么:东西+有什么:物品+哪些:物品+哪些:东西
+
+# 周围有什么地方
+AROUND_PLACE|know_exist_what|+周围:地点+周围:地方+哪些:地方+哪些:地点
+
+# 周围有什么物品类别
+AROUND_ITEM_CLASS|know_exist_what|+周围:name+附近:name
+
+# 我有什么
+WHAT_ITEM_I_HAVE|know_exist_what_mohu|+有什么:qiwu+什么:qiwu+qiwu:东西+qiwu:地方
+
+# 里面有谁
+WHO_IN_THERE|shishui|+谁:里面+里面:人
+
+# 去xx
+GO_TO|yaobuyao|+去:name+到:name
+
+# 怎么找到NPC
+HOW_TO_FIND_NPC|xxx|+找到:name
+
+
+# 你是谁
+WHO_YOU_ARE|zhiwen|+botname:谁+botname:干嘛+那个人:谁+人:谁+botname:是+人:是
+
+# 任务是什么
+TASK_IS_WHAT|shishenme|+是什么:任务+qiwu:任务
+
+# npc在哪里
+NPC_LOCATION|wenzainali|+哪里:name+哪:name+地方:name+地点:name
+
+# 物品在哪里
+ITEM_LOCATION|wenzainali|+哪里:name+哪:name+地方:name+地点:name+位置:name+哪儿:name
+
+# 怎么找到npc
+HOW_FIND_NPC|want_know_zenmezuo|+找到:name
+#怎么找到物品
+HOW_FIND_ITEM|want_know_zenmezuo|+找到:name
+
+# 沙滩上有什么人
+WHAT_NPC_IN_LOCATION|xxx|地点
+
+# xx上有什么东西
+WAHT_ITEM_IN_LOCATION|xxx|地点
+
+# 地点上有什么
+WHAT_THINGS_IN_LOCATION|xxx|地点
+
+# npc的属性是多少
+NPC_ATTR|nums|+name:attrName
+NPC_ATTR|shishenme|+name:attrName
+
+# 物品的属性是多少
+ITEM_ATTR|nums|+name:attrName
+ITEM_ATTR|shishenme|+name:attrName
+
+# 周围有什么物品类别
+AOURND_NPC_CLASS|know_exist_what|+周围:name+附近:name
+
+# 怎么去XXX
+HOW_TO_THERE|want_know_zenmezuo|默认
+
diff --git a/mvnw b/mvnw
new file mode 100755
index 0000000..5551fde
--- /dev/null
+++ b/mvnw
@@ -0,0 +1,286 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven2 Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+ if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="`/usr/libexec/java_home`"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2_HOME=`cd "$M2_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --unix "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+ # TODO classpath?
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+ javaExecutable="`which javac`"
+ if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+ # readlink(1) is not available as standard on Solaris 10.
+ readLink=`which readlink`
+ if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+ if $darwin ; then
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+ else
+ javaExecutable="`readlink -f \"$javaExecutable\"`"
+ fi
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+ JAVA_HOME="$javaHome"
+ export JAVA_HOME
+ fi
+ fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="`which java`"
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly." >&2
+ echo " We cannot execute $JAVACMD" >&2
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+ if [ -z "$1" ]
+ then
+ echo "Path not specified to find_maven_basedir"
+ return 1
+ fi
+
+ basedir="$1"
+ wdir="$1"
+ while [ "$wdir" != '/' ] ; do
+ if [ -d "$wdir"/.mvn ] ; then
+ basedir=$wdir
+ break
+ fi
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+ if [ -d "${wdir}" ]; then
+ wdir=`cd "$wdir/.."; pwd`
+ fi
+ # end of workaround
+ done
+ echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+ if [ -f "$1" ]; then
+ echo "$(tr -s '\n' ' ' < "$1")"
+ fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+ exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
+ while IFS="=" read key value; do
+ case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+ esac
+ done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+
+ if command -v wget > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ wget "$jarUrl" -O "$wrapperJarPath"
+ elif command -v curl > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ curl -o "$wrapperJarPath" "$jarUrl"
+ else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Falling back to using Java to download"
+ fi
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+ echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
new file mode 100644
index 0000000..e5cfb0a
--- /dev/null
+++ b/mvnw.cmd
@@ -0,0 +1,161 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven2 Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
+FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ echo Found %WRAPPER_JAR%
+) else (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
+ echo Finished downloading %WRAPPER_JAR%
+)
+@REM End of extension
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%
diff --git a/pom.xml b/pom.xml
index 438dd0f..48c5c1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -98,6 +98,12 @@
1.5.0
+
+ commons-io
+ commons-io
+ 2.5
+
+
diff --git a/src/db/DBCPUtils.java b/src/db/DBCPUtils.java
deleted file mode 100644
index 4746731..0000000
--- a/src/db/DBCPUtils.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.qiwu.chatbotbackend.db;
-
-
-import org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory;
-
-import javax.sql.DataSource;
-import java.io.File;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Properties;
-
-
-public class DBCPUtils {
- private static DataSource ds;//定义一个连接池对象
-
- static {
- try {
- Properties pro = new Properties();
- File file = new File("dbcpconfig.properties");
- pro.load(DBCPUtils.class.getClassLoader().getResourceAsStream("dbcpconfig.properties"));
- ds = BasicDataSourceFactory.createDataSource(pro);//得到一个连接池对象
- } catch (Exception e) {
- e.printStackTrace();
- //throw new ExceptionInInitializerError("初始化连接错误,请检查配置文件!");
- }
- }
-
- //从池中获取一个连接
- public static Connection getConnection() throws SQLException {
- return ds.getConnection();
- }
-
- public static void closeAll(ResultSet rs, Statement stmt, Connection conn) {
- if (rs != null) {
- try {
- rs.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
-
- if (stmt != null) {
- try {
- stmt.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
-
- if (conn != null) {
- try {
- conn.close();//关闭
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/db/DBUtils.java b/src/db/DBUtils.java
deleted file mode 100644
index 5dc4aaa..0000000
--- a/src/db/DBUtils.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.qiwu.chatbotbackend.db;
-
-public class DBUtils {
-}
diff --git a/src/entity/AnswerNextStep.java b/src/entity/AnswerNextStep.java
deleted file mode 100644
index ecc898d..0000000
--- a/src/entity/AnswerNextStep.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package entity;
-
-
-/**
- * 包含后台返回数据的实体类。
- */
-public class AnswerNextStep {
- int status = 0;
- String answer;
- String next;
-
- public String getAnswer() {
- return answer;
- }
-
- public int getStatus() {
- return status;
- }
-
-
-
- public void setAnswer(String answer) {
- this.answer = answer;
- }
-
- public void setStatus(int status) {
- this.status = status;
- }
-
- public String getNext() {
- return next;
- }
-
- public void setNext(String next) {
- this.next = next;
- }
-
- public AnswerNextStep(int status, String answers, String next){
- this.answer = answers;
- this.next = next;
- this.status = status;
- }
- public AnswerNextStep(){}
-}
diff --git a/src/entity/ChatCache3.java b/src/entity/ChatCache3.java
deleted file mode 100644
index a0ce10a..0000000
--- a/src/entity/ChatCache3.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.qiwu.chatbotbackend.entity;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.ExecutionException;
-
-import com.qiwu.chatbotbackend.GameEnvironment.GameEnv;
-import com.qiwu.chatbotbackend.processing.ChatCacheController;
-import org.springframework.beans.factory.DisposableBean;
-
-
-import javax.annotation.PreDestroy;
-
-public class ChatCache3 implements DisposableBean {
-
-
-// private String chatKey = "不知道";
- private String chatKey = "";
- private String botAccount = "";
-
- private Map infoPoint = null;
- private GameEnv gameEnv = null;
- private boolean reloading = false;
-
-
- public String getBotAccount() {
- return botAccount;
- }
-
- public void setBotAccount(String botAccount) {
- this.botAccount = botAccount;
- }
-
- public boolean isReloading() {
- return reloading;
- }
-
-
- public void setReloading(boolean reloading) {
- this.reloading = reloading;
- }
-
- public Map getInfoPoint() {
- return infoPoint;
- }
-
- public void setInfoPoint(Map infoPoint) {
- this.infoPoint = infoPoint;
- }
-
- public GameEnv getGameEnv() {
- return gameEnv;
- }
-
- public void setGameEnv(GameEnv gameEnv) {
- this.gameEnv = gameEnv;
- }
-
- public ChatCache3(String chatKey, GameEnv gameEnv, Map infoPoint) {
- this.chatKey = chatKey;
- this.gameEnv = gameEnv;
- this.infoPoint = infoPoint;
- }
-
-
- @Override
- public void destroy() throws IOException {
- }
-
- public ChatCache3(UserInfo userInfo) throws Exception {
- try {
- gameEnv = new GameEnv(userInfo.botAccount);
- } catch (Exception e) {
- System.out.println("游戏平台初始化失败");
- e.printStackTrace();
- }
-
- String k;
- this.botAccount = userInfo.botAccount;
- infoPoint = new HashMap();
- Iterator iit = userInfo.varInitialMap.keySet().iterator();
- while (iit.hasNext()) {
- k = iit.next();
- infoPoint.put(k, userInfo.varInitialMap.get(k));
- }
- infoPoint.put("lastUpdateTime", String.valueOf(System.currentTimeMillis()));
-
- }
-
-
-}
diff --git a/src/entity/Condition.java b/src/entity/Condition.java
deleted file mode 100644
index bc78ed4..0000000
--- a/src/entity/Condition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.qiwu.chatbotbackend.entity;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-
-
-/**
- * 保存配置文件每一行(单行)解析后的信息的实体类。
- * 独立于引擎的另一种condition
- */
-public class Condition {
- public int priority = -1;
- public int activePriority = 0; //如果本condition被其他condition激活
- public int auxiliaryPriority = 0; //用于priority一样时人为设置的辅助优先级
- public HashSet keywordSet = new HashSet();
- public HashMap> historyPremise = new HashMap>();
- public HashMap> currentPremise = new HashMap>();
- public HashMap updateKnowledge = new LinkedHashMap();
- public String[] answer = {"",};
- public String nextStep = "";
- public HashMap featureMap = new HashMap();
- public String indexName = "";
- public int id = 0;
- public String configName = "";
- public String status = "waiting";
- //public ArrayList indexName = new ArrayList();
-
- public Condition(int priority) {
- this.priority = priority;
- this.activePriority = priority;
- }
-
- public Condition(Condition originCondition, int basePriority, int baseAuxiliaryPriority) {
- this.priority = originCondition.priority;
- this.keywordSet = originCondition.keywordSet;
- this.historyPremise = originCondition.historyPremise;
- this.currentPremise = originCondition.currentPremise;
- this.answer = originCondition.answer;
- this.nextStep = originCondition.nextStep;
- this.featureMap = originCondition.featureMap;
- this.updateKnowledge = originCondition.updateKnowledge;
- this.indexName = originCondition.indexName;
- this.id = originCondition.id;
- this.configName = originCondition.configName;
- this.status = originCondition.status;
- this.activePriority = originCondition.activePriority + basePriority;
- this.auxiliaryPriority = originCondition.auxiliaryPriority + baseAuxiliaryPriority;
- }
-
- public Condition() {
- }
-
-}
diff --git a/src/entity/ConfigTerm.java b/src/entity/ConfigTerm.java
deleted file mode 100644
index a1f3725..0000000
--- a/src/entity/ConfigTerm.java
+++ /dev/null
@@ -1,531 +0,0 @@
-package com.qiwu.chatbotbackend.entity;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-public class ConfigTerm implements Cloneable{
-
- ThreadLocal iterNum=new ThreadLocal() {
- protected Integer initialValue() {
- return 0;
- }
- };
- ThreadLocal