From c6c1c001417136a88432baafb30628db9cf79690 Mon Sep 17 00:00:00 2001 From: mlogclub Date: Sat, 23 May 2026 22:30:30 +0800 Subject: [PATCH] feat: add dashboard handlers for roles, sessions, skill definitions, tags, tickets, users, and WeChat integration - Implement role management endpoints including listing, creating, updating, and deleting roles. - Add session management endpoints for viewing and revoking sessions. - Create skill definition management endpoints for CRUD operations and status updates. - Introduce tag management endpoints for handling tags with sorting and status updates. - Develop ticket management endpoints for viewing, creating, updating, and managing ticket progress. - Implement user management endpoints for CRUD operations, role assignments, and password resets. - Add WeChat callback handlers for verifying and processing messages. --- internal/bootstrap/{controller_routes.go => routes.go} | 6 +++--- .../api/auth_controller.go => handlers/api/auth_handler.go} | 0 .../api/channel_handler.go} | 0 .../api/conversation_handler.go} | 0 .../api/customer_handler.go} | 0 .../api/message_handler.go} | 0 .../dashboard/agent_handler.go} | 0 .../dashboard/agent_run_log_handler.go} | 0 .../dashboard/agent_team_handler.go} | 0 .../dashboard/agent_team_schedule_handler.go} | 0 .../dashboard/ai_agent_handler.go} | 0 .../dashboard/ai_config_handler.go} | 0 .../dashboard/asset_handler.go} | 0 .../dashboard/channel_handler.go} | 0 .../dashboard/company_handler.go} | 0 .../dashboard/conversation_handler.go} | 0 .../dashboard/customer_contact_handler.go} | 0 .../dashboard/customer_handler.go} | 0 .../dashboard/dashboard_handler.go} | 0 .../dashboard/knowledge_base_handler.go} | 0 .../dashboard/knowledge_document_handler.go} | 0 .../dashboard/knowledge_faq_handler.go} | 0 .../dashboard/knowledge_retrieve_handler.go} | 0 .../dashboard/knowledge_retrieve_log_handler.go} | 0 .../mcp_controller.go => handlers/dashboard/mcp_handler.go} | 0 .../dashboard/notification_handler.go} | 0 .../dashboard/permission_handler.go} | 0 .../dashboard/quick_reply_handler.go} | 0 .../dashboard/role_handler.go} | 0 .../dashboard/session_handler.go} | 0 .../dashboard/skill_definition_handler.go} | 0 .../tag_controller.go => handlers/dashboard/tag_handler.go} | 0 .../dashboard/ticket_handler.go} | 0 .../dashboard/user_handler.go} | 0 .../third/wechat_handler.go} | 0 35 files changed, 3 insertions(+), 3 deletions(-) rename internal/bootstrap/{controller_routes.go => routes.go} (99%) rename internal/{controllers/api/auth_controller.go => handlers/api/auth_handler.go} (100%) rename internal/{controllers/api/channel_controller.go => handlers/api/channel_handler.go} (100%) rename internal/{controllers/api/conversation_controller.go => handlers/api/conversation_handler.go} (100%) rename internal/{controllers/api/customer_controller.go => handlers/api/customer_handler.go} (100%) rename internal/{controllers/api/message_controller.go => handlers/api/message_handler.go} (100%) rename internal/{controllers/dashboard/agent_controller.go => handlers/dashboard/agent_handler.go} (100%) rename internal/{controllers/dashboard/agent_run_log_controller.go => handlers/dashboard/agent_run_log_handler.go} (100%) rename internal/{controllers/dashboard/agent_team_controller.go => handlers/dashboard/agent_team_handler.go} (100%) rename internal/{controllers/dashboard/agent_team_schedule_controller.go => handlers/dashboard/agent_team_schedule_handler.go} (100%) rename internal/{controllers/dashboard/ai_agent_controller.go => handlers/dashboard/ai_agent_handler.go} (100%) rename internal/{controllers/dashboard/ai_config_controller.go => handlers/dashboard/ai_config_handler.go} (100%) rename internal/{controllers/dashboard/asset_controller.go => handlers/dashboard/asset_handler.go} (100%) rename internal/{controllers/dashboard/channel_controller.go => handlers/dashboard/channel_handler.go} (100%) rename internal/{controllers/dashboard/company_controller.go => handlers/dashboard/company_handler.go} (100%) rename internal/{controllers/dashboard/conversation_controller.go => handlers/dashboard/conversation_handler.go} (100%) rename internal/{controllers/dashboard/customer_contact_controller.go => handlers/dashboard/customer_contact_handler.go} (100%) rename internal/{controllers/dashboard/customer_controller.go => handlers/dashboard/customer_handler.go} (100%) rename internal/{controllers/dashboard/dashboard_controller.go => handlers/dashboard/dashboard_handler.go} (100%) rename internal/{controllers/dashboard/knowledge_base_controller.go => handlers/dashboard/knowledge_base_handler.go} (100%) rename internal/{controllers/dashboard/knowledge_document_controller.go => handlers/dashboard/knowledge_document_handler.go} (100%) rename internal/{controllers/dashboard/knowledge_faq_controller.go => handlers/dashboard/knowledge_faq_handler.go} (100%) rename internal/{controllers/dashboard/knowledge_retrieve_controller.go => handlers/dashboard/knowledge_retrieve_handler.go} (100%) rename internal/{controllers/dashboard/knowledge_retrieve_log_controller.go => handlers/dashboard/knowledge_retrieve_log_handler.go} (100%) rename internal/{controllers/dashboard/mcp_controller.go => handlers/dashboard/mcp_handler.go} (100%) rename internal/{controllers/dashboard/notification_controller.go => handlers/dashboard/notification_handler.go} (100%) rename internal/{controllers/dashboard/permission_controller.go => handlers/dashboard/permission_handler.go} (100%) rename internal/{controllers/dashboard/quick_reply_controller.go => handlers/dashboard/quick_reply_handler.go} (100%) rename internal/{controllers/dashboard/role_controller.go => handlers/dashboard/role_handler.go} (100%) rename internal/{controllers/dashboard/session_controller.go => handlers/dashboard/session_handler.go} (100%) rename internal/{controllers/dashboard/skill_definition_controller.go => handlers/dashboard/skill_definition_handler.go} (100%) rename internal/{controllers/dashboard/tag_controller.go => handlers/dashboard/tag_handler.go} (100%) rename internal/{controllers/dashboard/ticket_controller.go => handlers/dashboard/ticket_handler.go} (100%) rename internal/{controllers/dashboard/user_controller.go => handlers/dashboard/user_handler.go} (100%) rename internal/{controllers/third/wechat_controller.go => handlers/third/wechat_handler.go} (100%) diff --git a/internal/bootstrap/controller_routes.go b/internal/bootstrap/routes.go similarity index 99% rename from internal/bootstrap/controller_routes.go rename to internal/bootstrap/routes.go index 473735e..007584d 100644 --- a/internal/bootstrap/controller_routes.go +++ b/internal/bootstrap/routes.go @@ -1,9 +1,9 @@ package bootstrap import ( - "cs-agent/internal/controllers/api" - "cs-agent/internal/controllers/dashboard" - "cs-agent/internal/controllers/third" + "cs-agent/internal/handlers/api" + "cs-agent/internal/handlers/dashboard" + "cs-agent/internal/handlers/third" "github.com/gin-gonic/gin" ) diff --git a/internal/controllers/api/auth_controller.go b/internal/handlers/api/auth_handler.go similarity index 100% rename from internal/controllers/api/auth_controller.go rename to internal/handlers/api/auth_handler.go diff --git a/internal/controllers/api/channel_controller.go b/internal/handlers/api/channel_handler.go similarity index 100% rename from internal/controllers/api/channel_controller.go rename to internal/handlers/api/channel_handler.go diff --git a/internal/controllers/api/conversation_controller.go b/internal/handlers/api/conversation_handler.go similarity index 100% rename from internal/controllers/api/conversation_controller.go rename to internal/handlers/api/conversation_handler.go diff --git a/internal/controllers/api/customer_controller.go b/internal/handlers/api/customer_handler.go similarity index 100% rename from internal/controllers/api/customer_controller.go rename to internal/handlers/api/customer_handler.go diff --git a/internal/controllers/api/message_controller.go b/internal/handlers/api/message_handler.go similarity index 100% rename from internal/controllers/api/message_controller.go rename to internal/handlers/api/message_handler.go diff --git a/internal/controllers/dashboard/agent_controller.go b/internal/handlers/dashboard/agent_handler.go similarity index 100% rename from internal/controllers/dashboard/agent_controller.go rename to internal/handlers/dashboard/agent_handler.go diff --git a/internal/controllers/dashboard/agent_run_log_controller.go b/internal/handlers/dashboard/agent_run_log_handler.go similarity index 100% rename from internal/controllers/dashboard/agent_run_log_controller.go rename to internal/handlers/dashboard/agent_run_log_handler.go diff --git a/internal/controllers/dashboard/agent_team_controller.go b/internal/handlers/dashboard/agent_team_handler.go similarity index 100% rename from internal/controllers/dashboard/agent_team_controller.go rename to internal/handlers/dashboard/agent_team_handler.go diff --git a/internal/controllers/dashboard/agent_team_schedule_controller.go b/internal/handlers/dashboard/agent_team_schedule_handler.go similarity index 100% rename from internal/controllers/dashboard/agent_team_schedule_controller.go rename to internal/handlers/dashboard/agent_team_schedule_handler.go diff --git a/internal/controllers/dashboard/ai_agent_controller.go b/internal/handlers/dashboard/ai_agent_handler.go similarity index 100% rename from internal/controllers/dashboard/ai_agent_controller.go rename to internal/handlers/dashboard/ai_agent_handler.go diff --git a/internal/controllers/dashboard/ai_config_controller.go b/internal/handlers/dashboard/ai_config_handler.go similarity index 100% rename from internal/controllers/dashboard/ai_config_controller.go rename to internal/handlers/dashboard/ai_config_handler.go diff --git a/internal/controllers/dashboard/asset_controller.go b/internal/handlers/dashboard/asset_handler.go similarity index 100% rename from internal/controllers/dashboard/asset_controller.go rename to internal/handlers/dashboard/asset_handler.go diff --git a/internal/controllers/dashboard/channel_controller.go b/internal/handlers/dashboard/channel_handler.go similarity index 100% rename from internal/controllers/dashboard/channel_controller.go rename to internal/handlers/dashboard/channel_handler.go diff --git a/internal/controllers/dashboard/company_controller.go b/internal/handlers/dashboard/company_handler.go similarity index 100% rename from internal/controllers/dashboard/company_controller.go rename to internal/handlers/dashboard/company_handler.go diff --git a/internal/controllers/dashboard/conversation_controller.go b/internal/handlers/dashboard/conversation_handler.go similarity index 100% rename from internal/controllers/dashboard/conversation_controller.go rename to internal/handlers/dashboard/conversation_handler.go diff --git a/internal/controllers/dashboard/customer_contact_controller.go b/internal/handlers/dashboard/customer_contact_handler.go similarity index 100% rename from internal/controllers/dashboard/customer_contact_controller.go rename to internal/handlers/dashboard/customer_contact_handler.go diff --git a/internal/controllers/dashboard/customer_controller.go b/internal/handlers/dashboard/customer_handler.go similarity index 100% rename from internal/controllers/dashboard/customer_controller.go rename to internal/handlers/dashboard/customer_handler.go diff --git a/internal/controllers/dashboard/dashboard_controller.go b/internal/handlers/dashboard/dashboard_handler.go similarity index 100% rename from internal/controllers/dashboard/dashboard_controller.go rename to internal/handlers/dashboard/dashboard_handler.go diff --git a/internal/controllers/dashboard/knowledge_base_controller.go b/internal/handlers/dashboard/knowledge_base_handler.go similarity index 100% rename from internal/controllers/dashboard/knowledge_base_controller.go rename to internal/handlers/dashboard/knowledge_base_handler.go diff --git a/internal/controllers/dashboard/knowledge_document_controller.go b/internal/handlers/dashboard/knowledge_document_handler.go similarity index 100% rename from internal/controllers/dashboard/knowledge_document_controller.go rename to internal/handlers/dashboard/knowledge_document_handler.go diff --git a/internal/controllers/dashboard/knowledge_faq_controller.go b/internal/handlers/dashboard/knowledge_faq_handler.go similarity index 100% rename from internal/controllers/dashboard/knowledge_faq_controller.go rename to internal/handlers/dashboard/knowledge_faq_handler.go diff --git a/internal/controllers/dashboard/knowledge_retrieve_controller.go b/internal/handlers/dashboard/knowledge_retrieve_handler.go similarity index 100% rename from internal/controllers/dashboard/knowledge_retrieve_controller.go rename to internal/handlers/dashboard/knowledge_retrieve_handler.go diff --git a/internal/controllers/dashboard/knowledge_retrieve_log_controller.go b/internal/handlers/dashboard/knowledge_retrieve_log_handler.go similarity index 100% rename from internal/controllers/dashboard/knowledge_retrieve_log_controller.go rename to internal/handlers/dashboard/knowledge_retrieve_log_handler.go diff --git a/internal/controllers/dashboard/mcp_controller.go b/internal/handlers/dashboard/mcp_handler.go similarity index 100% rename from internal/controllers/dashboard/mcp_controller.go rename to internal/handlers/dashboard/mcp_handler.go diff --git a/internal/controllers/dashboard/notification_controller.go b/internal/handlers/dashboard/notification_handler.go similarity index 100% rename from internal/controllers/dashboard/notification_controller.go rename to internal/handlers/dashboard/notification_handler.go diff --git a/internal/controllers/dashboard/permission_controller.go b/internal/handlers/dashboard/permission_handler.go similarity index 100% rename from internal/controllers/dashboard/permission_controller.go rename to internal/handlers/dashboard/permission_handler.go diff --git a/internal/controllers/dashboard/quick_reply_controller.go b/internal/handlers/dashboard/quick_reply_handler.go similarity index 100% rename from internal/controllers/dashboard/quick_reply_controller.go rename to internal/handlers/dashboard/quick_reply_handler.go diff --git a/internal/controllers/dashboard/role_controller.go b/internal/handlers/dashboard/role_handler.go similarity index 100% rename from internal/controllers/dashboard/role_controller.go rename to internal/handlers/dashboard/role_handler.go diff --git a/internal/controllers/dashboard/session_controller.go b/internal/handlers/dashboard/session_handler.go similarity index 100% rename from internal/controllers/dashboard/session_controller.go rename to internal/handlers/dashboard/session_handler.go diff --git a/internal/controllers/dashboard/skill_definition_controller.go b/internal/handlers/dashboard/skill_definition_handler.go similarity index 100% rename from internal/controllers/dashboard/skill_definition_controller.go rename to internal/handlers/dashboard/skill_definition_handler.go diff --git a/internal/controllers/dashboard/tag_controller.go b/internal/handlers/dashboard/tag_handler.go similarity index 100% rename from internal/controllers/dashboard/tag_controller.go rename to internal/handlers/dashboard/tag_handler.go diff --git a/internal/controllers/dashboard/ticket_controller.go b/internal/handlers/dashboard/ticket_handler.go similarity index 100% rename from internal/controllers/dashboard/ticket_controller.go rename to internal/handlers/dashboard/ticket_handler.go diff --git a/internal/controllers/dashboard/user_controller.go b/internal/handlers/dashboard/user_handler.go similarity index 100% rename from internal/controllers/dashboard/user_controller.go rename to internal/handlers/dashboard/user_handler.go diff --git a/internal/controllers/third/wechat_controller.go b/internal/handlers/third/wechat_handler.go similarity index 100% rename from internal/controllers/third/wechat_controller.go rename to internal/handlers/third/wechat_handler.go