mirror of
https://github.com/chatopera/cosin.git
synced 2025-06-16 18:30:03 +08:00
#441 fix QList menu event
This commit is contained in:
parent
a28e57aa3a
commit
7991317457
@ -68,7 +68,7 @@ public class SystemEnvHelper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String parseFromApplicationProps(final String property) {
|
public static String parseFromApplicationProps(final String property) {
|
||||||
// 将 propert转化为环境变量
|
// 将 property 转化为环境变量
|
||||||
String P = StringUtils.upperCase(property);
|
String P = StringUtils.upperCase(property);
|
||||||
|
|
||||||
P = StringUtils.replaceChars(P, "-", "_");
|
P = StringUtils.replaceChars(P, "-", "_");
|
||||||
@ -82,14 +82,26 @@ public class SystemEnvHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记载application.properties
|
* Get properties filename
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static String getPropsFileName() {
|
||||||
|
String profile = getenv("SPRING_PROFILES_ACTIVE", "");
|
||||||
|
if (StringUtils.isNotBlank(profile)) {
|
||||||
|
return "application-" + profile + ".properties";
|
||||||
|
}
|
||||||
|
return "application.properties";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载 application.properties
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private static Properties getProps() {
|
private static Properties getProps() {
|
||||||
if (props == null) {
|
if (props == null) {
|
||||||
try (InputStream input = SystemEnvHelper.class.getClassLoader().getResourceAsStream(
|
try (InputStream input = SystemEnvHelper.class.getClassLoader().getResourceAsStream(
|
||||||
"application.properties")) {
|
getPropsFileName())) {
|
||||||
// load a properties file
|
// load a properties file
|
||||||
props = new Properties();
|
props = new Properties();
|
||||||
props.load(input);
|
props.load(input);
|
||||||
|
@ -561,11 +561,11 @@ html
|
|||||||
if (allowClick) {
|
if (allowClick) {
|
||||||
allowClick = false;
|
allowClick = false;
|
||||||
socket.emit('message', {
|
socket.emit('message', {
|
||||||
appid: "${appid!''}",
|
appid: "#{appid}",
|
||||||
userid: "${userid!''}",
|
userid: "#{userid}",
|
||||||
type: "message",
|
type: "message",
|
||||||
session: "${sessionid!''}",
|
session: "#{sessionid}",
|
||||||
orgi: "${orgi!''}",
|
orgi: "#{orgi}",
|
||||||
message: key
|
message: key
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -587,11 +587,11 @@ html
|
|||||||
var regClick = function (key) {
|
var regClick = function (key) {
|
||||||
btn.click(function () {
|
btn.click(function () {
|
||||||
socket.emit('message', {
|
socket.emit('message', {
|
||||||
appid: "${appid!''}",
|
appid: "#{appid}",
|
||||||
userid: "${userid!''}",
|
userid: "#{userid}",
|
||||||
type: "message",
|
type: "message",
|
||||||
session: "${sessionid!''}",
|
session: "#{sessionid}",
|
||||||
orgi: "${orgi!''}",
|
orgi: "#{orgi}",
|
||||||
message: key
|
message: key
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -629,7 +629,7 @@ html
|
|||||||
content = createCard(message, expmsg);
|
content = createCard(message, expmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
var box = $('<div class="chat-left"> <img class="user-img" src="<#if inviteData?? && inviteData.consult_dialog_headimg??>/res/image.html?id=${inviteData.consult_dialog_headimg?url}<#else>/images/agent.png</#if>" alt=""><div class="chat-message"><label class="user">' + username + '</label><label class="time">' + createtime + '</label> </div><div class="chatting-left"><i class="arrow"></i><div class="chat-content"></div></div>');
|
var box = $('<div class="chat-left"> <img class="user-img" src="#{dialog_headimg}" alt=""><div class="chat-message"><label class="user">' + username + '</label><label class="time">' + createtime + '</label> </div><div class="chatting-left"><i class="arrow"></i><div class="chat-content"></div></div>');
|
||||||
|
|
||||||
box.find('.chat-content').append(content);
|
box.find('.chat-content').append(content);
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ html
|
|||||||
content = createCard(message, expmsg);
|
content = createCard(message, expmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
var box = $('<div class="chat-left"> <img class="user-img" src="<#if inviteData?? && inviteData.consult_dialog_headimg??>/res/image.html?id=${inviteData.consult_dialog_headimg?url}<#else>/images/agent.png</#if>" alt=""><div class="chat-message"><label class="user">' + username + '</label><label class="time">' + createtime + '</label> </div><div class="chatting-left"><i class="arrow"></i><div class="chat-content"></div></div>');
|
var box = $('<div class="chat-left"> <img class="user-img" src="#{dialog_headimg}" alt=""><div class="chat-message"><label class="user">' + username + '</label><label class="time">' + createtime + '</label> </div><div class="chatting-left"><i class="arrow"></i><div class="chat-content"></div></div>');
|
||||||
|
|
||||||
box.find('.chat-content').append(content);
|
box.find('.chat-content').append(content);
|
||||||
|
|
||||||
@ -405,11 +405,11 @@ html
|
|||||||
var regClick = function (key) {
|
var regClick = function (key) {
|
||||||
btn.click(function () {
|
btn.click(function () {
|
||||||
socket.emit('message', {
|
socket.emit('message', {
|
||||||
appid: "${appid!''}",
|
appid: "#{appid}",
|
||||||
userid: "${userid!''}",
|
userid: "#{userid}",
|
||||||
type: "message",
|
type: "message",
|
||||||
session: "${sessionid!''}",
|
session: "#{sessionid}",
|
||||||
orgi: "${orgi!''}",
|
orgi: "#{orgi}",
|
||||||
message: key
|
message: key
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,48 @@
|
|||||||
# 春松客服插件
|
# 春松客服插件
|
||||||
|
|
||||||
此目录包含春松客服的开源的插件,每个插件授权参考各子目录。
|
本文件夹包含春松客服的开源的插件,每个插件授权参考各子目录。
|
||||||
|
|
||||||
|
## 规范
|
||||||
|
|
||||||
|
目前,春松客服插件安装是在命令行终端内完成:使用 Bash Shell 命令,链接插件源码到春松客服源码,然后编译打包 WAR 后得到插件功能。
|
||||||
|
|
||||||
|
> 提示:Windows 上使用 Git Bash 获得 Bash Shell, [https://git-scm.com/downloads](https://git-scm.com/downloads)。
|
||||||
|
|
||||||
|
不同的插件均遵循以下的规范。
|
||||||
|
|
||||||
|
### 插件安装
|
||||||
|
|
||||||
|
执行命令:
|
||||||
|
|
||||||
|
```
|
||||||
|
cd plugins/PLUGIN
|
||||||
|
./scripts/install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
其中,`PLUGIN` 是插件的名字。
|
||||||
|
|
||||||
|
### 卸载插件
|
||||||
|
|
||||||
|
执行命令:
|
||||||
|
|
||||||
|
```
|
||||||
|
cd plugins/PLUGIN
|
||||||
|
./scripts/uninstall.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## 应用打包
|
||||||
|
安装插件后,插件开发过程同[春松客服开发环境搭建](https://docs.chatopera.com/products/cskefu/osc/engineering.html)。
|
||||||
|
|
||||||
|
如果需要部署到系统测试、生产环境等,首先打包为 WAR 应用,方式如下:
|
||||||
|
|
||||||
|
```
|
||||||
|
cd contact-center
|
||||||
|
./admin/package.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
春松客服的发布形式为 Docker 镜像,如果在更改源码后,也可以使用春松客服的 Docker 镜像构建脚本发布,参考[构建脚本](https://github.com/chatopera/cskefu/blob/osc/contact-center/admin/build.sh)。
|
||||||
|
|
||||||
## 机器人客服
|
## 机器人客服
|
||||||
|
|
||||||
- [源码和安装说明](./chatbot)
|
- [源码和安装说明](./chatbot)
|
||||||
- [使用介绍](https://docs.chatopera.com/products/cskefu/work-chatbot.html)
|
- [使用介绍](https://docs.chatopera.com/products/cskefu/work-chatbot/index.html)
|
||||||
|
@ -121,7 +121,7 @@ public class ChatbotEventSubscription {
|
|||||||
JSONArray respParams = new JSONArray();
|
JSONArray respParams = new JSONArray();
|
||||||
if (!StringUtils.equals(MainContext.ChannelType.WEBIM.toString(), c.getChannel())) {
|
if (!StringUtils.equals(MainContext.ChannelType.WEBIM.toString(), c.getChannel())) {
|
||||||
if (data.getBoolean("logic_is_fallback")) {
|
if (data.getBoolean("logic_is_fallback")) {
|
||||||
if (StringUtils.equals(Constants.CHATBOT_CHATBOT_FIRST, c.getWorkmode())) {
|
if (!StringUtils.equals(Constants.CHATBOT_HUMAN_FIRST, c.getWorkmode())) {
|
||||||
JSONArray faqReplies = data.getJSONArray("faq");
|
JSONArray faqReplies = data.getJSONArray("faq");
|
||||||
JSONObject message = new JSONObject();
|
JSONObject message = new JSONObject();
|
||||||
JSONObject attachment = new JSONObject();
|
JSONObject attachment = new JSONObject();
|
||||||
@ -141,6 +141,10 @@ public class ChatbotEventSubscription {
|
|||||||
buttons.put(button);
|
buttons.put(button);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (StringUtils.equals(c.getWorkmode(), Constants.CHATBOT_CHATBOT_ONLY)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
payload.put("text", data.getString("string"));
|
payload.put("text", data.getString("string"));
|
||||||
JSONObject button = new JSONObject();
|
JSONObject button = new JSONObject();
|
||||||
button.put("type", "postback");
|
button.put("type", "postback");
|
||||||
@ -154,6 +158,10 @@ public class ChatbotEventSubscription {
|
|||||||
resp.setExpmsg(message.toString());
|
resp.setExpmsg(message.toString());
|
||||||
}
|
}
|
||||||
} else if (StringUtils.equals(Constants.PROVIDER_FAQ, data.getJSONObject("service").get("provider").toString())) {
|
} else if (StringUtils.equals(Constants.PROVIDER_FAQ, data.getJSONObject("service").get("provider").toString())) {
|
||||||
|
if (data.has("params")) {
|
||||||
|
resp.setMessage(data.getJSONArray("params").getJSONObject(0).getString("content"));
|
||||||
|
}
|
||||||
|
|
||||||
respHelp = creatChatMessage(request, c);
|
respHelp = creatChatMessage(request, c);
|
||||||
JSONObject message = new JSONObject();
|
JSONObject message = new JSONObject();
|
||||||
JSONObject attachment = new JSONObject();
|
JSONObject attachment = new JSONObject();
|
||||||
@ -175,6 +183,7 @@ public class ChatbotEventSubscription {
|
|||||||
payload.put("buttons", buttons);
|
payload.put("buttons", buttons);
|
||||||
attachment.put("payload", payload);
|
attachment.put("payload", payload);
|
||||||
message.put("attachment", attachment);
|
message.put("attachment", attachment);
|
||||||
|
|
||||||
respHelp.setExpmsg(message.toString());
|
respHelp.setExpmsg(message.toString());
|
||||||
} else if (data.has("params")) {
|
} else if (data.has("params")) {
|
||||||
Object obj = data.get("params");
|
Object obj = data.get("params");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user