From af11b72756a313fed9f1743bd2301921d21f350d Mon Sep 17 00:00:00 2001 From: Hai Liang Wang Date: Sat, 8 Sep 2018 00:19:08 +0800 Subject: [PATCH] =?UTF-8?q?#63=20=E5=88=9D=E5=A7=8B=E5=8C=96=20SDK=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cc-chatbot/.gitignore | 18 +++ cc-chatbot/README.md | 13 ++ cc-chatbot/admin/deploy.sh | 13 ++ cc-chatbot/admin/gen-idea.sh | 13 ++ cc-chatbot/admin/package.sh | 13 ++ cc-chatbot/app/pom.xml | 131 ++++++++++++++++++ .../main/java/com/chatopera/chatbot/App.java | 13 ++ cc-chatbot/app/src/site/site.xml | 26 ++++ .../java/com/chatopera/chatbot/AppTest.java | 38 +++++ 9 files changed, 278 insertions(+) create mode 100644 cc-chatbot/.gitignore create mode 100644 cc-chatbot/README.md create mode 100755 cc-chatbot/admin/deploy.sh create mode 100755 cc-chatbot/admin/gen-idea.sh create mode 100755 cc-chatbot/admin/package.sh create mode 100644 cc-chatbot/app/pom.xml create mode 100644 cc-chatbot/app/src/main/java/com/chatopera/chatbot/App.java create mode 100644 cc-chatbot/app/src/site/site.xml create mode 100644 cc-chatbot/app/src/test/java/com/chatopera/chatbot/AppTest.java diff --git a/cc-chatbot/.gitignore b/cc-chatbot/.gitignore new file mode 100644 index 00000000..f5d7ffde --- /dev/null +++ b/cc-chatbot/.gitignore @@ -0,0 +1,18 @@ +*.swp +*.swo +*.sublime-* +*.pyc +jmeter.log +__pycache__ +tmp/ +node_modules/ +sftp-config.json +.DS_Store +*.iml +*.ipr +*.iws +*.idea +~$*.xls* +~$*.ppt* +~$*.doc* +app/target/ diff --git a/cc-chatbot/README.md b/cc-chatbot/README.md new file mode 100644 index 00000000..366035b4 --- /dev/null +++ b/cc-chatbot/README.md @@ -0,0 +1,13 @@ +# cc-chatbot +Chatopera智能问答引擎的Java SDK. +https://docs.chatopera.com/ + +支持 + +* 创建聊天机器人 +* 查询聊天机器人列表 +* 更新聊天机器人画像 +* 查询聊天机器人使用情况 +* 管理和检索多轮对话 +* 管理和检索知识库 +* 检索意图识别 \ No newline at end of file diff --git a/cc-chatbot/admin/deploy.sh b/cc-chatbot/admin/deploy.sh new file mode 100755 index 00000000..e4ddd7a7 --- /dev/null +++ b/cc-chatbot/admin/deploy.sh @@ -0,0 +1,13 @@ +#! /bin/bash +########################################### +# +########################################### + +# constants +baseDir=$(cd `dirname "$0"`;pwd) +# functions + +# main +[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return +cd $baseDir/../app +mvn clean deploy -Dmaven.test.skip=true diff --git a/cc-chatbot/admin/gen-idea.sh b/cc-chatbot/admin/gen-idea.sh new file mode 100755 index 00000000..865f884c --- /dev/null +++ b/cc-chatbot/admin/gen-idea.sh @@ -0,0 +1,13 @@ +#! /bin/bash +########################################### +# +########################################### + +# constants +baseDir=$(cd `dirname "$0"`;pwd) +# functions + +# main +[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return +cd $baseDir/../app +mvn idea:idea diff --git a/cc-chatbot/admin/package.sh b/cc-chatbot/admin/package.sh new file mode 100755 index 00000000..fcd86068 --- /dev/null +++ b/cc-chatbot/admin/package.sh @@ -0,0 +1,13 @@ +#! /bin/bash +########################################### +# +########################################### + +# constants +baseDir=$(cd `dirname "$0"`;pwd) +# functions + +# main +[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return +cd $baseDir/../app +mvn package diff --git a/cc-chatbot/app/pom.xml b/cc-chatbot/app/pom.xml new file mode 100644 index 00000000..57ad6936 --- /dev/null +++ b/cc-chatbot/app/pom.xml @@ -0,0 +1,131 @@ + + + + 4.0.0 + + com.chatopera.chatbot + sdk + 1.0-SNAPSHOT + jar + + sdk + Java SDK for Chatopera Conversational Engine. + https://www.chatopera.com + + + UTF-8 + 1.8 + 1.8 + + + + + org.apache.commons + commons-lang3 + 3.0 + + + org.apache.httpcomponents + httpclient + 4.3.6 + + + org.apache.httpcomponents + httpasyncclient + 4.0.2 + + + org.apache.httpcomponents + httpmime + 4.3.6 + + + com.google.code.gson + gson + 2.8.1 + + + com.mashape.unirest + unirest-java + 1.4.9 + + + junit + junit + 3.8.1 + + + + + + + + maven-clean-plugin + 3.0.0 + + + maven-site-plugin + 3.7 + + + maven-project-info-reports-plugin + 2.9 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.7.0 + + + maven-surefire-plugin + 2.20.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + + + + chatopera + http://192.168.2.217:8029/repository/maven-snapshots/ + + + + + hain + Hai Liang Wang + hailiang.hl.wang@gmail.com + https://github.com/Samurais + Chatopera Inc. + http://www.chatopera.com + + architect + developer + + Asia/Shanghai + + + + + + maven-project-info-reports-plugin + + + + diff --git a/cc-chatbot/app/src/main/java/com/chatopera/chatbot/App.java b/cc-chatbot/app/src/main/java/com/chatopera/chatbot/App.java new file mode 100644 index 00000000..26eb6163 --- /dev/null +++ b/cc-chatbot/app/src/main/java/com/chatopera/chatbot/App.java @@ -0,0 +1,13 @@ +package com.chatopera.chatbot; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/cc-chatbot/app/src/site/site.xml b/cc-chatbot/app/src/site/site.xml new file mode 100644 index 00000000..1be54a63 --- /dev/null +++ b/cc-chatbot/app/src/site/site.xml @@ -0,0 +1,26 @@ + + + + + sdk + https://maven.apache.org/images/apache-maven-project.png + https://www.apache.org/ + + + + https://maven.apache.org/images/maven-logo-black-on-white.png + https://maven.apache.org/ + + + + org.apache.maven.skins + maven-fluido-skin + 1.7 + + + + + + + \ No newline at end of file diff --git a/cc-chatbot/app/src/test/java/com/chatopera/chatbot/AppTest.java b/cc-chatbot/app/src/test/java/com/chatopera/chatbot/AppTest.java new file mode 100644 index 00000000..65480485 --- /dev/null +++ b/cc-chatbot/app/src/test/java/com/chatopera/chatbot/AppTest.java @@ -0,0 +1,38 @@ +package com.chatopera.chatbot; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +}