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-08-28 22:23:13 +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 }
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
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-08-28 22:23:13 +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
)