Init
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package dto
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type AuthPrincipal struct {
|
||||
UserID int64
|
||||
Username string
|
||||
Nickname string
|
||||
Avatar string
|
||||
Status enums.Status
|
||||
Roles []string
|
||||
Permissions []string
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package request
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type RevokeSessionRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type RevokeUserSessionsRequest struct {
|
||||
UserID int64 `json:"userId"`
|
||||
}
|
||||
|
||||
type CreateUserRequest struct {
|
||||
Username string `json:"username"`
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
Mobile *string `json:"mobile"`
|
||||
Email *string `json:"email"`
|
||||
Remark string `json:"remark"`
|
||||
RoleIDs []int64 `json:"roleIds"`
|
||||
}
|
||||
|
||||
type UpdateUserRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
Mobile *string `json:"mobile"`
|
||||
Email *string `json:"email"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type DeleteUserRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateUserStatusRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type ChangePasswordRequest struct {
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type AssignRoleRequest struct {
|
||||
UserID int64 `json:"userId"`
|
||||
RoleIDs []int64 `json:"roleIds"`
|
||||
}
|
||||
|
||||
type CreateRoleRequest struct {
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateRoleRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type DeleteRoleRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateRoleStatusRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Status enums.Status `json:"status"`
|
||||
}
|
||||
|
||||
type AssignPermissionRequest struct {
|
||||
RoleID int64 `json:"roleId"`
|
||||
PermissionIDs []int64 `json:"permissionIds"`
|
||||
}
|
||||
|
||||
type CreateConversationTagRequest struct {
|
||||
Name string `json:"name"`
|
||||
Color string `json:"color"`
|
||||
Status int `json:"status"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateConversationTagRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Color string `json:"color"`
|
||||
Status int `json:"status"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type DeleteConversationTagRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package request
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type CreateAgentProfileRequest struct {
|
||||
UserID int64 `json:"userId"`
|
||||
TeamID int64 `json:"teamId"`
|
||||
AgentCode string `json:"agentCode"`
|
||||
DisplayName string `json:"displayName"`
|
||||
Avatar string `json:"avatar"`
|
||||
ServiceStatus enums.ServiceStatus `json:"serviceStatus"`
|
||||
MaxConcurrentCount int `json:"maxConcurrentCount"`
|
||||
PriorityLevel int `json:"priorityLevel"`
|
||||
AutoAssignEnabled bool `json:"autoAssignEnabled"`
|
||||
ReceiveOfflineMessage bool `json:"receiveOfflineMessage"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateAgentProfileRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateAgentProfileRequest
|
||||
}
|
||||
|
||||
type DeleteAgentProfileRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type CreateAgentTeamRequest struct {
|
||||
Name string `json:"name"`
|
||||
LeaderUserID int64 `json:"leaderUserId"`
|
||||
Status int `json:"status"`
|
||||
Description string `json:"description"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateAgentTeamRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
LeaderUserID int64 `json:"leaderUserId"`
|
||||
Status int `json:"status"`
|
||||
Description string `json:"description"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type DeleteAgentTeamRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type CreateAgentTeamScheduleRequest struct {
|
||||
TeamID int64 `json:"teamId"`
|
||||
StartAt string `json:"startAt"`
|
||||
EndAt string `json:"endAt"`
|
||||
SourceType string `json:"sourceType"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateAgentTeamScheduleRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateAgentTeamScheduleRequest
|
||||
}
|
||||
|
||||
type DeleteAgentTeamScheduleRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package request
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type AIAgentMCPToolRequest struct {
|
||||
ServerCode string `json:"serverCode"`
|
||||
ToolName string `json:"toolName"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Arguments map[string]string `json:"arguments"`
|
||||
}
|
||||
|
||||
type CreateAIConfigRequest struct {
|
||||
Name string `json:"name"`
|
||||
Provider enums.AIProvider `json:"provider"`
|
||||
BaseURL string `json:"baseUrl"`
|
||||
APIKey string `json:"apiKey"`
|
||||
ModelType enums.AIModelType `json:"modelType"`
|
||||
ModelName string `json:"modelName"`
|
||||
Dimension int `json:"dimension"`
|
||||
MaxContextTokens int `json:"maxContextTokens"`
|
||||
MaxOutputTokens int `json:"maxOutputTokens"`
|
||||
TimeoutMS int `json:"timeoutMs"`
|
||||
MaxRetryCount int `json:"maxRetryCount"`
|
||||
RPMLimit int `json:"rpmLimit"`
|
||||
TPMLimit int `json:"tpmLimit"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateAIConfigRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateAIConfigRequest
|
||||
}
|
||||
|
||||
type DeleteAIConfigRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateAIConfigStatusRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Status enums.Status `json:"status"`
|
||||
}
|
||||
|
||||
type CreateAIAgentRequest struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
AIConfigID int64 `json:"aiConfigId"`
|
||||
ServiceMode enums.IMConversationServiceMode `json:"serviceMode"`
|
||||
SystemPrompt string `json:"systemPrompt"`
|
||||
WelcomeMessage string `json:"welcomeMessage"`
|
||||
ReplyTimeoutSeconds int `json:"replyTimeoutSeconds"`
|
||||
TeamIDs []int64 `json:"teamIds"`
|
||||
HandoffMode enums.AIAgentHandoffMode `json:"handoffMode"`
|
||||
MaxAIReplyRounds int `json:"maxAiReplyRounds"`
|
||||
FallbackMode enums.AIAgentFallbackMode `json:"fallbackMode"`
|
||||
FallbackMessage string `json:"fallbackMessage"`
|
||||
KnowledgeIDs []int64 `json:"knowledgeIds"`
|
||||
SkillIDs []int64 `json:"skillIds"`
|
||||
DirectTools []AIAgentMCPToolRequest `json:"directTools"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateAIAgentRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateAIAgentRequest
|
||||
}
|
||||
|
||||
type DeleteAIAgentRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateAIAgentStatusRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package request
|
||||
|
||||
type CreateAssetRequest struct {
|
||||
Prefix string `form:"prefix"`
|
||||
}
|
||||
|
||||
type DeleteAssetRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package request
|
||||
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type RefreshTokenRequest struct {
|
||||
RefreshToken string `json:"refreshToken"`
|
||||
}
|
||||
|
||||
type LogoutRequest struct {
|
||||
RefreshToken string `json:"refreshToken"`
|
||||
}
|
||||
|
||||
type WxWorkExchangeRequest struct {
|
||||
Ticket string `json:"ticket"`
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package request
|
||||
|
||||
type CreateChannelRequest struct {
|
||||
ChannelType string `json:"channelType"`
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
Name string `json:"name"`
|
||||
ConfigJSON string `json:"configJson"`
|
||||
Status int `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateChannelRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateChannelRequest
|
||||
}
|
||||
|
||||
type UpdateChannelStatusRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type DeleteChannelRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package request
|
||||
|
||||
type CreateCompanyRequest struct {
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateCompanyRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateCompanyRequest
|
||||
}
|
||||
|
||||
type DeleteCompanyRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateCompanyStatusRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package request
|
||||
|
||||
type AgentConversationFilter string
|
||||
|
||||
const (
|
||||
AgentConversationFilterMine AgentConversationFilter = "mine"
|
||||
AgentConversationFilterActive AgentConversationFilter = "active"
|
||||
AgentConversationFilterPending AgentConversationFilter = "pending"
|
||||
AgentConversationFilterClosed AgentConversationFilter = "closed"
|
||||
)
|
||||
|
||||
type ConversationListRequest struct {
|
||||
Status int `json:"status"`
|
||||
ExternalSource string `json:"externalSource"`
|
||||
ServiceMode int `json:"serviceMode"`
|
||||
CurrentAssigneeID int64 `json:"currentAssigneeId"`
|
||||
Keyword string `json:"keyword"`
|
||||
TagID int64 `json:"tagId"`
|
||||
}
|
||||
|
||||
type AssignConversationRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
AssigneeID int64 `json:"assigneeId"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
type DispatchConversationRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
}
|
||||
|
||||
type TransferConversationRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
ToUserID int64 `json:"toUserId"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
type CloseConversationRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
CloseReason string `json:"closeReason"`
|
||||
}
|
||||
|
||||
type ReadConversationRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
MessageID int64 `json:"messageId"`
|
||||
}
|
||||
|
||||
type AddConversationTagRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
TagID int64 `json:"tagId"`
|
||||
}
|
||||
|
||||
type RemoveConversationTagRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
TagID int64 `json:"tagId"`
|
||||
}
|
||||
|
||||
// LinkConversationCustomerRequest 将客服会话关联到 CRM 客户(并同步访客身份映射)。
|
||||
type LinkConversationCustomerRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
CustomerID int64 `json:"customerId"`
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package request
|
||||
|
||||
type CreateCustomerContactRequest struct {
|
||||
CustomerID int64 `json:"customerId"`
|
||||
ContactType string `json:"contactType"`
|
||||
ContactValue string `json:"contactValue"`
|
||||
IsPrimary bool `json:"isPrimary"`
|
||||
IsVerified bool `json:"isVerified"`
|
||||
Source string `json:"source"`
|
||||
Status int `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateCustomerContactRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
ContactType string `json:"contactType"`
|
||||
ContactValue string `json:"contactValue"`
|
||||
IsPrimary bool `json:"isPrimary"`
|
||||
IsVerified bool `json:"isVerified"`
|
||||
Source string `json:"source"`
|
||||
Status int `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type DeleteCustomerContactRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package request
|
||||
|
||||
// CustomerListRequest 客户分页列表查询(POST /customer/list JSON Body)。
|
||||
type CustomerListRequest struct {
|
||||
Page int `json:"page"`
|
||||
Limit int `json:"limit"`
|
||||
Status *int `json:"status,omitempty"`
|
||||
Gender *int `json:"gender,omitempty"`
|
||||
CompanyID *int64 `json:"companyId,omitempty"`
|
||||
// Keyword 模糊匹配:客户姓名、主手机号、主邮箱、任意联系方式(t_customer_contact)、公司名称(t_company)。
|
||||
Keyword string `json:"keyword"`
|
||||
}
|
||||
|
||||
func (r CustomerListRequest) GetPage() int {
|
||||
if r.Page <= 0 {
|
||||
return 1
|
||||
}
|
||||
return r.Page
|
||||
}
|
||||
|
||||
func (r CustomerListRequest) GetLimit() int {
|
||||
if r.Limit <= 0 {
|
||||
return 20
|
||||
}
|
||||
return r.Limit
|
||||
}
|
||||
|
||||
func (r CustomerListRequest) Offset() int {
|
||||
return (r.GetPage() - 1) * r.GetLimit()
|
||||
}
|
||||
|
||||
type CreateCustomerRequest struct {
|
||||
Name string `json:"name"`
|
||||
Gender int `json:"gender"`
|
||||
CompanyID int64 `json:"companyId"`
|
||||
PrimaryMobile string `json:"primaryMobile"`
|
||||
PrimaryEmail string `json:"primaryEmail"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateCustomerRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateCustomerRequest
|
||||
}
|
||||
|
||||
type DeleteCustomerRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateCustomerStatusRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
// CustomerProfileContactItem 保存客户档案时的联系方式行(无 id 表示新建)。
|
||||
type CustomerProfileContactItem struct {
|
||||
ID *int64 `json:"id,omitempty"`
|
||||
ContactType string `json:"contactType"`
|
||||
ContactValue string `json:"contactValue"`
|
||||
IsPrimary bool `json:"isPrimary"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
// SaveCustomerProfileRequest 客户主信息与联系方式一并保存(单事务);id 为空或 0 表示新建客户。
|
||||
type SaveCustomerProfileRequest struct {
|
||||
ID *int64 `json:"id,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Gender int `json:"gender"`
|
||||
CompanyID int64 `json:"companyId"`
|
||||
Remark string `json:"remark"`
|
||||
Contacts []CustomerProfileContactItem `json:"contacts"`
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package request
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type CreateKnowledgeBaseRequest struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
KnowledgeType string `json:"knowledgeType"`
|
||||
DefaultTopK int `json:"defaultTopK"`
|
||||
DefaultScoreThreshold float64 `json:"defaultScoreThreshold"`
|
||||
DefaultRerankLimit int `json:"defaultRerankLimit"`
|
||||
ChunkProvider string `json:"chunkProvider"`
|
||||
ChunkTargetTokens int `json:"chunkTargetTokens"`
|
||||
ChunkMaxTokens int `json:"chunkMaxTokens"`
|
||||
ChunkOverlapTokens int `json:"chunkOverlapTokens"`
|
||||
AnswerMode int `json:"answerMode"`
|
||||
FallbackMode int `json:"fallbackMode"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateKnowledgeBaseRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateKnowledgeBaseRequest
|
||||
}
|
||||
|
||||
type CreateKnowledgeDocumentRequest struct {
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
Title string `json:"title"`
|
||||
ContentType enums.KnowledgeDocumentContentType `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type UpdateKnowledgeDocumentRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateKnowledgeDocumentRequest
|
||||
}
|
||||
|
||||
type CreateKnowledgeFAQRequest struct {
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
Question string `json:"question"`
|
||||
Answer string `json:"answer"`
|
||||
SimilarQuestions []string `json:"similarQuestions"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateKnowledgeFAQRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateKnowledgeFAQRequest
|
||||
}
|
||||
|
||||
type KnowledgeSearchRequest struct {
|
||||
KnowledgeBaseIDs []int64 `json:"knowledgeBaseIds"`
|
||||
Question string `json:"question"`
|
||||
TopK int `json:"topK"`
|
||||
ScoreThreshold float64 `json:"scoreThreshold"`
|
||||
RerankLimit int `json:"rerankLimit"`
|
||||
Channel string `json:"channel"`
|
||||
Scene string `json:"scene"`
|
||||
SessionID string `json:"sessionId"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
}
|
||||
|
||||
type KnowledgeAnswerRequest struct {
|
||||
KnowledgeBaseIDs []int64 `json:"knowledgeBaseIds"`
|
||||
Question string `json:"question"`
|
||||
TopK int `json:"topK"`
|
||||
ScoreThreshold float64 `json:"scoreThreshold"`
|
||||
RerankLimit int `json:"rerankLimit"`
|
||||
Channel string `json:"channel"`
|
||||
Scene string `json:"scene"`
|
||||
SessionID string `json:"sessionId"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
AnswerMode int `json:"answerMode"`
|
||||
FallbackMode int `json:"fallbackMode"`
|
||||
}
|
||||
|
||||
type CreateKnowledgeFeedbackRequest struct {
|
||||
RetrieveLogID int64 `json:"retrieveLogId"`
|
||||
FeedbackType int `json:"feedbackType"`
|
||||
FeedbackReason string `json:"feedbackReason"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package request
|
||||
|
||||
type MCPServerDebugRequest struct {
|
||||
ServerCode string `json:"serverCode"`
|
||||
}
|
||||
|
||||
type MCPCallToolRequest struct {
|
||||
ServerCode string `json:"serverCode"`
|
||||
ToolName string `json:"toolName"`
|
||||
Arguments map[string]any `json:"arguments"`
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package request
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type MessageListRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
SenderType string `json:"senderType"`
|
||||
MessageType string `json:"messageType"`
|
||||
}
|
||||
|
||||
type SendConversationMessageRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
MessageType enums.IMMessageType `json:"messageType"`
|
||||
Content string `json:"content"`
|
||||
Payload string `json:"payload"`
|
||||
ClientMsgID string `json:"clientMsgId"`
|
||||
}
|
||||
|
||||
type RecallConversationMessageRequest struct {
|
||||
MessageID int64 `json:"messageId"`
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package request
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type QuickReplyListRequest struct {
|
||||
GroupName string `json:"groupName"`
|
||||
Keyword string `json:"keyword"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type CreateQuickReplyRequest struct {
|
||||
GroupName string `json:"groupName"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Status enums.Status `json:"status"`
|
||||
SortNo int `json:"sortNo"`
|
||||
}
|
||||
|
||||
type UpdateQuickReplyRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateQuickReplyRequest
|
||||
}
|
||||
|
||||
type DeleteQuickReplyRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package request
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type SkillDefinitionListRequest struct {
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type CreateSkillDefinitionRequest struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Prompt string `json:"prompt"`
|
||||
ExecutionMode enums.SkillExecutionMode `json:"executionMode"`
|
||||
ExecutionConfig string `json:"executionConfig"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateSkillDefinitionRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateSkillDefinitionRequest
|
||||
}
|
||||
|
||||
type DeleteSkillDefinitionRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateSkillDefinitionStatusRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type SkillDebugRunRequest struct {
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
SkillCode string `json:"skillCode"`
|
||||
UserMessage string `json:"userMessage"`
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package request
|
||||
|
||||
type TagListRequest struct {
|
||||
ParentID int64 `json:"parentId"`
|
||||
Name string `json:"name"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type CreateTagRequest struct {
|
||||
ParentID int64 `json:"parentId"`
|
||||
Name string `json:"name"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateTagRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateTagRequest
|
||||
}
|
||||
|
||||
type DeleteTagRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateTagStatusRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package request
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type CreateTicketResolutionCodeRequest struct {
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateTicketResolutionCodeRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateTicketResolutionCodeRequest
|
||||
}
|
||||
|
||||
type DeleteTicketResolutionCodeRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type CreateTicketPriorityConfigRequest struct {
|
||||
Name string `json:"name"`
|
||||
FirstResponseMinutes int `json:"firstResponseMinutes"`
|
||||
ResolutionMinutes int `json:"resolutionMinutes"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateTicketPriorityConfigRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateTicketPriorityConfigRequest
|
||||
}
|
||||
|
||||
type DeleteTicketPriorityConfigRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package request
|
||||
|
||||
type CreateTicketRequest struct {
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Source string `json:"source"`
|
||||
Channel string `json:"channel"`
|
||||
CustomerID int64 `json:"customerId"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
TagIDs []int64 `json:"tagIds"`
|
||||
Type string `json:"type"`
|
||||
Priority int64 `json:"priority"`
|
||||
Severity int `json:"severity"`
|
||||
CurrentTeamID int64 `json:"currentTeamId"`
|
||||
CurrentAssigneeID int64 `json:"currentAssigneeId"`
|
||||
DueAt string `json:"dueAt"`
|
||||
CustomFields map[string]any `json:"customFields"`
|
||||
}
|
||||
|
||||
type CreateTicketFromConversationRequest struct {
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
TagIDs []int64 `json:"tagIds"`
|
||||
Priority int64 `json:"priority"`
|
||||
Severity int `json:"severity"`
|
||||
CurrentTeamID int64 `json:"currentTeamId"`
|
||||
CurrentAssigneeID int64 `json:"currentAssigneeId"`
|
||||
SyncToConversation bool `json:"syncToConversation"`
|
||||
CustomFields map[string]any `json:"customFields"`
|
||||
}
|
||||
|
||||
type UpdateTicketRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
TagIDs []int64 `json:"tagIds"`
|
||||
Type string `json:"type"`
|
||||
Priority int64 `json:"priority"`
|
||||
Severity int `json:"severity"`
|
||||
CurrentTeamID int64 `json:"currentTeamId"`
|
||||
CurrentAssigneeID int64 `json:"currentAssigneeId"`
|
||||
DueAt string `json:"dueAt"`
|
||||
CustomFields map[string]any `json:"customFields"`
|
||||
}
|
||||
|
||||
type AssignTicketRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
ToUserID int64 `json:"toUserId"`
|
||||
ToTeamID int64 `json:"toTeamId"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
type ChangeTicketStatusRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
Status string `json:"status"`
|
||||
PendingReason string `json:"pendingReason"`
|
||||
CloseReason string `json:"closeReason"`
|
||||
ResolutionCode string `json:"resolutionCode"`
|
||||
ResolutionSummary string `json:"resolutionSummary"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
type ReplyTicketRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
ContentType string `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
Payload string `json:"payload"`
|
||||
}
|
||||
|
||||
type InternalNoteRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
ContentType string `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
Payload string `json:"payload"`
|
||||
}
|
||||
|
||||
type CloseTicketRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
CloseReason string `json:"closeReason"`
|
||||
}
|
||||
|
||||
type ReopenTicketRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
type WatchTicketRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
}
|
||||
|
||||
type BatchAssignTicketRequest struct {
|
||||
TicketIDs []int64 `json:"ticketIds"`
|
||||
ToUserID int64 `json:"toUserId"`
|
||||
ToTeamID int64 `json:"toTeamId"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
type BatchChangeTicketStatusRequest struct {
|
||||
TicketIDs []int64 `json:"ticketIds"`
|
||||
Status string `json:"status"`
|
||||
PendingReason string `json:"pendingReason"`
|
||||
CloseReason string `json:"closeReason"`
|
||||
ResolutionCode string `json:"resolutionCode"`
|
||||
ResolutionSummary string `json:"resolutionSummary"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
type BatchWatchTicketRequest struct {
|
||||
TicketIDs []int64 `json:"ticketIds"`
|
||||
Watched bool `json:"watched"`
|
||||
}
|
||||
|
||||
type AddTicketRelationRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
RelatedTicketID int64 `json:"relatedTicketId"`
|
||||
RelatedTicketNo string `json:"relatedTicketNo"`
|
||||
RelationType string `json:"relationType"`
|
||||
}
|
||||
|
||||
type DeleteTicketRelationRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
RelationID int64 `json:"relationId"`
|
||||
}
|
||||
|
||||
type AddTicketCollaboratorRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
UserID int64 `json:"userId"`
|
||||
}
|
||||
|
||||
type DeleteTicketCollaboratorRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
CollaboratorID int64 `json:"collaboratorId"`
|
||||
}
|
||||
|
||||
type LinkTicketCustomerRequest struct {
|
||||
TicketID int64 `json:"ticketId"`
|
||||
CustomerID int64 `json:"customerId"`
|
||||
}
|
||||
|
||||
type SaveTicketViewRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Filters map[string]any `json:"filters"`
|
||||
}
|
||||
|
||||
type DeleteTicketViewRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type PermissionResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Type string `json:"type"`
|
||||
GroupName string `json:"groupName"`
|
||||
Method string `json:"method"`
|
||||
ApiPath string `json:"apiPath"`
|
||||
Status enums.Status `json:"status"`
|
||||
SortNo int `json:"sortNo"`
|
||||
}
|
||||
|
||||
type RoleResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Status enums.Status `json:"status"`
|
||||
IsSystem bool `json:"isSystem"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Permissions []string `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
type UserResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
Mobile string `json:"mobile,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Status enums.Status `json:"status"`
|
||||
LastLoginAt string `json:"lastLoginAt,omitempty"`
|
||||
LastLoginIP string `json:"lastLoginIp,omitempty"`
|
||||
Roles []RoleResponse `json:"roles,omitempty"`
|
||||
Permissions []string `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
// CreateUserResultResponse 创建用户成功响应;password 仅在本次响应中返回一次。
|
||||
type CreateUserResultResponse struct {
|
||||
User *UserResponse `json:"user"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type SessionResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID int64 `json:"userId"`
|
||||
Username string `json:"username,omitempty"`
|
||||
TokenType string `json:"tokenType"`
|
||||
ClientType string `json:"clientType"`
|
||||
ClientIP string `json:"clientIp"`
|
||||
UserAgent string `json:"userAgent"`
|
||||
ExpiredAt string `json:"expiredAt"`
|
||||
RevokedAt string `json:"revokedAt,omitempty"`
|
||||
LastSeenAt string `json:"lastSeenAt,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type AgentProfileResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID int64 `json:"userId"`
|
||||
TeamID int64 `json:"teamId"`
|
||||
TeamName string `json:"teamName,omitempty"`
|
||||
Username string `json:"username,omitempty"`
|
||||
Nickname string `json:"nickname,omitempty"`
|
||||
AgentCode string `json:"agentCode"`
|
||||
DisplayName string `json:"displayName"`
|
||||
Avatar string `json:"avatar"`
|
||||
ServiceStatus enums.ServiceStatus `json:"serviceStatus"`
|
||||
MaxConcurrentCount int `json:"maxConcurrentCount"`
|
||||
PriorityLevel int `json:"priorityLevel"`
|
||||
AutoAssignEnabled bool `json:"autoAssignEnabled"`
|
||||
ReceiveOfflineMessage bool `json:"receiveOfflineMessage"`
|
||||
LastOnlineAt string `json:"lastOnlineAt,omitempty"`
|
||||
LastStatusAt string `json:"lastStatusAt,omitempty"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type AgentTeamResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
LeaderUserID int64 `json:"leaderUserId"`
|
||||
LeaderUsername string `json:"leaderUsername,omitempty"`
|
||||
LeaderNickname string `json:"leaderNickname,omitempty"`
|
||||
Status enums.Status `json:"status"`
|
||||
Description string `json:"description"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type AgentTeamScheduleResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
TeamID int64 `json:"teamId"`
|
||||
TeamName string `json:"teamName,omitempty"`
|
||||
StartAt string `json:"startAt"`
|
||||
EndAt string `json:"endAt"`
|
||||
SourceType string `json:"sourceType"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"cs-agent/internal/models"
|
||||
"cs-agent/internal/pkg/enums"
|
||||
)
|
||||
|
||||
type AIAgentTeamResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type AIAgentSkillResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type AIAgentMCPToolResponse struct {
|
||||
ServerCode string `json:"serverCode"`
|
||||
ToolName string `json:"toolName"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Arguments map[string]string `json:"arguments"`
|
||||
}
|
||||
|
||||
type AIConfigResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Provider enums.AIProvider `json:"provider"`
|
||||
BaseURL string `json:"baseUrl"`
|
||||
APIKey string `json:"apiKey"`
|
||||
ModelType enums.AIModelType `json:"modelType"`
|
||||
ModelName string `json:"modelName"`
|
||||
Dimension int `json:"dimension"`
|
||||
MaxContextTokens int `json:"maxContextTokens"`
|
||||
MaxOutputTokens int `json:"maxOutputTokens"`
|
||||
TimeoutMS int `json:"timeoutMs"`
|
||||
MaxRetryCount int `json:"maxRetryCount"`
|
||||
RPMLimit int `json:"rpmLimit"`
|
||||
TPMLimit int `json:"tpmLimit"`
|
||||
Status enums.Status `json:"status"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
func BuildAIConfigResponse(item *models.AIConfig) AIConfigResponse {
|
||||
return AIConfigResponse{
|
||||
ID: item.ID,
|
||||
Name: item.Name,
|
||||
Provider: item.Provider,
|
||||
BaseURL: item.BaseURL,
|
||||
APIKey: item.APIKey,
|
||||
ModelType: item.ModelType,
|
||||
ModelName: item.ModelName,
|
||||
Dimension: item.Dimension,
|
||||
MaxContextTokens: item.MaxContextTokens,
|
||||
MaxOutputTokens: item.MaxOutputTokens,
|
||||
TimeoutMS: item.TimeoutMS,
|
||||
MaxRetryCount: item.MaxRetryCount,
|
||||
RPMLimit: item.RPMLimit,
|
||||
TPMLimit: item.TPMLimit,
|
||||
Status: item.Status,
|
||||
SortNo: item.SortNo,
|
||||
Remark: item.Remark,
|
||||
}
|
||||
}
|
||||
|
||||
type AIAgentResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Status enums.Status `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
AIConfigID int64 `json:"aiConfigId"`
|
||||
AIConfigName string `json:"aiConfigName"`
|
||||
ServiceMode enums.IMConversationServiceMode `json:"serviceMode"`
|
||||
ServiceModeName string `json:"serviceModeName"`
|
||||
SystemPrompt string `json:"systemPrompt"`
|
||||
WelcomeMessage string `json:"welcomeMessage"`
|
||||
ReplyTimeoutSeconds int `json:"replyTimeoutSeconds"`
|
||||
Teams []AIAgentTeamResponse `json:"teams"`
|
||||
HandoffMode enums.AIAgentHandoffMode `json:"handoffMode"`
|
||||
HandoffModeName string `json:"handoffModeName"`
|
||||
MaxAIReplyRounds int `json:"maxAiReplyRounds"`
|
||||
FallbackMode enums.AIAgentFallbackMode `json:"fallbackMode"`
|
||||
FallbackModeName string `json:"fallbackModeName"`
|
||||
FallbackMessage string `json:"fallbackMessage"`
|
||||
KnowledgeIDs []int64 `json:"knowledgeIds"`
|
||||
KnowledgeBaseNames []string `json:"knowledgeBaseNames"`
|
||||
SkillIDs []int64 `json:"skillIds"`
|
||||
Skills []AIAgentSkillResponse `json:"skills"`
|
||||
DirectTools []AIAgentMCPToolResponse `json:"directTools"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type AssetResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
AssetID string `json:"assetId"`
|
||||
Provider enums.AssetProvider `json:"provider"`
|
||||
Filename string `json:"filename"`
|
||||
FileSize int64 `json:"fileSize"`
|
||||
MimeType string `json:"mimeType"`
|
||||
Status enums.AssetStatus `json:"status"`
|
||||
StorageKey string `json:"storageKey"`
|
||||
URL string `json:"url"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
CreateUserID int64 `json:"createUserId"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
UpdateUserID int64 `json:"updateUserId"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type AuthUserResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
Status enums.Status `json:"status"`
|
||||
Roles []string `json:"roles"`
|
||||
}
|
||||
|
||||
type LoginResponse struct {
|
||||
AccessToken string `json:"accessToken"`
|
||||
RefreshToken string `json:"refreshToken"`
|
||||
ExpiresAt string `json:"expiresAt"`
|
||||
User *AuthUserResponse `json:"user"`
|
||||
Permissions []string `json:"permissions"`
|
||||
Roles []string `json:"roles"`
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"cs-agent/internal/models"
|
||||
"cs-agent/internal/pkg/enums"
|
||||
)
|
||||
|
||||
type ChannelResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ChannelType string `json:"channelType"`
|
||||
ChannelID string `json:"channelId"`
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
AIAgentName string `json:"aiAgentName,omitempty"`
|
||||
Name string `json:"name"`
|
||||
ConfigJSON string `json:"configJson"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
func BuildChannelResponse(item *models.Channel) ChannelResponse {
|
||||
if item == nil {
|
||||
return ChannelResponse{}
|
||||
}
|
||||
return ChannelResponse{
|
||||
ID: item.ID,
|
||||
ChannelType: item.ChannelType,
|
||||
ChannelID: item.ChannelID,
|
||||
AIAgentID: item.AIAgentID,
|
||||
Name: item.Name,
|
||||
ConfigJSON: item.ConfigJSON,
|
||||
Status: item.Status,
|
||||
Remark: item.Remark,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type CompanyResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
CustomerCount int64 `json:"customerCount"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type ConversationTagResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type ConversationParticipantResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ParticipantType string `json:"participantType"`
|
||||
ParticipantID int64 `json:"participantId"`
|
||||
ExternalParticipantID string `json:"externalParticipantId,omitempty"`
|
||||
JoinedAt string `json:"joinedAt,omitempty"`
|
||||
LeftAt string `json:"leftAt,omitempty"`
|
||||
Status enums.Status `json:"status"`
|
||||
}
|
||||
|
||||
type ConversationResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
CustomerID int64 `json:"customerId"`
|
||||
ExternalSource enums.ExternalSource `json:"externalSource"`
|
||||
ExternalID string `json:"externalId"`
|
||||
Subject string `json:"subject"`
|
||||
Status enums.IMConversationStatus `json:"status"`
|
||||
ServiceMode enums.IMConversationServiceMode `json:"serviceMode"`
|
||||
Priority int `json:"priority"`
|
||||
CurrentAssigneeID int64 `json:"currentAssigneeId"`
|
||||
CurrentAssigneeName string `json:"currentAssigneeName,omitempty"`
|
||||
LastMessageID int64 `json:"lastMessageId"`
|
||||
LastMessageAt string `json:"lastMessageAt,omitempty"`
|
||||
LastActiveAt string `json:"lastActiveAt,omitempty"`
|
||||
LastMessageSummary string `json:"lastMessageSummary,omitempty"`
|
||||
CustomerUnreadCount int `json:"customerUnreadCount"`
|
||||
AgentUnreadCount int `json:"agentUnreadCount"`
|
||||
CustomerLastReadMessageID int64 `json:"customerLastReadMessageId"`
|
||||
CustomerLastReadSeqNo int64 `json:"customerLastReadSeqNo"`
|
||||
CustomerLastReadAt string `json:"customerLastReadAt,omitempty"`
|
||||
AgentLastReadMessageID int64 `json:"agentLastReadMessageId"`
|
||||
AgentLastReadSeqNo int64 `json:"agentLastReadSeqNo"`
|
||||
AgentLastReadAt string `json:"agentLastReadAt,omitempty"`
|
||||
ClosedAt string `json:"closedAt,omitempty"`
|
||||
ClosedBy int64 `json:"closedBy"`
|
||||
ClosedByName string `json:"closedByName,omitempty"`
|
||||
CloseReason string `json:"closeReason,omitempty"`
|
||||
}
|
||||
|
||||
type ConversationDetailResponse struct {
|
||||
ConversationResponse
|
||||
Participants []ConversationParticipantResponse `json:"participants,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type CustomerContactResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
CustomerID int64 `json:"customerId"`
|
||||
ContactType enums.ContactType `json:"contactType"`
|
||||
ContactValue string `json:"contactValue"`
|
||||
IsPrimary bool `json:"isPrimary"`
|
||||
IsVerified bool `json:"isVerified"`
|
||||
VerifiedAt string `json:"verifiedAt,omitempty"`
|
||||
Source string `json:"source"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type CustomerResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Gender enums.Gender `json:"gender"`
|
||||
CompanyID int64 `json:"companyId"`
|
||||
Company *CompanyResponse `json:"company"`
|
||||
LastActiveAt string `json:"lastActiveAt"`
|
||||
PrimaryMobile string `json:"primaryMobile"`
|
||||
PrimaryEmail string `json:"primaryEmail"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package response
|
||||
|
||||
type DashboardOverviewResponse struct {
|
||||
Range string `json:"range"`
|
||||
GeneratedAt string `json:"generatedAt"`
|
||||
Summary DashboardSummaryResponse `json:"summary"`
|
||||
ConversationStats DashboardSectionStatsResponse `json:"conversationStats"`
|
||||
AgentStats DashboardAgentStatsResponse `json:"agentStats"`
|
||||
AIStats DashboardAIStatsResponse `json:"aiStats"`
|
||||
Alerts []DashboardAlertResponse `json:"alerts"`
|
||||
QuickLinks []DashboardQuickLinkResponse `json:"quickLinks"`
|
||||
}
|
||||
|
||||
type DashboardSummaryResponse struct {
|
||||
TodayNewConversations int64 `json:"todayNewConversations"`
|
||||
ProcessingConversations int64 `json:"processingConversations"`
|
||||
PendingDispatchConversations int64 `json:"pendingDispatchConversations"`
|
||||
OnlineAgents int64 `json:"onlineAgents"`
|
||||
AIServiceRate float64 `json:"aiServiceRate"`
|
||||
}
|
||||
|
||||
type DashboardSectionStatsResponse struct {
|
||||
StatusDistribution []DashboardStatusDistributionItem `json:"statusDistribution"`
|
||||
Trend []DashboardTrendItem `json:"trend"`
|
||||
}
|
||||
|
||||
type DashboardStatusDistributionItem struct {
|
||||
Status int `json:"status"`
|
||||
Label string `json:"label"`
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
|
||||
type DashboardTrendItem struct {
|
||||
Date string `json:"date"`
|
||||
NewCount int64 `json:"newCount"`
|
||||
ClosedCount int64 `json:"closedCount"`
|
||||
}
|
||||
|
||||
type DashboardAgentStatsResponse struct {
|
||||
OnlineAgents int64 `json:"onlineAgents"`
|
||||
BusyAgents int64 `json:"busyAgents"`
|
||||
OfflineAgents int64 `json:"offlineAgents"`
|
||||
TeamLoads []DashboardTeamLoadResponse `json:"teamLoads"`
|
||||
}
|
||||
|
||||
type DashboardTeamLoadResponse struct {
|
||||
TeamID int64 `json:"teamId"`
|
||||
TeamName string `json:"teamName"`
|
||||
TotalAgents int64 `json:"totalAgents"`
|
||||
OnlineAgents int64 `json:"onlineAgents"`
|
||||
BusyAgents int64 `json:"busyAgents"`
|
||||
OfflineAgents int64 `json:"offlineAgents"`
|
||||
WaitingConversations int64 `json:"waitingConversations"`
|
||||
ProcessingConversations int64 `json:"processingConversations"`
|
||||
MaxConcurrentCapacity int64 `json:"maxConcurrentCapacity"`
|
||||
LoadRate float64 `json:"loadRate"`
|
||||
HasScheduleNow bool `json:"hasScheduleNow"`
|
||||
}
|
||||
|
||||
type DashboardAIStatsResponse struct {
|
||||
EnabledAIAgents int64 `json:"enabledAiAgents"`
|
||||
EnabledChannels int64 `json:"enabledChannels"`
|
||||
TodayKnowledgeRetrieves int64 `json:"todayKnowledgeRetrieves"`
|
||||
TodayKnowledgeRetrieveFailCount int64 `json:"todayKnowledgeRetrieveFailCount"`
|
||||
TodayKnowledgeRetrieveFailRate float64 `json:"todayKnowledgeRetrieveFailRate"`
|
||||
TodaySkillRunFailCount int64 `json:"todaySkillRunFailCount"`
|
||||
TodayAIHandoffCount int64 `json:"todayAiHandoffCount"`
|
||||
}
|
||||
|
||||
type DashboardAlertResponse struct {
|
||||
ID string `json:"id"`
|
||||
Level string `json:"level"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Count int64 `json:"count"`
|
||||
Link string `json:"link"`
|
||||
}
|
||||
|
||||
type DashboardQuickLinkResponse struct {
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Link string `json:"link"`
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"time"
|
||||
)
|
||||
|
||||
type KnowledgeBaseResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
KnowledgeType string `json:"knowledgeType"`
|
||||
KnowledgeTypeName string `json:"knowledgeTypeName"`
|
||||
Status enums.Status `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
DefaultTopK int `json:"defaultTopK"`
|
||||
DefaultScoreThreshold float64 `json:"defaultScoreThreshold"`
|
||||
DefaultRerankLimit int `json:"defaultRerankLimit"`
|
||||
ChunkProvider string `json:"chunkProvider"`
|
||||
ChunkTargetTokens int `json:"chunkTargetTokens"`
|
||||
ChunkMaxTokens int `json:"chunkMaxTokens"`
|
||||
ChunkOverlapTokens int `json:"chunkOverlapTokens"`
|
||||
AnswerMode int `json:"answerMode"`
|
||||
AnswerModeName string `json:"answerModeName"`
|
||||
FallbackMode int `json:"fallbackMode"`
|
||||
FallbackModeName string `json:"fallbackModeName"`
|
||||
DocumentCount int64 `json:"documentCount"`
|
||||
FAQCount int64 `json:"faqCount"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
}
|
||||
|
||||
type KnowledgeDocumentResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
KnowledgeBaseName string `json:"knowledgeBaseName,omitempty"`
|
||||
Title string `json:"title"`
|
||||
ContentType enums.KnowledgeDocumentContentType `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
Status enums.Status `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
IndexStatus enums.KnowledgeDocumentIndexStatus `json:"indexStatus"`
|
||||
IndexStatusName string `json:"indexStatusName"`
|
||||
IndexedAt *time.Time `json:"indexedAt"`
|
||||
IndexError string `json:"indexError"`
|
||||
ContentHash string `json:"contentHash"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
}
|
||||
|
||||
type KnowledgeFAQResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
KnowledgeBaseName string `json:"knowledgeBaseName,omitempty"`
|
||||
Question string `json:"question"`
|
||||
Answer string `json:"answer"`
|
||||
SimilarQuestions []string `json:"similarQuestions"`
|
||||
Status enums.Status `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
IndexStatus enums.KnowledgeDocumentIndexStatus `json:"indexStatus"`
|
||||
IndexStatusName string `json:"indexStatusName"`
|
||||
IndexedAt *time.Time `json:"indexedAt"`
|
||||
IndexError string `json:"indexError"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
}
|
||||
|
||||
type KnowledgeSearchResult struct {
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
ChunkID int64 `json:"chunkId"`
|
||||
DocumentID int64 `json:"documentId"`
|
||||
DocumentTitle string `json:"documentTitle"`
|
||||
FaqID int64 `json:"faqId"`
|
||||
FaqQuestion string `json:"faqQuestion"`
|
||||
ChunkNo int `json:"chunkNo"`
|
||||
Title string `json:"title"`
|
||||
SectionPath string `json:"sectionPath"`
|
||||
Content string `json:"content"`
|
||||
Score float64 `json:"score"`
|
||||
RerankScore float64 `json:"rerankScore"`
|
||||
}
|
||||
|
||||
type KnowledgeSearchResponse struct {
|
||||
Question string `json:"question"`
|
||||
Results []KnowledgeSearchResult `json:"results"`
|
||||
HitCount int `json:"hitCount"`
|
||||
LatencyMs int64 `json:"latencyMs"`
|
||||
}
|
||||
|
||||
type KnowledgeAnswerResponse struct {
|
||||
Question string `json:"question"`
|
||||
RewriteQuestion string `json:"rewriteQuestion,omitempty"`
|
||||
Answer string `json:"answer"`
|
||||
AnswerStatus int `json:"answerStatus"`
|
||||
AnswerStatusName string `json:"answerStatusName"`
|
||||
Citations []KnowledgeCitation `json:"citations"`
|
||||
Hits []KnowledgeSearchResult `json:"hits"`
|
||||
HitCount int `json:"hitCount"`
|
||||
TopScore float64 `json:"topScore"`
|
||||
LatencyMs int64 `json:"latencyMs"`
|
||||
RetrieveMs int64 `json:"retrieveMs"`
|
||||
GenerateMs int64 `json:"generateMs"`
|
||||
PromptTokens int `json:"promptTokens"`
|
||||
CompletionTokens int `json:"completionTokens"`
|
||||
ModelName string `json:"modelName"`
|
||||
RetrieveLogID int64 `json:"retrieveLogId"`
|
||||
}
|
||||
|
||||
type KnowledgeCitation struct {
|
||||
DocumentID int64 `json:"documentId"`
|
||||
DocumentTitle string `json:"documentTitle"`
|
||||
FaqID int64 `json:"faqId"`
|
||||
FaqQuestion string `json:"faqQuestion"`
|
||||
ChunkNo int `json:"chunkNo"`
|
||||
Title string `json:"title"`
|
||||
SectionPath string `json:"sectionPath"`
|
||||
Snippet string `json:"snippet"`
|
||||
Score float64 `json:"score"`
|
||||
}
|
||||
|
||||
type KnowledgeRetrieveLogResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
KnowledgeBaseName string `json:"knowledgeBaseName,omitempty"`
|
||||
Channel string `json:"channel"`
|
||||
ChannelName string `json:"channelName"`
|
||||
Scene string `json:"scene"`
|
||||
SceneName string `json:"sceneName"`
|
||||
SessionID string `json:"sessionId"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
RequestID string `json:"requestId"`
|
||||
Question string `json:"question"`
|
||||
RewriteQuestion string `json:"rewriteQuestion"`
|
||||
Answer string `json:"answer"`
|
||||
AnswerStatus int `json:"answerStatus"`
|
||||
AnswerStatusName string `json:"answerStatusName"`
|
||||
HitCount int `json:"hitCount"`
|
||||
TopScore float64 `json:"topScore"`
|
||||
ChunkProvider string `json:"chunkProvider"`
|
||||
ChunkTargetTokens int `json:"chunkTargetTokens"`
|
||||
ChunkMaxTokens int `json:"chunkMaxTokens"`
|
||||
ChunkOverlapTokens int `json:"chunkOverlapTokens"`
|
||||
RerankEnabled bool `json:"rerankEnabled"`
|
||||
RerankLimit int `json:"rerankLimit"`
|
||||
CitationCount int `json:"citationCount"`
|
||||
UsedChunkCount int `json:"usedChunkCount"`
|
||||
LatencyMs int64 `json:"latencyMs"`
|
||||
RetrieveMs int64 `json:"retrieveMs"`
|
||||
GenerateMs int64 `json:"generateMs"`
|
||||
PromptTokens int `json:"promptTokens"`
|
||||
CompletionTokens int `json:"completionTokens"`
|
||||
ModelName string `json:"modelName"`
|
||||
TraceData string `json:"traceData"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type KnowledgeRetrieveHitResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
RetrieveLogID int64 `json:"retrieveLogId"`
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
ChunkID int64 `json:"chunkId"`
|
||||
DocumentID int64 `json:"documentId"`
|
||||
DocumentTitle string `json:"documentTitle"`
|
||||
FaqID int64 `json:"faqId"`
|
||||
FaqQuestion string `json:"faqQuestion"`
|
||||
ChunkNo int `json:"chunkNo"`
|
||||
Title string `json:"title"`
|
||||
SectionPath string `json:"sectionPath"`
|
||||
ChunkType string `json:"chunkType"`
|
||||
ChunkTypeName string `json:"chunkTypeName"`
|
||||
Provider string `json:"provider"`
|
||||
RankNo int `json:"rankNo"`
|
||||
Score float64 `json:"score"`
|
||||
RerankScore float64 `json:"rerankScore"`
|
||||
UsedInAnswer bool `json:"usedInAnswer"`
|
||||
IsCitation bool `json:"isCitation"`
|
||||
Snippet string `json:"snippet"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type KnowledgeRetrieveLogDetailResponse struct {
|
||||
Log KnowledgeRetrieveLogResponse `json:"log"`
|
||||
Hits []KnowledgeRetrieveHitResponse `json:"hits"`
|
||||
}
|
||||
|
||||
type KnowledgeFeedbackResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
RetrieveLogID int64 `json:"retrieveLogId"`
|
||||
FeedbackType int `json:"feedbackType"`
|
||||
FeedbackTypeName string `json:"feedbackTypeName"`
|
||||
FeedbackReason string `json:"feedbackReason"`
|
||||
UserID int64 `json:"userId"`
|
||||
AgentID int64 `json:"agentId"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/ai/mcps"
|
||||
|
||||
type MCPConnectionResponse struct {
|
||||
ServerCode string `json:"serverCode"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
Protocol string `json:"protocol"`
|
||||
ServerName string `json:"serverName"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
func BuildMCPConnectionResponse(item *mcps.ConnectionResult) *MCPConnectionResponse {
|
||||
if item == nil {
|
||||
return nil
|
||||
}
|
||||
return &MCPConnectionResponse{
|
||||
ServerCode: item.ServerCode,
|
||||
Endpoint: item.Endpoint,
|
||||
Protocol: item.Protocol,
|
||||
ServerName: item.ServerName,
|
||||
Version: item.Version,
|
||||
}
|
||||
}
|
||||
|
||||
type MCPServerInfoResponse struct {
|
||||
Code string `json:"code"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
TimeoutMS int `json:"timeoutMs"`
|
||||
}
|
||||
|
||||
func BuildMCPServerInfoResponses(items []mcps.ServerInfo) []MCPServerInfoResponse {
|
||||
ret := make([]MCPServerInfoResponse, 0, len(items))
|
||||
for _, item := range items {
|
||||
ret = append(ret, MCPServerInfoResponse{
|
||||
Code: item.Code,
|
||||
Enabled: item.Enabled,
|
||||
Endpoint: item.Endpoint,
|
||||
TimeoutMS: item.TimeoutMS,
|
||||
})
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
type MCPToolInfoResponse struct {
|
||||
Name string `json:"name"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
InputSchema any `json:"inputSchema"`
|
||||
OutputSchema any `json:"outputSchema,omitempty"`
|
||||
}
|
||||
|
||||
func BuildMCPToolInfoResponses(items []mcps.ToolInfo) []MCPToolInfoResponse {
|
||||
ret := make([]MCPToolInfoResponse, 0, len(items))
|
||||
for _, item := range items {
|
||||
ret = append(ret, MCPToolInfoResponse{
|
||||
Name: item.Name,
|
||||
Title: item.Title,
|
||||
Description: item.Description,
|
||||
InputSchema: item.InputSchema,
|
||||
OutputSchema: item.OutputSchema,
|
||||
})
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
type MCPToolResultContentResponse struct {
|
||||
Type string `json:"type"`
|
||||
Text string `json:"text,omitempty"`
|
||||
Data any `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
type MCPCallToolResponse struct {
|
||||
ServerCode string `json:"serverCode"`
|
||||
ToolName string `json:"toolName"`
|
||||
IsError bool `json:"isError"`
|
||||
Content []MCPToolResultContentResponse `json:"content"`
|
||||
StructuredContent any `json:"structuredContent,omitempty"`
|
||||
}
|
||||
|
||||
func BuildMCPCallToolResponse(item *mcps.ToolCallResult) *MCPCallToolResponse {
|
||||
if item == nil {
|
||||
return nil
|
||||
}
|
||||
content := make([]MCPToolResultContentResponse, 0, len(item.Content))
|
||||
for _, c := range item.Content {
|
||||
content = append(content, MCPToolResultContentResponse{
|
||||
Type: c.Type,
|
||||
Text: c.Text,
|
||||
Data: c.Data,
|
||||
})
|
||||
}
|
||||
return &MCPCallToolResponse{
|
||||
ServerCode: item.ServerCode,
|
||||
ToolName: item.ToolName,
|
||||
IsError: item.IsError,
|
||||
Content: content,
|
||||
StructuredContent: item.StructuredContent,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type MessageResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
ClientMsgID string `json:"clientMsgId,omitempty"`
|
||||
SenderType enums.IMSenderType `json:"senderType"`
|
||||
SenderID int64 `json:"senderId"`
|
||||
SenderName string `json:"senderName,omitempty"`
|
||||
SenderAvatar string `json:"senderAvatar,omitempty"`
|
||||
MessageType enums.IMMessageType `json:"messageType"`
|
||||
Content string `json:"content"`
|
||||
Payload string `json:"payload,omitempty"`
|
||||
SeqNo int64 `json:"seqNo"`
|
||||
SendStatus int `json:"sendStatus"`
|
||||
SentAt string `json:"sentAt,omitempty"`
|
||||
DeliveredAt string `json:"deliveredAt,omitempty"`
|
||||
ReadAt string `json:"readAt,omitempty"`
|
||||
CustomerRead bool `json:"customerRead"`
|
||||
CustomerReadAt string `json:"customerReadAt,omitempty"`
|
||||
AgentRead bool `json:"agentRead"`
|
||||
AgentReadAt string `json:"agentReadAt,omitempty"`
|
||||
RecalledAt string `json:"recalledAt,omitempty"`
|
||||
QuotedMessageID int64 `json:"quotedMessageId,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type QuickReplyResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
GroupName string `json:"groupName"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Status enums.Status `json:"status"`
|
||||
SortNo int `json:"sortNo"`
|
||||
CreatedBy int64 `json:"createdBy"`
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package response
|
||||
|
||||
import "time"
|
||||
|
||||
type SkillDefinitionResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Prompt string `json:"prompt"`
|
||||
ExecutionMode string `json:"executionMode"`
|
||||
ExecutionModeName string `json:"executionModeName"`
|
||||
ExecutionConfig string `json:"executionConfig"`
|
||||
Priority int `json:"priority"`
|
||||
Status int `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
}
|
||||
|
||||
type SkillDebugRunResponse struct {
|
||||
SkillCode string `json:"skillCode"`
|
||||
SkillName string `json:"skillName"`
|
||||
ReplyText string `json:"replyText"`
|
||||
RunLogID int64 `json:"runLogId"`
|
||||
TraceData string `json:"traceData"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
}
|
||||
|
||||
type AgentRunLogResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
MessageID int64 `json:"messageId"`
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
AIConfigID int64 `json:"aiConfigId"`
|
||||
UserMessage string `json:"userMessage"`
|
||||
PlannedAction string `json:"plannedAction"`
|
||||
PlannedSkillCode string `json:"plannedSkillCode"`
|
||||
PlannedToolCode string `json:"plannedToolCode"`
|
||||
PlanReason string `json:"planReason"`
|
||||
FinalAction string `json:"finalAction"`
|
||||
ReplyText string `json:"replyText"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
LatencyMs int64 `json:"latencyMs"`
|
||||
TraceData string `json:"traceData"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type TagResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ParentID int64 `json:"parentId"`
|
||||
Name string `json:"name"`
|
||||
Remark string `json:"remark"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Status enums.Status `json:"status"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type TagTreeResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ParentID int64 `json:"parentId"`
|
||||
Name string `json:"name"`
|
||||
Remark string `json:"remark"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Status enums.Status `json:"status"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
Children []*TagTreeResponse `json:"children"`
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type TicketResolutionCodeResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type TicketPriorityConfigResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
SortNo int `json:"sortNo"`
|
||||
FirstResponseMinutes int `json:"firstResponseMinutes"`
|
||||
ResolutionMinutes int `json:"resolutionMinutes"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package response
|
||||
|
||||
import "cs-agent/internal/pkg/enums"
|
||||
|
||||
type TicketSLAResponse struct {
|
||||
SLAType enums.TicketSLAType `json:"slaType"`
|
||||
TargetMinutes int `json:"targetMinutes"`
|
||||
Status enums.TicketSLAStatus `json:"status"`
|
||||
StartedAt string `json:"startedAt,omitempty"`
|
||||
PausedAt string `json:"pausedAt,omitempty"`
|
||||
StoppedAt string `json:"stoppedAt,omitempty"`
|
||||
BreachedAt string `json:"breachedAt,omitempty"`
|
||||
ElapsedMin int `json:"elapsedMin"`
|
||||
}
|
||||
|
||||
type TicketWatcherResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID int64 `json:"userId"`
|
||||
UserName string `json:"userName,omitempty"`
|
||||
}
|
||||
|
||||
type TicketCommentResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
TicketID int64 `json:"ticketId"`
|
||||
CommentType enums.TicketCommentType `json:"commentType"`
|
||||
AuthorType enums.IMSenderType `json:"authorType"`
|
||||
AuthorID int64 `json:"authorId"`
|
||||
AuthorName string `json:"authorName,omitempty"`
|
||||
ContentType string `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
Payload string `json:"payload,omitempty"`
|
||||
CreatedAt string `json:"createdAt,omitempty"`
|
||||
}
|
||||
|
||||
type TicketEventLogResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
TicketID int64 `json:"ticketId"`
|
||||
EventType enums.TicketEventType `json:"eventType"`
|
||||
OperatorType enums.IMSenderType `json:"operatorType"`
|
||||
OperatorID int64 `json:"operatorId"`
|
||||
OperatorName string `json:"operatorName,omitempty"`
|
||||
OldValue string `json:"oldValue,omitempty"`
|
||||
NewValue string `json:"newValue,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Payload string `json:"payload,omitempty"`
|
||||
CreatedAt string `json:"createdAt,omitempty"`
|
||||
}
|
||||
|
||||
type TicketResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
TicketNo string `json:"ticketNo"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Source enums.TicketSource `json:"source"`
|
||||
Channel string `json:"channel"`
|
||||
CustomerID int64 `json:"customerId"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
Tags []TagResponse `json:"tags,omitempty"`
|
||||
Type string `json:"type"`
|
||||
Priority int64 `json:"priority"`
|
||||
PriorityName string `json:"priorityName,omitempty"`
|
||||
Severity enums.TicketSeverity `json:"severity"`
|
||||
Status enums.TicketStatus `json:"status"`
|
||||
CurrentTeamID int64 `json:"currentTeamId"`
|
||||
CurrentTeamName string `json:"currentTeamName,omitempty"`
|
||||
CurrentAssigneeID int64 `json:"currentAssigneeId"`
|
||||
CurrentAssigneeName string `json:"currentAssigneeName,omitempty"`
|
||||
WatchedByMe bool `json:"watchedByMe"`
|
||||
PendingReason string `json:"pendingReason,omitempty"`
|
||||
CloseReason string `json:"closeReason,omitempty"`
|
||||
ResolutionCode string `json:"resolutionCode,omitempty"`
|
||||
ResolutionCodeName string `json:"resolutionCodeName,omitempty"`
|
||||
ResolutionSummary string `json:"resolutionSummary,omitempty"`
|
||||
FirstResponseAt string `json:"firstResponseAt,omitempty"`
|
||||
ResolvedAt string `json:"resolvedAt,omitempty"`
|
||||
ClosedAt string `json:"closedAt,omitempty"`
|
||||
DueAt string `json:"dueAt,omitempty"`
|
||||
NextReplyDeadlineAt string `json:"nextReplyDeadlineAt,omitempty"`
|
||||
ResolveDeadlineAt string `json:"resolveDeadlineAt,omitempty"`
|
||||
ReopenedCount int `json:"reopenedCount"`
|
||||
CreatedAt string `json:"createdAt,omitempty"`
|
||||
UpdatedAt string `json:"updatedAt,omitempty"`
|
||||
Customer *CustomerResponse `json:"customer,omitempty"`
|
||||
SLA []TicketSLAResponse `json:"sla,omitempty"`
|
||||
}
|
||||
|
||||
type TicketDetailResponse struct {
|
||||
Ticket TicketResponse `json:"ticket"`
|
||||
Watchers []TicketWatcherResponse `json:"watchers,omitempty"`
|
||||
Collaborators []TicketCollaboratorResponse `json:"collaborators,omitempty"`
|
||||
Comments []TicketCommentResponse `json:"comments,omitempty"`
|
||||
Events []TicketEventLogResponse `json:"events,omitempty"`
|
||||
RelatedTickets []TicketRelationResponse `json:"relatedTickets,omitempty"`
|
||||
}
|
||||
|
||||
type TicketSummaryResponse struct {
|
||||
All int64 `json:"all"`
|
||||
Mine int64 `json:"mine"`
|
||||
Watching int64 `json:"watching"`
|
||||
Collaboration int64 `json:"collaboration"`
|
||||
Participating int64 `json:"participating"`
|
||||
Mentioned int64 `json:"mentioned"`
|
||||
Unassigned int64 `json:"unassigned"`
|
||||
PendingCustomer int64 `json:"pendingCustomer"`
|
||||
PendingInternal int64 `json:"pendingInternal"`
|
||||
Overdue int64 `json:"overdue"`
|
||||
}
|
||||
|
||||
type TicketRiskReasonResponse struct {
|
||||
Code string `json:"code"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
|
||||
type TicketRiskOverviewResponse struct {
|
||||
Overdue int64 `json:"overdue"`
|
||||
HighRisk int64 `json:"highRisk"`
|
||||
Unassigned int64 `json:"unassigned"`
|
||||
PendingInternal int64 `json:"pendingInternal"`
|
||||
PendingCustomer int64 `json:"pendingCustomer"`
|
||||
RiskWindowMins int `json:"riskWindowMins"`
|
||||
Reasons []TicketRiskReasonResponse `json:"reasons,omitempty"`
|
||||
}
|
||||
|
||||
type TicketRelationResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
TicketID int64 `json:"ticketId"`
|
||||
RelatedTicketID int64 `json:"relatedTicketId"`
|
||||
RelationType enums.TicketRelationType `json:"relationType"`
|
||||
RelatedTicketNo string `json:"relatedTicketNo,omitempty"`
|
||||
RelatedTicketTitle string `json:"relatedTicketTitle,omitempty"`
|
||||
RelatedTicketStatus enums.TicketStatus `json:"relatedTicketStatus,omitempty"`
|
||||
CurrentTeamName string `json:"currentTeamName,omitempty"`
|
||||
CurrentAssigneeName string `json:"currentAssigneeName,omitempty"`
|
||||
UpdatedAt string `json:"updatedAt,omitempty"`
|
||||
}
|
||||
|
||||
type TicketCollaboratorResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID int64 `json:"userId"`
|
||||
UserName string `json:"userName,omitempty"`
|
||||
TeamName string `json:"teamName,omitempty"`
|
||||
}
|
||||
|
||||
type TicketViewResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Filters map[string]any `json:"filters,omitempty"`
|
||||
SortNo int `json:"sortNo"`
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package response
|
||||
|
||||
type WidgetConfigResponse struct {
|
||||
ChannelID string `json:"channelId"`
|
||||
}
|
||||
Reference in New Issue
Block a user