From 771f2735463ca47c9891330b73eea03d18288b73 Mon Sep 17 00:00:00 2001 From: mukaiu Date: Mon, 24 Sep 2018 19:50:03 +0800 Subject: [PATCH] =?UTF-8?q?#70=20=E6=94=AF=E6=8C=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/chatbot/ChatbotController.java | 70 ++++++++ .../templates/apps/chatbot/edit.html | 165 ++++++++++++++++++ .../templates/apps/chatbot/index.html | 129 ++++++++++++++ .../main/resources/templates/apps/index.html | 9 + 4 files changed, 373 insertions(+) create mode 100644 contact-center/app/src/main/java/com/chatopera/cc/app/handler/apps/chatbot/ChatbotController.java create mode 100644 contact-center/app/src/main/resources/templates/apps/chatbot/edit.html create mode 100644 contact-center/app/src/main/resources/templates/apps/chatbot/index.html diff --git a/contact-center/app/src/main/java/com/chatopera/cc/app/handler/apps/chatbot/ChatbotController.java b/contact-center/app/src/main/java/com/chatopera/cc/app/handler/apps/chatbot/ChatbotController.java new file mode 100644 index 00000000..d6959a3c --- /dev/null +++ b/contact-center/app/src/main/java/com/chatopera/cc/app/handler/apps/chatbot/ChatbotController.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2018 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +package com.chatopera.cc.app.handler.apps.chatbot; + +import com.chatopera.cc.app.handler.Handler; +import com.chatopera.cc.app.model.Chatbot; +import com.chatopera.cc.app.model.SNSAccount; +import com.chatopera.cc.app.model.User; +import com.chatopera.cc.app.persistence.repository.ChatbotRepository; +import com.chatopera.cc.app.persistence.repository.SNSAccountRepository; +import com.chatopera.cc.util.Menu; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; + +@Controller +@RequestMapping(value = "/apps/chatbot") +public class ChatbotController extends Handler { + @Autowired + private ChatbotRepository chatbotRes; + + @Autowired + private SNSAccountRepository snsAccountRes; + + @RequestMapping(value = "/index") + @Menu(type = "chatbot", subtype = "index", access = true) + public ModelAndView index(ModelMap map, HttpServletRequest request) { + + return request(super.createAppsTempletResponse("/apps/chatbot/index")); + } + + @RequestMapping(value = "/edit") + @Menu(type = "chatbot", subtype = "index", access = true) + public ModelAndView eidt(ModelMap map, HttpServletRequest request, @Valid String id) { + User curruser = super.getUser(request); + + ModelAndView view = request(super.createAppsTempletResponse("/apps/chatbot/edit")); + if (id != null) { + Chatbot c = chatbotRes.findOne(id); + SNSAccount snsAccount = snsAccountRes.findBySnsidAndOrgi(c.getSnsAccountIdentifier(), curruser.getOrgi()); + view.addObject("snsurl", snsAccount.getBaseURL()); + view.addObject("bot", c); + } + + view.addObject("id", id); + + return view; + } +} + + diff --git a/contact-center/app/src/main/resources/templates/apps/chatbot/edit.html b/contact-center/app/src/main/resources/templates/apps/chatbot/edit.html new file mode 100644 index 00000000..bc6bcc0f --- /dev/null +++ b/contact-center/app/src/main/resources/templates/apps/chatbot/edit.html @@ -0,0 +1,165 @@ + +
+
+

机器人列表

+
+
+
+
+
+
+ +
+ +
+ <#if id!=null> + + <#else> + + +
+
+
+ +
+ disabled> +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/chatbot/index.html b/contact-center/app/src/main/resources/templates/apps/chatbot/index.html new file mode 100644 index 00000000..83a8a390 --- /dev/null +++ b/contact-center/app/src/main/resources/templates/apps/chatbot/index.html @@ -0,0 +1,129 @@ + +
+
+
+

机器人列表 +
+ +
+

+
+
+
+
+ + + + + + + + + + + +
机器人名称网站渠道是否开启操作
+
+
+
+ \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/index.html b/contact-center/app/src/main/resources/templates/apps/index.html index 02e8234a..7898d9b7 100644 --- a/contact-center/app/src/main/resources/templates/apps/index.html +++ b/contact-center/app/src/main/resources/templates/apps/index.html @@ -317,6 +317,15 @@ + <#if models?? && models["sales"]?? && models["sales"] == true> + <#if user?? &&( user.roleAuthMap["A11"]?? || user.usertype == "0") > +
+ + + +
+ + <#if models?? && models["callcenter"]?? && models["callcenter"] == true> <#if user?? && (user.roleAuthMap["A10"]?? || user.usertype == "0") >