1
0
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:
Hai Liang Wang 2018-09-21 11:03:29 +08:00
parent 56f4266c17
commit 7bda8563b5
2 changed files with 3 additions and 3 deletions

View File

@ -474,14 +474,14 @@ public class ApiChatbotController extends Handler {
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_ERROR, "不合法的参数,未传入有效【snsid】。");
resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入【snsid】。");
return resp;
} else {
snsid = j.get("snsid").getAsString();
// #TODO 仅支持webim
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_ERROR, "不合法的参数,未传入有效【snsid】");
resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,不存在【snsid】对应的网站渠道");
return resp;
}

View File

@ -38,7 +38,7 @@ public class ChatbotUtils {
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 String SNS_TYPE_WEBIM = "app";
public static final String SNS_TYPE_WEBIM = "webim";
private static ChatbotRepository chatbotRes;