2026-04-09 10:01:23 +08:00
package constants
2026-08-21 00:41:07 +08:00
// Permission 仅描述客服业务操作,由宿主系统执行权限验证
2026-04-09 10:01:23 +08:00
type Permission struct {
Name string
Code string
Type string
GroupName string
Method string
APIPath string
SortNo int
}
// 权限常量定义
var (
// 客服会话相关权限
2026-04-15 17:12:30 +08:00
PermissionConversationView = Permission { Name : "查看会话" , Code : "conversation.view" , Type : "api" , GroupName : "conversation" , Method : "ANY" , APIPath : "/api/dashboard/conversation/list" , SortNo : 410 }
PermissionConversationAssign = Permission { Name : "分配会话" , Code : "conversation.assign" , Type : "api" , GroupName : "conversation" , Method : "POST" , APIPath : "/api/dashboard/conversation/assign" , SortNo : 430 }
PermissionConversationTransfer = Permission { Name : "转接会话" , Code : "conversation.transfer" , Type : "api" , GroupName : "conversation" , Method : "POST" , APIPath : "/api/dashboard/conversation/transfer" , SortNo : 440 }
PermissionConversationClose = Permission { Name : "关闭会话" , Code : "conversation.close" , Type : "api" , GroupName : "conversation" , Method : "POST" , APIPath : "/api/dashboard/conversation/close" , SortNo : 450 }
PermissionConversationSend = Permission { Name : "发送会话消息" , Code : "conversation.send" , Type : "api" , GroupName : "conversation" , Method : "POST" , APIPath : "/api/dashboard/conversation/send_message" , SortNo : 460 }
PermissionConversationTag = Permission { Name : "管理会话标签" , Code : "conversation.tag" , Type : "api" , GroupName : "conversation" , Method : "POST" , APIPath : "/api/dashboard/conversation/add_tag" , SortNo : 470 }
PermissionConversationLinkCustomer = Permission { Name : "关联会话客户" , Code : "conversation.linkCustomer" , Type : "api" , GroupName : "conversation" , Method : "POST" , APIPath : "/api/dashboard/conversation/link_customer" , SortNo : 495 }
2026-04-09 10:01:23 +08:00
// 工单相关权限
2026-05-02 18:57:40 +08:00
PermissionTicketView = Permission { Name : "查看工单" , Code : "ticket.view" , Type : "api" , GroupName : "ticket" , Method : "ANY" , APIPath : "/api/dashboard/ticket/list" , SortNo : 500 }
PermissionTicketCreate = Permission { Name : "创建工单" , Code : "ticket.create" , Type : "api" , GroupName : "ticket" , Method : "POST" , APIPath : "/api/dashboard/ticket/create" , SortNo : 510 }
PermissionTicketUpdate = Permission { Name : "更新工单" , Code : "ticket.update" , Type : "api" , GroupName : "ticket" , Method : "POST" , APIPath : "/api/dashboard/ticket/update" , SortNo : 520 }
PermissionTicketAssign = Permission { Name : "指派工单" , Code : "ticket.assign" , Type : "api" , GroupName : "ticket" , Method : "POST" , APIPath : "/api/dashboard/ticket/assign" , SortNo : 530 }
PermissionTicketChangeStatus = Permission { Name : "变更工单状态" , Code : "ticket.changeStatus" , Type : "api" , GroupName : "ticket" , Method : "POST" , APIPath : "/api/dashboard/ticket/change_status" , SortNo : 540 }
2026-05-02 21:05:11 +08:00
PermissionTicketProgress = Permission { Name : "更新工单进展" , Code : "ticket.progress" , Type : "api" , GroupName : "ticket" , Method : "POST" , APIPath : "/api/dashboard/ticket/progress/create" , SortNo : 550 }
2026-04-09 10:01:23 +08:00
2026-04-28 19:20:38 +08:00
// 通知相关权限
PermissionNotificationView = Permission { Name : "查看通知" , Code : "notification.view" , Type : "api" , GroupName : "notification" , Method : "ANY" , APIPath : "/api/dashboard/notification/list" , SortNo : 680 }
PermissionNotificationUpdate = Permission { Name : "更新通知" , Code : "notification.update" , Type : "api" , GroupName : "notification" , Method : "POST" , APIPath : "/api/dashboard/notification/mark_read" , SortNo : 690 }
2026-04-09 10:01:23 +08:00
// 快捷回复相关权限
2026-04-15 17:12:30 +08:00
PermissionQuickReplyView = Permission { Name : "查看快捷回复" , Code : "quickReply.view" , Type : "api" , GroupName : "quickReply" , Method : "ANY" , APIPath : "/api/dashboard/quick-reply/list" , SortNo : 610 }
PermissionQuickReplyCreate = Permission { Name : "创建快捷回复" , Code : "quickReply.create" , Type : "api" , GroupName : "quickReply" , Method : "POST" , APIPath : "/api/dashboard/quick-reply/create" , SortNo : 620 }
PermissionQuickReplyUpdate = Permission { Name : "更新快捷回复" , Code : "quickReply.update" , Type : "api" , GroupName : "quickReply" , Method : "POST" , APIPath : "/api/dashboard/quick-reply/update" , SortNo : 630 }
PermissionQuickReplyDelete = Permission { Name : "删除快捷回复" , Code : "quickReply.delete" , Type : "api" , GroupName : "quickReply" , Method : "POST" , APIPath : "/api/dashboard/quick-reply/delete" , SortNo : 640 }
2026-04-09 10:01:23 +08:00
// 标签相关权限
2026-04-15 17:12:30 +08:00
PermissionTagView = Permission { Name : "查看标签" , Code : "tag.view" , Type : "api" , GroupName : "tag" , Method : "ANY" , APIPath : "/api/dashboard/tag/list" , SortNo : 550 }
PermissionTagCreate = Permission { Name : "创建标签" , Code : "tag.create" , Type : "api" , GroupName : "tag" , Method : "POST" , APIPath : "/api/dashboard/tag/create" , SortNo : 560 }
PermissionTagUpdate = Permission { Name : "更新标签" , Code : "tag.update" , Type : "api" , GroupName : "tag" , Method : "POST" , APIPath : "/api/dashboard/tag/update" , SortNo : 570 }
PermissionTagDelete = Permission { Name : "删除标签" , Code : "tag.delete" , Type : "api" , GroupName : "tag" , Method : "POST" , APIPath : "/api/dashboard/tag/delete" , SortNo : 580 }
2026-04-09 10:01:23 +08:00
// 公司相关权限
2026-04-15 17:12:30 +08:00
PermissionCompanyView = Permission { Name : "查看公司" , Code : "company.view" , Type : "api" , GroupName : "company" , Method : "ANY" , APIPath : "/api/dashboard/company/list" , SortNo : 590 }
PermissionCompanyCreate = Permission { Name : "创建公司" , Code : "company.create" , Type : "api" , GroupName : "company" , Method : "POST" , APIPath : "/api/dashboard/company/create" , SortNo : 600 }
PermissionCompanyUpdate = Permission { Name : "更新公司" , Code : "company.update" , Type : "api" , GroupName : "company" , Method : "POST" , APIPath : "/api/dashboard/company/update" , SortNo : 610 }
PermissionCompanyDelete = Permission { Name : "删除公司" , Code : "company.delete" , Type : "api" , GroupName : "company" , Method : "POST" , APIPath : "/api/dashboard/company/delete" , SortNo : 620 }
2026-04-09 10:01:23 +08:00
// 接入渠道相关权限
2026-04-15 17:12:30 +08:00
PermissionChannelView = Permission { Name : "查看接入渠道" , Code : "channel.view" , Type : "api" , GroupName : "channel" , Method : "ANY" , APIPath : "/api/dashboard/channel/list" , SortNo : 625 }
PermissionChannelCreate = Permission { Name : "创建接入渠道" , Code : "channel.create" , Type : "api" , GroupName : "channel" , Method : "POST" , APIPath : "/api/dashboard/channel/create" , SortNo : 626 }
PermissionChannelUpdate = Permission { Name : "更新接入渠道" , Code : "channel.update" , Type : "api" , GroupName : "channel" , Method : "POST" , APIPath : "/api/dashboard/channel/update" , SortNo : 627 }
PermissionChannelDelete = Permission { Name : "删除接入渠道" , Code : "channel.delete" , Type : "api" , GroupName : "channel" , Method : "POST" , APIPath : "/api/dashboard/channel/delete" , SortNo : 628 }
2026-04-09 10:01:23 +08:00
2026-08-02 14:03:23 +08:00
// 企微 Outbox 相关权限
PermissionWxWorkOutboxView = Permission { Name : "查看企微 Outbox" , Code : "wxworkOutbox.view" , Type : "api" , GroupName : "wxworkOutbox" , Method : "ANY" , APIPath : "/api/dashboard/channel/wxwork/outbox/failed/list" , SortNo : 629 }
PermissionWxWorkOutboxUpdate = Permission { Name : "处置企微 Outbox" , Code : "wxworkOutbox.update" , Type : "api" , GroupName : "wxworkOutbox" , Method : "POST" , APIPath : "/api/dashboard/channel/wxwork/outbox/retry" , SortNo : 630 }
2026-04-09 10:01:23 +08:00
// 客户相关权限
2026-04-15 17:12:30 +08:00
PermissionCustomerView = Permission { Name : "查看客户" , Code : "customer.view" , Type : "api" , GroupName : "customer" , Method : "POST" , APIPath : "/api/dashboard/customer/list" , SortNo : 630 }
PermissionCustomerCreate = Permission { Name : "创建客户" , Code : "customer.create" , Type : "api" , GroupName : "customer" , Method : "POST" , APIPath : "/api/dashboard/customer/create" , SortNo : 640 }
PermissionCustomerUpdate = Permission { Name : "更新客户" , Code : "customer.update" , Type : "api" , GroupName : "customer" , Method : "POST" , APIPath : "/api/dashboard/customer/update" , SortNo : 650 }
PermissionCustomerDelete = Permission { Name : "删除客户" , Code : "customer.delete" , Type : "api" , GroupName : "customer" , Method : "POST" , APIPath : "/api/dashboard/customer/delete" , SortNo : 660 }
2026-04-09 10:01:23 +08:00
// 客服相关权限
2026-04-15 17:12:30 +08:00
PermissionAgentView = Permission { Name : "查看客服" , Code : "agent.view" , Type : "api" , GroupName : "agent" , Method : "ANY" , APIPath : "/api/dashboard/agent/list" , SortNo : 610 }
PermissionAgentCreate = Permission { Name : "创建客服" , Code : "agent.create" , Type : "api" , GroupName : "agent" , Method : "POST" , APIPath : "/api/dashboard/agent/create" , SortNo : 620 }
PermissionAgentUpdate = Permission { Name : "更新客服" , Code : "agent.update" , Type : "api" , GroupName : "agent" , Method : "POST" , APIPath : "/api/dashboard/agent/update" , SortNo : 630 }
PermissionAgentDelete = Permission { Name : "删除客服" , Code : "agent.delete" , Type : "api" , GroupName : "agent" , Method : "POST" , APIPath : "/api/dashboard/agent/delete" , SortNo : 640 }
2026-04-09 10:01:23 +08:00
// 客服组相关权限
2026-04-15 17:12:30 +08:00
PermissionAgentTeamView = Permission { Name : "查看客服组" , Code : "agentTeam.view" , Type : "api" , GroupName : "agentTeam" , Method : "ANY" , APIPath : "/api/dashboard/agent-team/list" , SortNo : 710 }
PermissionAgentTeamCreate = Permission { Name : "创建客服组" , Code : "agentTeam.create" , Type : "api" , GroupName : "agentTeam" , Method : "POST" , APIPath : "/api/dashboard/agent-team/create" , SortNo : 720 }
PermissionAgentTeamUpdate = Permission { Name : "更新客服组" , Code : "agentTeam.update" , Type : "api" , GroupName : "agentTeam" , Method : "POST" , APIPath : "/api/dashboard/agent-team/update" , SortNo : 730 }
PermissionAgentTeamDelete = Permission { Name : "删除客服组" , Code : "agentTeam.delete" , Type : "api" , GroupName : "agentTeam" , Method : "POST" , APIPath : "/api/dashboard/agent-team/delete" , SortNo : 740 }
2026-04-09 10:01:23 +08:00
// 客服组排班相关权限
2026-04-15 17:12:30 +08:00
PermissionAgentTeamScheduleView = Permission { Name : "查看客服组排班" , Code : "agentTeamSchedule.view" , Type : "api" , GroupName : "agentTeamSchedule" , Method : "ANY" , APIPath : "/api/dashboard/agent-team-schedule/list" , SortNo : 810 }
PermissionAgentTeamScheduleCreate = Permission { Name : "创建客服组排班" , Code : "agentTeamSchedule.create" , Type : "api" , GroupName : "agentTeamSchedule" , Method : "POST" , APIPath : "/api/dashboard/agent-team-schedule/create" , SortNo : 820 }
PermissionAgentTeamScheduleUpdate = Permission { Name : "更新客服组排班" , Code : "agentTeamSchedule.update" , Type : "api" , GroupName : "agentTeamSchedule" , Method : "POST" , APIPath : "/api/dashboard/agent-team-schedule/update" , SortNo : 830 }
PermissionAgentTeamScheduleDelete = Permission { Name : "删除客服组排班" , Code : "agentTeamSchedule.delete" , Type : "api" , GroupName : "agentTeamSchedule" , Method : "POST" , APIPath : "/api/dashboard/agent-team-schedule/delete" , SortNo : 840 }
PermissionAgentTeamScheduleBatchGenerate = Permission { Name : "批量生成客服组排班" , Code : "agentTeamSchedule.batchGenerate" , Type : "api" , GroupName : "agentTeamSchedule" , Method : "POST" , APIPath : "/api/dashboard/agent-team-schedule/batch_generate" , SortNo : 850 }
2026-04-09 10:01:23 +08:00
// 文件资源相关权限
2026-04-15 17:12:30 +08:00
PermissionAssetView = Permission { Name : "查看文件资源" , Code : "asset.view" , Type : "api" , GroupName : "asset" , Method : "ANY" , APIPath : "/api/dashboard/asset/list" , SortNo : 1210 }
PermissionAssetCreate = Permission { Name : "上传文件资源" , Code : "asset.create" , Type : "api" , GroupName : "asset" , Method : "POST" , APIPath : "/api/dashboard/asset/create" , SortNo : 1220 }
PermissionAssetDelete = Permission { Name : "删除文件资源" , Code : "asset.delete" , Type : "api" , GroupName : "asset" , Method : "POST" , APIPath : "/api/dashboard/asset/delete" , SortNo : 1230 }
2026-04-09 10:01:23 +08:00
2026-04-23 14:26:10 +08:00
// AI Agent 相关权限
PermissionAIAgentView = Permission { Name : "查看 AI Agent" , Code : "aiAgent.view" , Type : "api" , GroupName : "aiAgent" , Method : "ANY" , APIPath : "/api/dashboard/ai-agent/list" , SortNo : 1310 }
PermissionAIAgentCreate = Permission { Name : "创建 AI Agent" , Code : "aiAgent.create" , Type : "api" , GroupName : "aiAgent" , Method : "POST" , APIPath : "/api/dashboard/ai-agent/create" , SortNo : 1320 }
PermissionAIAgentUpdate = Permission { Name : "更新 AI Agent" , Code : "aiAgent.update" , Type : "api" , GroupName : "aiAgent" , Method : "POST" , APIPath : "/api/dashboard/ai-agent/update" , SortNo : 1330 }
PermissionAIAgentDelete = Permission { Name : "删除 AI Agent" , Code : "aiAgent.delete" , Type : "api" , GroupName : "aiAgent" , Method : "POST" , APIPath : "/api/dashboard/ai-agent/delete" , SortNo : 1340 }
2026-04-09 10:01:23 +08:00
// AI 配置相关权限
2026-04-15 17:12:30 +08:00
PermissionAIConfigView = Permission { Name : "查看 AI 配置" , Code : "aiConfig.view" , Type : "api" , GroupName : "aiConfig" , Method : "ANY" , APIPath : "/api/dashboard/ai-config/list" , SortNo : 1390 }
PermissionAIConfigCreate = Permission { Name : "创建 AI 配置" , Code : "aiConfig.create" , Type : "api" , GroupName : "aiConfig" , Method : "POST" , APIPath : "/api/dashboard/ai-config/create" , SortNo : 1400 }
PermissionAIConfigUpdate = Permission { Name : "更新 AI 配置" , Code : "aiConfig.update" , Type : "api" , GroupName : "aiConfig" , Method : "POST" , APIPath : "/api/dashboard/ai-config/update" , SortNo : 1410 }
PermissionAIConfigDelete = Permission { Name : "删除 AI 配置" , Code : "aiConfig.delete" , Type : "api" , GroupName : "aiConfig" , Method : "POST" , APIPath : "/api/dashboard/ai-config/delete" , SortNo : 1420 }
2026-04-09 10:01:23 +08:00
// 知识库相关权限
2026-04-15 17:12:30 +08:00
PermissionKnowledgeBaseView = Permission { Name : "查看知识库" , Code : "knowledgeBase.view" , Type : "api" , GroupName : "knowledgeBase" , Method : "ANY" , APIPath : "/api/dashboard/knowledge-base/list" , SortNo : 1410 }
PermissionKnowledgeBaseCreate = Permission { Name : "创建知识库" , Code : "knowledgeBase.create" , Type : "api" , GroupName : "knowledgeBase" , Method : "POST" , APIPath : "/api/dashboard/knowledge-base/create" , SortNo : 1420 }
PermissionKnowledgeBaseUpdate = Permission { Name : "更新知识库" , Code : "knowledgeBase.update" , Type : "api" , GroupName : "knowledgeBase" , Method : "POST" , APIPath : "/api/dashboard/knowledge-base/update" , SortNo : 1430 }
PermissionKnowledgeBaseDelete = Permission { Name : "删除知识库" , Code : "knowledgeBase.delete" , Type : "api" , GroupName : "knowledgeBase" , Method : "POST" , APIPath : "/api/dashboard/knowledge-base/delete" , SortNo : 1440 }
2026-04-09 10:01:23 +08:00
// 知识文档相关权限
2026-04-15 17:12:30 +08:00
PermissionKnowledgeDocumentView = Permission { Name : "查看知识文档" , Code : "knowledgeDocument.view" , Type : "api" , GroupName : "knowledgeDocument" , Method : "ANY" , APIPath : "/api/dashboard/knowledge-document/list" , SortNo : 1510 }
PermissionKnowledgeDocumentCreate = Permission { Name : "创建知识文档" , Code : "knowledgeDocument.create" , Type : "api" , GroupName : "knowledgeDocument" , Method : "POST" , APIPath : "/api/dashboard/knowledge-document/create" , SortNo : 1520 }
PermissionKnowledgeDocumentUpdate = Permission { Name : "更新知识文档" , Code : "knowledgeDocument.update" , Type : "api" , GroupName : "knowledgeDocument" , Method : "POST" , APIPath : "/api/dashboard/knowledge-document/update" , SortNo : 1530 }
PermissionKnowledgeDocumentDelete = Permission { Name : "删除知识文档" , Code : "knowledgeDocument.delete" , Type : "api" , GroupName : "knowledgeDocument" , Method : "POST" , APIPath : "/api/dashboard/knowledge-document/delete" , SortNo : 1540 }
PermissionKnowledgeFAQView = Permission { Name : "查看知识FAQ" , Code : "knowledgeFAQ.view" , Type : "api" , GroupName : "knowledgeFAQ" , Method : "ANY" , APIPath : "/api/dashboard/knowledge-faq/list" , SortNo : 1550 }
PermissionKnowledgeFAQCreate = Permission { Name : "创建知识FAQ" , Code : "knowledgeFAQ.create" , Type : "api" , GroupName : "knowledgeFAQ" , Method : "POST" , APIPath : "/api/dashboard/knowledge-faq/create" , SortNo : 1560 }
PermissionKnowledgeFAQUpdate = Permission { Name : "更新知识FAQ" , Code : "knowledgeFAQ.update" , Type : "api" , GroupName : "knowledgeFAQ" , Method : "POST" , APIPath : "/api/dashboard/knowledge-faq/update" , SortNo : 1570 }
PermissionKnowledgeFAQDelete = Permission { Name : "删除知识FAQ" , Code : "knowledgeFAQ.delete" , Type : "api" , GroupName : "knowledgeFAQ" , Method : "POST" , APIPath : "/api/dashboard/knowledge-faq/delete" , SortNo : 1580 }
2026-04-09 10:01:23 +08:00
// Skill 定义相关权限
2026-04-15 17:12:30 +08:00
PermissionSkillDefinitionView = Permission { Name : "查看技能定义" , Code : "skillDefinition.view" , Type : "api" , GroupName : "skillDefinition" , Method : "ANY" , APIPath : "/api/dashboard/skill-definition/list" , SortNo : 1610 }
PermissionSkillDefinitionCreate = Permission { Name : "创建技能定义" , Code : "skillDefinition.create" , Type : "api" , GroupName : "skillDefinition" , Method : "POST" , APIPath : "/api/dashboard/skill-definition/create" , SortNo : 1620 }
PermissionSkillDefinitionUpdate = Permission { Name : "更新技能定义" , Code : "skillDefinition.update" , Type : "api" , GroupName : "skillDefinition" , Method : "POST" , APIPath : "/api/dashboard/skill-definition/update" , SortNo : 1630 }
PermissionSkillDefinitionDelete = Permission { Name : "删除技能定义" , Code : "skillDefinition.delete" , Type : "api" , GroupName : "skillDefinition" , Method : "POST" , APIPath : "/api/dashboard/skill-definition/delete" , SortNo : 1640 }
2026-04-09 10:01:23 +08:00
// MCP 调试相关权限
2026-04-15 17:12:30 +08:00
PermissionMCPView = Permission { Name : "查看MCP调试信息" , Code : "mcp.view" , Type : "api" , GroupName : "mcp" , Method : "POST" , APIPath : "/api/dashboard/mcp/list_tools" , SortNo : 1710 }
PermissionMCPCall = Permission { Name : "调用MCP工具" , Code : "mcp.call" , Type : "api" , GroupName : "mcp" , Method : "POST" , APIPath : "/api/dashboard/mcp/call_tool" , SortNo : 1720 }
2026-04-09 10:01:23 +08:00
)