mirror of
https://github.com/chatopera/cosin.git
synced 2025-06-16 18:30:03 +08:00
Merge branch 'develop' of github.com:cskefu/cskefu into develop
This commit is contained in:
commit
d6e205dda9
@ -54,7 +54,7 @@ public class AgentAuditSubscription {
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
@JmsListener(destination = Constants.AUDIT_AGENT_MESSAGE, containerFactory = "jmsListenerContainerTopic")
|
||||
@JmsListener(destination = "${cskefu.activemq.destination.prefix}" + Constants.AUDIT_AGENT_MESSAGE + "${cskefu.activemq.destination.suffix}", containerFactory = "jmsListenerContainerTopic")
|
||||
public void onMessage(final String msg) {
|
||||
logger.info("[onMessage] payload {}", msg);
|
||||
try {
|
||||
|
@ -31,7 +31,7 @@ public class AgentSessionSubscription {
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
@JmsListener(destination = Constants.MQ_TOPIC_WEB_SESSION_SSO, containerFactory = "jmsListenerContainerTopic")
|
||||
@JmsListener(destination = "${cskefu.activemq.destination.prefix}" + Constants.MQ_TOPIC_WEB_SESSION_SSO + "${cskefu.activemq.destination.suffix}", containerFactory = "jmsListenerContainerTopic")
|
||||
public void onMessage(final String msg) {
|
||||
logger.info("[onMessage] payload {}", msg);
|
||||
try {
|
||||
|
@ -48,7 +48,7 @@ public class AgentSubscription {
|
||||
brokerPublisher.send(Constants.INSTANT_MESSAGING_MQ_TOPIC_AGENT, j.toString(), true);
|
||||
}
|
||||
|
||||
@JmsListener(destination = Constants.INSTANT_MESSAGING_MQ_TOPIC_AGENT, containerFactory = "jmsListenerContainerTopic")
|
||||
@JmsListener(destination = "${cskefu.activemq.destination.prefix}" + Constants.INSTANT_MESSAGING_MQ_TOPIC_AGENT + "${cskefu.activemq.destination.suffix}", containerFactory = "jmsListenerContainerTopic")
|
||||
public void onMessage(final String payload) {
|
||||
logger.info("[onMessage] payload {}", payload);
|
||||
JsonParser parser = new JsonParser();
|
||||
|
@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd.
|
||||
* <https://www.chatopera.com>, Licensed under the Chunsong Public
|
||||
/*
|
||||
* Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd.
|
||||
* <https://www.chatopera.com>, Licensed under the Chunsong Public
|
||||
* License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html
|
||||
* 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.
|
||||
* Copyright (C) 2019-2022 Chatopera Inc, <https://www.chatopera.com>,
|
||||
* Licensed under the Apache License, Version 2.0,
|
||||
* Copyright (C) 2019-2022 Chatopera Inc, <https://www.chatopera.com>,
|
||||
* Licensed under the Apache License, Version 2.0,
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
package com.cskefu.cc.activemq;
|
||||
@ -43,7 +43,7 @@ public class BlackListEventSubscription {
|
||||
*
|
||||
* @param payload
|
||||
*/
|
||||
@JmsListener(destination = Constants.WEBIM_SOCKETIO_ONLINE_USER_BLACKLIST, containerFactory = "jmsListenerContainerQueue")
|
||||
@JmsListener(destination = "${cskefu.activemq.destination.prefix}" + Constants.WEBIM_SOCKETIO_ONLINE_USER_BLACKLIST + "${cskefu.activemq.destination.suffix}", containerFactory = "jmsListenerContainerQueue")
|
||||
public void onMessage(final String payload) {
|
||||
logger.info("[onMessage] payload {}", payload);
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd.
|
||||
* <https://www.chatopera.com>, Licensed under the Chunsong Public
|
||||
/*
|
||||
* Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd.
|
||||
* <https://www.chatopera.com>, Licensed under the Chunsong Public
|
||||
* License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html
|
||||
* 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.
|
||||
* Copyright (C) 2019-2022 Chatopera Inc, All rights reserved.
|
||||
* Copyright (C) 2019-2022 Chatopera Inc, All rights reserved.
|
||||
* <https://www.chatopera.com>
|
||||
*/
|
||||
|
||||
@ -20,10 +20,8 @@ import org.apache.activemq.command.ActiveMQTopic;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jms.core.JmsMessagingTemplate;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.core.MessagePostProcessor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
@ -35,6 +33,10 @@ public class BrokerPublisher {
|
||||
|
||||
@Autowired
|
||||
private JmsTemplate jmsTemplate;
|
||||
@Value("${cskefu.activemq.destination.prefix}")
|
||||
private String prefix;
|
||||
@Value("${cskefu.activemq.destination.suffix}")
|
||||
private String suffix;
|
||||
|
||||
@PostConstruct
|
||||
public void setup() {
|
||||
@ -48,17 +50,18 @@ public class BrokerPublisher {
|
||||
* @param payload
|
||||
* @param delay available by delayed seconds
|
||||
*/
|
||||
public void send(final String destination, final String payload, final boolean isTopic, final int delay) {
|
||||
public void send(String destination, final String payload, final boolean isTopic, final int delay) {
|
||||
destination = prefix + destination + suffix;
|
||||
try {
|
||||
if (isTopic) {
|
||||
jmsTemplate.convertAndSend(new ActiveMQTopic(destination), payload, m -> {
|
||||
m.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, 1000 * delay);
|
||||
m.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, 1000L * delay);
|
||||
return m;
|
||||
});
|
||||
} else {
|
||||
// 默认为Queue
|
||||
jmsTemplate.convertAndSend(destination, payload, m -> {
|
||||
m.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, 1000 * delay);
|
||||
m.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, 1000L * delay);
|
||||
return m;
|
||||
});
|
||||
}
|
||||
@ -73,7 +76,8 @@ public class BrokerPublisher {
|
||||
* @param payload
|
||||
* @param isTopic
|
||||
*/
|
||||
public void send(final String destination, final String payload, boolean isTopic) {
|
||||
public void send(String destination, final String payload, boolean isTopic) {
|
||||
destination = prefix + destination + suffix;
|
||||
try {
|
||||
if (isTopic) {
|
||||
jmsTemplate.convertAndSend(new ActiveMQTopic(destination), payload);
|
||||
|
@ -17,6 +17,7 @@ import com.cskefu.cc.socketio.client.NettyClients;
|
||||
import com.cskefu.cc.util.SerializeUtil;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -24,8 +25,6 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jms.annotation.JmsListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
* IM OnlineUser
|
||||
*/
|
||||
@ -57,7 +56,7 @@ public class OnlineUserSubscription {
|
||||
|
||||
}
|
||||
|
||||
@JmsListener(destination = Constants.INSTANT_MESSAGING_MQ_TOPIC_ONLINEUSER, containerFactory = "jmsListenerContainerTopic")
|
||||
@JmsListener(destination = "${cskefu.activemq.destination.prefix}" + Constants.INSTANT_MESSAGING_MQ_TOPIC_ONLINEUSER + "${cskefu.activemq.destination.suffix}", containerFactory = "jmsListenerContainerTopic")
|
||||
public void onMessage(final String payload){
|
||||
logger.info("[onMessage] payload {}", payload);
|
||||
JsonParser parser = new JsonParser();
|
||||
|
@ -22,6 +22,7 @@ import com.cskefu.cc.model.AgentStatus;
|
||||
import com.cskefu.cc.persistence.repository.AgentStatusRepository;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -29,7 +30,6 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jms.annotation.JmsListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -60,7 +60,7 @@ public class SocketioConnEventSubscription {
|
||||
logger.info("ActiveMQ Subscription is setup successfully.");
|
||||
}
|
||||
|
||||
@JmsListener(destination = Constants.WEBIM_SOCKETIO_AGENT_DISCONNECT, containerFactory = "jmsListenerContainerQueue")
|
||||
@JmsListener(destination = "${cskefu.activemq.destination.prefix}" + Constants.WEBIM_SOCKETIO_AGENT_DISCONNECT + "${cskefu.activemq.destination.suffix}", containerFactory = "jmsListenerContainerQueue")
|
||||
public void onMessage(final String payload) {
|
||||
logger.info("[onMessage] payload {}", payload);
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class ChatbotEventSubscription {
|
||||
*
|
||||
* @param payload
|
||||
*/
|
||||
@JmsListener(destination = Constants.INSTANT_MESSAGING_MQ_QUEUE_CHATBOT, containerFactory = "jmsListenerContainerQueue")
|
||||
@JmsListener(destination = "${cskefu.activemq.destination.prefix}" + Constants.INSTANT_MESSAGING_MQ_QUEUE_CHATBOT + "${cskefu.activemq.destination.suffix}", containerFactory = "jmsListenerContainerQueue")
|
||||
public void onMessage(final String payload) {
|
||||
ChatMessage message = SerializeUtil.deserialize(payload);
|
||||
try {
|
||||
@ -238,7 +238,7 @@ public class ChatbotEventSubscription {
|
||||
for (int i = 0; i < faqReplies.length(); i++) {
|
||||
JSONObject sugg = new JSONObject();
|
||||
JSONObject faqReply = faqReplies.getJSONObject(i);
|
||||
sugg.put("label", Integer.toString(i + 1) + ". " + faqReply.getString("post"));
|
||||
sugg.put("label", i + 1 + ". " + faqReply.getString("post"));
|
||||
sugg.put("text", faqReply.getString("post"));
|
||||
sugg.put("type", "qlist");
|
||||
suggs.put(sugg);
|
||||
|
@ -43,7 +43,7 @@ public class MessengerEventSubscription {
|
||||
@Autowired
|
||||
private MessengerMessageProxy messengerMessageProxy;
|
||||
|
||||
@JmsListener(destination = Constants.INSTANT_MESSAGING_MQ_QUEUE_FACEBOOK_OTN, containerFactory = "jmsListenerContainerQueue")
|
||||
@JmsListener(destination = "${cskefu.activemq.destination.prefix}" + Constants.INSTANT_MESSAGING_MQ_QUEUE_FACEBOOK_OTN + "${cskefu.activemq.destination.suffix}", containerFactory = "jmsListenerContainerQueue")
|
||||
public void onPublish(final String jsonStr) {
|
||||
JSONObject payload = JSONObject.parseObject(jsonStr);
|
||||
String otnId = payload.getString("otnId");
|
||||
|
@ -109,6 +109,9 @@ spring.activemq.user=admin
|
||||
spring.activemq.password=admin
|
||||
spring.activemq.pool.enabled=true
|
||||
spring.activemq.pool.max-connections=50
|
||||
# 使用前后缀来避免不同 profile 共用 ActiveMQ 实例引发的消息路由错乱问题
|
||||
cskefu.activemq.destination.prefix=
|
||||
cskefu.activemq.destination.suffix=
|
||||
|
||||
##############################################
|
||||
# Actuator
|
||||
@ -179,4 +182,4 @@ telemetry.channel.webim.visitor=on
|
||||
extras.login.banner=off
|
||||
extras.login.chatbox=off
|
||||
extras.auth.super-admin.pass=
|
||||
extras.log.request=off
|
||||
extras.log.request=off
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -77,7 +77,7 @@ block content
|
||||
.box-item
|
||||
.row
|
||||
.col-lg-12
|
||||
textarea.layui-input(name="dialog_message", autocomplete="off", oninput="$('#dialog_message').text($(this).val())", style="height:60px;line-height:22px;")= inviteData.dialog_message ? inviteData.dialog_message : '欢迎使用春松客服!如需帮助请联系 info@chatopera.com'
|
||||
textarea.layui-input(name="dialog_message", autocomplete="off", oninput="$('#dialog_message').text($(this).val())", style="height:60px;line-height:22px;", placeholder="欢迎使用春松客服!如需帮助请联系 info@chatopera.com")= inviteData.dialog_message
|
||||
.ukefu-webim-prop
|
||||
.ukefu-webim-tl 7、自定义形象图片 (建议尺寸:276*236)
|
||||
.box-item(style="position: relative;")
|
||||
@ -329,7 +329,8 @@ block content
|
||||
span(style="float:right;")
|
||||
i.layui-icon(style="font:size:12px;color:#ffffff;") ဆ
|
||||
.ukefu-im-preview-wrap(style="border:1px solid #EAEAEA")
|
||||
#dialog_message.ukefu-im-preview-tip(style="width:90%;height:5px;font-size:12px;height:32px;overflow:hidden;border-radius: 10px;padding: 2px 10px 2px 10px;")= inviteData.dialog_message ? inviteData.dialog_message : '欢迎您来咨询!欢迎使用春松客服!如需帮助请联系 info@chatopera.com'
|
||||
if inviteData.dialog_message != null && !inviteData.dialog_message.trim().isEmpty()
|
||||
#dialog_message.ukefu-im-preview-tip(style="width:90%;height:5px;font-size:12px;height:32px;overflow:hidden;border-radius: 10px;padding: 2px 10px 2px 10px;")= inviteData.dialog_message ? inviteData.dialog_message : '欢迎您来咨询!欢迎使用春松客服!如需帮助请联系 info@chatopera.com'
|
||||
.ukefu-im-preview-customer
|
||||
i.layui-icon(style="color:#377FED;float:left;")
|
||||
.ukefu-im-preview-customer-message.ukefu-im-preview-customer-arrow
|
||||
|
@ -605,6 +605,7 @@ html
|
||||
//- 按钮
|
||||
p.submitBtnWrap(style='margin-top: 0px')
|
||||
input.btn.submitBtn#submitBtn(type='submit', value='提 交')
|
||||
input.btn.cancelBtn#cancelBtn(value='取 消', onclick='popup(\"none\")')
|
||||
|
||||
script.
|
||||
var service_end = false;
|
||||
|
@ -63,7 +63,7 @@ html
|
||||
|
||||
items: items,
|
||||
htmlTags: {
|
||||
img: ['src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
|
||||
img: ['src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
|
||||
br: []
|
||||
},
|
||||
afterChange: function () {
|
||||
@ -100,9 +100,9 @@ html
|
||||
socket.emit('message', {
|
||||
appid: "#{appid}",
|
||||
userid: "#{userid}",
|
||||
type: "writing",
|
||||
type: "writing",
|
||||
session: "#{sessionid}",
|
||||
message: strValue
|
||||
message: strValue
|
||||
});
|
||||
}
|
||||
words = this.count("text");
|
||||
@ -327,7 +327,7 @@ html
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "/im/image/upload.html?userid=#{userid}",
|
||||
data: form,
|
||||
data: form,
|
||||
processData: false,
|
||||
contentType: false
|
||||
}).done(function (data) {
|
||||
@ -375,8 +375,9 @@ html
|
||||
div(style="padding:0px 5px 10px 5px;border-bottom:1px solid #dedede;")
|
||||
a#point_ad_text(href=welcomeAd.url, title=welcomeAd.tiptext, target="_blank")= welcomeAd.content
|
||||
|
||||
.clearfix.message.welcome
|
||||
span#welcome-message= inviteData.dialog_message ? inviteData.dialog_message : '欢迎您来咨询!欢迎使用 Chatopera 云服务!如需帮助请联系 info@chatopera.com'
|
||||
if inviteData.dialog_message != null && !inviteData.dialog_message.trim().isEmpty()
|
||||
.clearfix.message.welcome
|
||||
span#welcome-message= inviteData.dialog_message ? inviteData.dialog_message : '欢迎您来咨询!欢迎使用 Chatopera 云服务!如需帮助请联系 info@chatopera.com'
|
||||
|
||||
if sessionConfig && sessionConfig.sessionmsg
|
||||
div(style='text-align:center;')
|
||||
@ -498,6 +499,7 @@ html
|
||||
//- 按钮
|
||||
p.submitBtnWrap(style='margin-top: 0px')
|
||||
input.btn.submitBtn#submitBtn(type='submit', value='提 交')
|
||||
input.btn.cancelBtn#cancelBtn(value='取 消', onclick='popup(\"none\")')
|
||||
|
||||
script.
|
||||
function chatScorllBottom(box) {
|
||||
@ -639,9 +641,9 @@ html
|
||||
socket.emit('message', {
|
||||
appid: "#{appid}",
|
||||
userid: "#{userid}",
|
||||
type: "message",
|
||||
type: "message",
|
||||
session: "#{sessionid}",
|
||||
message: message
|
||||
message: message
|
||||
});
|
||||
}
|
||||
} else if (service_end == true) {
|
||||
|
@ -217,8 +217,11 @@ html
|
||||
else
|
||||
div(style="padding:0px 5px 10px 5px;border-bottom:1px solid #dedede;")
|
||||
a#point_ad_text(href=welcomeAd.url, title=welcomeAd.tiptext, target="_blank")= welcomeAd.content
|
||||
.clearfix.message.welcome
|
||||
span#welcome-message= inviteData.dialog_message ? inviteData.dialog_message : '欢迎您来咨询!欢迎使用 Chatopera 云服务!如需帮助请联系 info@chatopera.com'
|
||||
|
||||
if inviteData.dialog_message != null && !inviteData.dialog_message.trim().isEmpty()
|
||||
.clearfix.message.welcome
|
||||
span#welcome-message= inviteData.dialog_message ? inviteData.dialog_message : '欢迎您来咨询!欢迎使用 Chatopera 云服务!如需帮助请联系 info@chatopera.com'
|
||||
|
||||
for chatMessage in pugHelper.reverse(chatMessageList.content)
|
||||
if chatMessage.userid && userid && chatMessage.calltype && chatMessage.calltype == "呼入"
|
||||
.clearfix.chat-block
|
||||
@ -302,6 +305,7 @@ html
|
||||
// 按钮
|
||||
p.submitBtnWrap(style='background:#fff;position: fixed;bottom: 0px;left:0px;width: 100%;height:100px;padding-right: 0px;margin-bottom: 0px;z-index: 10')
|
||||
input.btn.submitBtn#submitBtn(type='submit', style='width: 85% !important;display: block;margin: 0 auto;', value='提 交')
|
||||
input.btn.cancelBtn#cancelBtn(style='width: 85% !important;display: block;margin: 0 auto;', value='取 消', onclick='popup(\'none\')',)
|
||||
script.
|
||||
var service_end = false;
|
||||
// 调查问卷
|
||||
@ -587,7 +591,7 @@ html
|
||||
channel: "webim",
|
||||
type: "message",
|
||||
contextid: "#{sessionid}",
|
||||
message: message
|
||||
message:message
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user