mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
#74 fix chatbot creation error
This commit is contained in:
parent
56f4266c17
commit
7bda8563b5
@ -474,14 +474,14 @@ public class ApiChatbotController extends Handler {
|
|||||||
|
|
||||||
if ((!j.has("snsid")) || StringUtils.isBlank(j.get("snsid").getAsString())) {
|
if ((!j.has("snsid")) || StringUtils.isBlank(j.get("snsid").getAsString())) {
|
||||||
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3);
|
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3);
|
||||||
resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入有效【snsid】。");
|
resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入【snsid】。");
|
||||||
return resp;
|
return resp;
|
||||||
} else {
|
} else {
|
||||||
snsid = j.get("snsid").getAsString();
|
snsid = j.get("snsid").getAsString();
|
||||||
// #TODO 仅支持webim
|
// #TODO 仅支持webim
|
||||||
if (!snsAccountRes.existsBySnsidAndSnstypeAndOrgi(snsid, ChatbotUtils.SNS_TYPE_WEBIM, orgi)) {
|
if (!snsAccountRes.existsBySnsidAndSnstypeAndOrgi(snsid, ChatbotUtils.SNS_TYPE_WEBIM, orgi)) {
|
||||||
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3);
|
resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3);
|
||||||
resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入有效【snsid】。");
|
resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,不存在【snsid】对应的网站渠道。");
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public class ChatbotUtils {
|
|||||||
public static final String HUMAN_FIRST = "人工客服优先";
|
public static final String HUMAN_FIRST = "人工客服优先";
|
||||||
public static final HashSet<String> VALID_WORKMODELS = new HashSet<String>(Arrays.asList(new String[]{CHATBOT_FIRST, HUMAN_FIRST}));
|
public static final HashSet<String> VALID_WORKMODELS = new HashSet<String>(Arrays.asList(new String[]{CHATBOT_FIRST, HUMAN_FIRST}));
|
||||||
|
|
||||||
public static final String SNS_TYPE_WEBIM = "app";
|
public static final String SNS_TYPE_WEBIM = "webim";
|
||||||
|
|
||||||
private static ChatbotRepository chatbotRes;
|
private static ChatbotRepository chatbotRes;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user