chore: import clean Agent Desk snapshot (2/7)
This commit is contained in:
64
internal/pkg/dto/response/admin_response.go
Normal file
64
internal/pkg/dto/response/admin_response.go
Normal file
@@ -0,0 +1,64 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/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 PermissionSyncResponse struct {
|
||||
Created int `json:"created"`
|
||||
Updated int `json:"updated"`
|
||||
RolePermissionsAdded int `json:"rolePermissionsAdded"`
|
||||
}
|
||||
|
||||
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"`
|
||||
UserType enums.UserType `json:"userType"`
|
||||
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"`
|
||||
ClientType string `json:"clientType"`
|
||||
ClientIP string `json:"clientIp"`
|
||||
UserAgent string `json:"userAgent"`
|
||||
ExpiredAt string `json:"expiredAt"`
|
||||
RevokedAt string `json:"revokedAt"`
|
||||
LastSeenAt string `json:"lastSeenAt"`
|
||||
}
|
||||
18
internal/pkg/dto/response/agent_evaluation_response.go
Normal file
18
internal/pkg/dto/response/agent_evaluation_response.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package response
|
||||
|
||||
type AgentEvaluationResultResponse struct {
|
||||
CaseID string `json:"caseId"`
|
||||
Category string `json:"category"`
|
||||
Passed bool `json:"passed"`
|
||||
ReplyText string `json:"replyText"`
|
||||
Interrupted bool `json:"interrupted"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Finding string `json:"finding,omitempty"`
|
||||
}
|
||||
|
||||
type AgentEvaluationReportResponse struct {
|
||||
Total int `json:"total"`
|
||||
Passed int `json:"passed"`
|
||||
Results []AgentEvaluationResultResponse `json:"results"`
|
||||
CSV string `json:"csv"`
|
||||
}
|
||||
65
internal/pkg/dto/response/agent_response.go
Normal file
65
internal/pkg/dto/response/agent_response.go
Normal file
@@ -0,0 +1,65 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/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"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type AgentTeamScheduleBatchPreviewResponse struct {
|
||||
Total int `json:"total"`
|
||||
Conflict bool `json:"conflict"`
|
||||
Items []AgentTeamScheduleBatchPreviewItem `json:"items"`
|
||||
}
|
||||
|
||||
type AgentTeamScheduleBatchPreviewItem struct {
|
||||
TeamID int64 `json:"teamId"`
|
||||
TeamName string `json:"teamName"`
|
||||
Date string `json:"date"`
|
||||
Weekday int `json:"weekday"`
|
||||
StartAt string `json:"startAt"`
|
||||
EndAt string `json:"endAt"`
|
||||
Remark string `json:"remark"`
|
||||
Conflict bool `json:"conflict"`
|
||||
ConflictReason string `json:"conflictReason"`
|
||||
}
|
||||
|
||||
type AgentTeamScheduleBatchGenerateResponse struct {
|
||||
Created int `json:"created"`
|
||||
}
|
||||
27
internal/pkg/dto/response/agent_response_test.go
Normal file
27
internal/pkg/dto/response/agent_response_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAgentTeamScheduleResponseOmitsSourceType(t *testing.T) {
|
||||
payload, err := json.Marshal(AgentTeamScheduleResponse{
|
||||
ID: 1,
|
||||
TeamID: 2,
|
||||
StartAt: "2026-04-29 09:00:00",
|
||||
EndAt: "2026-04-29 18:00:00",
|
||||
Remark: "test",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("marshal response error = %v", err)
|
||||
}
|
||||
|
||||
var decoded map[string]any
|
||||
if err := json.Unmarshal(payload, &decoded); err != nil {
|
||||
t.Fatalf("unmarshal response error = %v", err)
|
||||
}
|
||||
if _, ok := decoded["sourceType"]; ok {
|
||||
t.Fatalf("sourceType should not be exposed: %s", payload)
|
||||
}
|
||||
}
|
||||
65
internal/pkg/dto/response/agent_run_response.go
Normal file
65
internal/pkg/dto/response/agent_run_response.go
Normal file
@@ -0,0 +1,65 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/internal/pkg/enums"
|
||||
|
||||
type AgentRunResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
AgentRevisionID int64 `json:"agentRevisionId"`
|
||||
SourceMessageID int64 `json:"sourceMessageId"`
|
||||
WorkflowRunID int64 `json:"workflowRunId"`
|
||||
Status string `json:"status"`
|
||||
PromptTokens int `json:"promptTokens"`
|
||||
CompletionTokens int `json:"completionTokens"`
|
||||
StartedAt string `json:"startedAt"`
|
||||
EndedAt string `json:"endedAt"`
|
||||
DurationMS int64 `json:"durationMs"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
TraceData string `json:"traceData"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
Steps []AgentStepResponse `json:"steps,omitempty"`
|
||||
ToolCalls []AgentToolCallResponse `json:"toolCalls,omitempty"`
|
||||
QualityFeedback *AgentRunQualityFeedbackResponse `json:"qualityFeedback,omitempty"`
|
||||
}
|
||||
|
||||
type AgentRunQualityFeedbackResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
AgentRunID int64 `json:"agentRunId"`
|
||||
ResolutionStatus enums.AgentRunResolutionStatus `json:"resolutionStatus"`
|
||||
EvidenceStatus enums.AgentRunEvidenceStatus `json:"evidenceStatus"`
|
||||
Comment string `json:"comment"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type AgentStepResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
AgentRunID int64 `json:"agentRunId"`
|
||||
WorkflowRunID int64 `json:"workflowRunId"`
|
||||
StepType string `json:"stepType"`
|
||||
StepCode string `json:"stepCode"`
|
||||
Status string `json:"status"`
|
||||
InputPreview string `json:"inputPreview"`
|
||||
OutputPreview string `json:"outputPreview"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
StartedAt string `json:"startedAt"`
|
||||
EndedAt string `json:"endedAt"`
|
||||
DurationMS int `json:"durationMs"`
|
||||
}
|
||||
|
||||
type AgentToolCallResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
AgentRunID int64 `json:"agentRunId"`
|
||||
AgentStepID int64 `json:"agentStepId"`
|
||||
ToolCode string `json:"toolCode"`
|
||||
RiskLevel string `json:"riskLevel"`
|
||||
RequireConfirm bool `json:"requireConfirm"`
|
||||
Status string `json:"status"`
|
||||
ArgumentsPreview string `json:"argumentsPreview"`
|
||||
ResultPreview string `json:"resultPreview"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
DurationMS int `json:"durationMs"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
}
|
||||
9
internal/pkg/dto/response/ai_copilot_response.go
Normal file
9
internal/pkg/dto/response/ai_copilot_response.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package response
|
||||
|
||||
type SuggestReplyResponse struct {
|
||||
Suggestion string `json:"suggestion"`
|
||||
}
|
||||
|
||||
type ConversationSummaryResponse struct {
|
||||
Summary string `json:"summary"`
|
||||
}
|
||||
133
internal/pkg/dto/response/ai_response.go
Normal file
133
internal/pkg/dto/response/ai_response.go
Normal file
@@ -0,0 +1,133 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"agent-desk/internal/models"
|
||||
"agent-desk/internal/pkg/enums"
|
||||
)
|
||||
|
||||
type AIAgentTeamResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type AIAgentSkillResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type AIAgentMCPToolResponse struct {
|
||||
ToolCode string `json:"toolCode"`
|
||||
ServerCode string `json:"serverCode"`
|
||||
ToolName string `json:"toolName"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
RiskLevel string `json:"riskLevel"`
|
||||
RequireConfirmation bool `json:"requireConfirmation"`
|
||||
Arguments map[string]string `json:"arguments"`
|
||||
}
|
||||
|
||||
type AIAgentWorkflowBindingResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
WorkflowID int64 `json:"workflowId"`
|
||||
WorkflowVersionID int64 `json:"workflowVersionId"`
|
||||
WorkflowName string `json:"workflowName"`
|
||||
WorkflowVersion int `json:"workflowVersion"`
|
||||
ToolName string `json:"toolName"`
|
||||
TriggerInstruction string `json:"triggerInstruction"`
|
||||
Priority int `json:"priority"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
type AgentRevisionResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
AgentID int64 `json:"agentId"`
|
||||
Revision int `json:"revision"`
|
||||
Status enums.Status `json:"status"`
|
||||
DefinitionHash string `json:"definitionHash"`
|
||||
PublishedAt string `json:"publishedAt"`
|
||||
PublishedByID int64 `json:"publishedById"`
|
||||
PublishedByName string `json:"publishedByName"`
|
||||
}
|
||||
|
||||
type AIConfigResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Provider enums.AIProvider `json:"provider"`
|
||||
BaseURL string `json:"baseUrl"`
|
||||
HasAPIKey bool `json:"hasApiKey"`
|
||||
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,
|
||||
HasAPIKey: 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"`
|
||||
MaxSteps int `json:"maxSteps"`
|
||||
ContextWindow int `json:"contextWindow"`
|
||||
ToolPolicy string `json:"toolPolicy"`
|
||||
KnowledgePolicy string `json:"knowledgePolicy"`
|
||||
ServiceMode enums.IMConversationServiceMode `json:"serviceMode"`
|
||||
ServiceModeName string `json:"serviceModeName"`
|
||||
SystemPrompt string `json:"systemPrompt"`
|
||||
WelcomeMessage string `json:"welcomeMessage"`
|
||||
ReplyTimeoutSeconds int `json:"replyTimeoutSeconds"`
|
||||
RolloutPercent int `json:"rolloutPercent"`
|
||||
PreviousRolloutPercent int `json:"previousRolloutPercent"`
|
||||
Teams []AIAgentTeamResponse `json:"teams"`
|
||||
HandoffMode enums.AIAgentHandoffMode `json:"handoffMode"`
|
||||
HandoffModeName string `json:"handoffModeName"`
|
||||
FallbackMode enums.AIAgentFallbackMode `json:"fallbackMode"`
|
||||
FallbackModeName string `json:"fallbackModeName"`
|
||||
FallbackMessage string `json:"fallbackMessage"`
|
||||
KnowledgeBaseIDs []int64 `json:"knowledgeBaseIds"`
|
||||
SkillIDs []int64 `json:"skillIds"`
|
||||
Skills []AIAgentSkillResponse `json:"skills"`
|
||||
MCPTools []AIAgentMCPToolResponse `json:"mcpTools"`
|
||||
WorkflowBindings []AIAgentWorkflowBindingResponse `json:"workflowBindings"`
|
||||
PublishedRevisionID int64 `json:"publishedRevisionId"`
|
||||
SortNo int `json:"sortNo"`
|
||||
AutoHandoffOnFailure bool `json:"autoHandoffOnFailure"`
|
||||
HandoffMessage string `json:"handoffMessage"`
|
||||
OffHoursMessage string `json:"offHoursMessage"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
}
|
||||
30
internal/pkg/dto/response/ai_response_test.go
Normal file
30
internal/pkg/dto/response/ai_response_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"agent-desk/internal/models"
|
||||
)
|
||||
|
||||
func TestBuildAIConfigResponseOmitsAPIKey(t *testing.T) {
|
||||
payload, err := json.Marshal(BuildAIConfigResponse(&models.AIConfig{
|
||||
ID: 1,
|
||||
Name: "test",
|
||||
APIKey: "sk-secret",
|
||||
}))
|
||||
if err != nil {
|
||||
t.Fatalf("marshal response error = %v", err)
|
||||
}
|
||||
|
||||
var decoded map[string]any
|
||||
if err := json.Unmarshal(payload, &decoded); err != nil {
|
||||
t.Fatalf("unmarshal response error = %v", err)
|
||||
}
|
||||
if _, ok := decoded["apiKey"]; ok {
|
||||
t.Fatalf("apiKey should not be exposed: %s", payload)
|
||||
}
|
||||
if got, ok := decoded["hasApiKey"].(bool); !ok || !got {
|
||||
t.Fatalf("hasApiKey = %v, want true: %s", decoded["hasApiKey"], payload)
|
||||
}
|
||||
}
|
||||
111
internal/pkg/dto/response/ai_workflow_response.go
Normal file
111
internal/pkg/dto/response/ai_workflow_response.go
Normal file
@@ -0,0 +1,111 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"agent-desk/internal/ai/workflow/dsl"
|
||||
workflowregistry "agent-desk/internal/ai/workflow/registry"
|
||||
workflowvalidator "agent-desk/internal/ai/workflow/validator"
|
||||
"agent-desk/internal/pkg/enums"
|
||||
)
|
||||
|
||||
type AIWorkflowResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Status enums.Status `json:"status"`
|
||||
DraftDefinition dsl.Definition `json:"draftDefinition"`
|
||||
PublishedVersionID int64 `json:"publishedVersionId"`
|
||||
SortNo int `json:"sortNo"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
}
|
||||
|
||||
type AIWorkflowVersionResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
WorkflowID int64 `json:"workflowId"`
|
||||
Version int `json:"version"`
|
||||
Status enums.Status `json:"status"`
|
||||
Definition dsl.Definition `json:"definition"`
|
||||
DefinitionHash string `json:"definitionHash"`
|
||||
PublishedAt string `json:"publishedAt"`
|
||||
PublishedByID int64 `json:"publishedById"`
|
||||
PublishedByName string `json:"publishedByName"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type AIWorkflowValidationResponse struct {
|
||||
Valid bool `json:"valid"`
|
||||
Errors []workflowvalidator.Error `json:"errors"`
|
||||
}
|
||||
|
||||
type AIWorkflowTemplateResponse struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Definition dsl.Definition `json:"definition"`
|
||||
}
|
||||
|
||||
type AIWorkflowUsageResponse struct {
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
AIAgentName string `json:"aiAgentName"`
|
||||
WorkflowVersionID int64 `json:"workflowVersionId"`
|
||||
WorkflowVersion int `json:"workflowVersion"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
type AIWorkflowNodeSpecResponse struct {
|
||||
Type string `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Icon string `json:"icon"`
|
||||
Category string `json:"category"`
|
||||
Executable bool `json:"executable"`
|
||||
RiskLevel workflowregistry.NodeRiskLevel `json:"riskLevel"`
|
||||
Interruptible bool `json:"interruptible"`
|
||||
RequiresConfirmationPredecessor bool `json:"requiresConfirmationPredecessor"`
|
||||
ConfigSchema any `json:"configSchema,omitempty"`
|
||||
InputSchema []workflowregistry.VariableSpec `json:"inputSchema,omitempty"`
|
||||
OutputSchema []workflowregistry.VariableSpec `json:"outputSchema,omitempty"`
|
||||
DefaultInputs map[string]dsl.Value `json:"defaultInputs,omitempty"`
|
||||
}
|
||||
|
||||
type AIWorkflowRunResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
WorkflowID int64 `json:"workflowId"`
|
||||
WorkflowVersionID int64 `json:"workflowVersionId"`
|
||||
WorkflowVersion int `json:"workflowVersion"`
|
||||
WorkflowName string `json:"workflowName"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
AIAgentName string `json:"aiAgentName"`
|
||||
MessageID int64 `json:"messageId"`
|
||||
Status int `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
StartedAt string `json:"startedAt"`
|
||||
EndedAt string `json:"endedAt"`
|
||||
DurationMS int64 `json:"durationMs"`
|
||||
InterruptType string `json:"interruptType"`
|
||||
InterruptNodeID string `json:"interruptNodeId"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
Definition dsl.Definition `json:"definition"`
|
||||
Nodes []AIWorkflowNodeRunResponse `json:"nodes,omitempty"`
|
||||
}
|
||||
|
||||
type AIWorkflowNodeRunResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
WorkflowRunID int64 `json:"workflowRunId"`
|
||||
NodeID string `json:"nodeId"`
|
||||
NodeType string `json:"nodeType"`
|
||||
Status int `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
InputPreview string `json:"inputPreview"`
|
||||
OutputPreview string `json:"outputPreview"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
StartedAt string `json:"startedAt"`
|
||||
EndedAt string `json:"endedAt"`
|
||||
DurationMS int `json:"durationMs"`
|
||||
}
|
||||
21
internal/pkg/dto/response/asset_response.go
Normal file
21
internal/pkg/dto/response/asset_response.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/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"`
|
||||
}
|
||||
30
internal/pkg/dto/response/auth_response.go
Normal file
30
internal/pkg/dto/response/auth_response.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/internal/pkg/enums"
|
||||
|
||||
type AuthUserResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
Email string `json:"email,omitempty"`
|
||||
UserType enums.UserType `json:"userType"`
|
||||
Status enums.Status `json:"status"`
|
||||
Roles []string `json:"roles"`
|
||||
}
|
||||
|
||||
type LoginResponse struct {
|
||||
AccessToken string `json:"accessToken"`
|
||||
ExpiresAt string `json:"expiresAt"`
|
||||
User *AuthUserResponse `json:"user"`
|
||||
Permissions []string `json:"permissions"`
|
||||
Roles []string `json:"roles"`
|
||||
}
|
||||
|
||||
type PublicConfigResponse struct {
|
||||
Language string `json:"language"`
|
||||
CompanyName string `json:"companyName,omitempty"`
|
||||
CompanyLogoURL string `json:"companyLogoUrl,omitempty"`
|
||||
PasswordLoginEnabled bool `json:"passwordLoginEnabled"`
|
||||
OIDCEnabled bool `json:"oidcEnabled"`
|
||||
}
|
||||
78
internal/pkg/dto/response/channel_response.go
Normal file
78
internal/pkg/dto/response/channel_response.go
Normal file
@@ -0,0 +1,78 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"agent-desk/internal/models"
|
||||
"agent-desk/internal/pkg/enums"
|
||||
"agent-desk/internal/pkg/utils"
|
||||
)
|
||||
|
||||
type ChannelResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ChannelType string `json:"channelType"`
|
||||
ChannelID string `json:"channelId"`
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
AIAgentRolloutPercent int `json:"aiAgentRolloutPercent"`
|
||||
PreviousAIAgentRolloutPercent int `json:"previousAiAgentRolloutPercent"`
|
||||
AIAgentName string `json:"aiAgentName,omitempty"`
|
||||
Name string `json:"name"`
|
||||
ConfigJSON string `json:"configJson"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type ChannelMessageOutboxResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ChannelType string `json:"channelType"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
MessageID int64 `json:"messageId"`
|
||||
Payload string `json:"payload"`
|
||||
SendStatus string `json:"sendStatus"`
|
||||
RetryCount int `json:"retryCount"`
|
||||
NextRetryAt string `json:"nextRetryAt"`
|
||||
LastError string `json:"lastError"`
|
||||
SentAt string `json:"sentAt"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
UpdateUserName string `json:"updateUserName"`
|
||||
}
|
||||
|
||||
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,
|
||||
AIAgentRolloutPercent: item.AIAgentRolloutPercent,
|
||||
PreviousAIAgentRolloutPercent: item.PreviousAIAgentRolloutPercent,
|
||||
Name: item.Name,
|
||||
ConfigJSON: item.ConfigJSON,
|
||||
Status: item.Status,
|
||||
Remark: item.Remark,
|
||||
}
|
||||
}
|
||||
|
||||
func BuildChannelMessageOutboxResponse(item *models.ChannelMessageOutbox) ChannelMessageOutboxResponse {
|
||||
if item == nil {
|
||||
return ChannelMessageOutboxResponse{}
|
||||
}
|
||||
return ChannelMessageOutboxResponse{
|
||||
ID: item.ID,
|
||||
ChannelType: item.ChannelType,
|
||||
ConversationID: item.ConversationID,
|
||||
MessageID: item.MessageID,
|
||||
Payload: item.Payload,
|
||||
SendStatus: item.SendStatus,
|
||||
RetryCount: item.RetryCount,
|
||||
NextRetryAt: utils.FormatTimePtr(item.NextRetryAt),
|
||||
LastError: item.LastError,
|
||||
SentAt: utils.FormatTimePtr(item.SentAt),
|
||||
CreatedAt: utils.FormatTime(item.CreatedAt),
|
||||
UpdatedAt: utils.FormatTime(item.UpdatedAt),
|
||||
CreateUserName: item.CreateUserName,
|
||||
UpdateUserName: item.UpdateUserName,
|
||||
}
|
||||
}
|
||||
14
internal/pkg/dto/response/company_response.go
Normal file
14
internal/pkg/dto/response/company_response.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/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"`
|
||||
}
|
||||
55
internal/pkg/dto/response/conversation_response.go
Normal file
55
internal/pkg/dto/response/conversation_response.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/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"`
|
||||
ChannelID int64 `json:"channelId"`
|
||||
CustomerID int64 `json:"customerId"`
|
||||
CustomerName string `json:"customerName"`
|
||||
Subject string `json:"subject,omitempty"`
|
||||
Status enums.IMConversationStatus `json:"status"`
|
||||
ServiceMode enums.IMConversationServiceMode `json:"serviceMode"`
|
||||
Priority int `json:"priority"`
|
||||
CurrentAssigneeID int64 `json:"currentAssigneeId"`
|
||||
CurrentAssigneeName string `json:"currentAssigneeName,omitempty"`
|
||||
CurrentTeamID int64 `json:"currentTeamId"`
|
||||
CurrentTeamName string `json:"currentTeamName,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"`
|
||||
CustomerLastReadAt string `json:"customerLastReadAt,omitempty"`
|
||||
AgentLastReadMessageID int64 `json:"agentLastReadMessageId"`
|
||||
AgentLastReadAt string `json:"agentLastReadAt,omitempty"`
|
||||
CustomerOnline bool `json:"customerOnline"`
|
||||
ClosedAt string `json:"closedAt,omitempty"`
|
||||
ClosedBy int64 `json:"closedBy"`
|
||||
ClosedByName string `json:"closedByName,omitempty"`
|
||||
CloseReason string `json:"closeReason,omitempty"`
|
||||
Satisfaction *ConversationSatisfactionResponse `json:"satisfaction,omitempty"`
|
||||
}
|
||||
|
||||
type ConversationDetailResponse struct {
|
||||
ConversationResponse
|
||||
Participants []ConversationParticipantResponse `json:"participants,omitempty"`
|
||||
}
|
||||
18
internal/pkg/dto/response/customer_contact_response.go
Normal file
18
internal/pkg/dto/response/customer_contact_response.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/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"`
|
||||
}
|
||||
18
internal/pkg/dto/response/customer_response.go
Normal file
18
internal/pkg/dto/response/customer_response.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/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"`
|
||||
}
|
||||
13
internal/pkg/dto/response/customer_session_response.go
Normal file
13
internal/pkg/dto/response/customer_session_response.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package response
|
||||
|
||||
type CustomerSessionCustomerResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type CustomerSessionExchangeResponse struct {
|
||||
CustomerSessionToken string `json:"customerSessionToken"`
|
||||
ExpiresAt string `json:"expiresAt"`
|
||||
IdentityKey string `json:"identityKey"`
|
||||
Customer CustomerSessionCustomerResponse `json:"customer"`
|
||||
}
|
||||
83
internal/pkg/dto/response/dashboard_response.go
Normal file
83
internal/pkg/dto/response/dashboard_response.go
Normal file
@@ -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"`
|
||||
TodayAgentRunFailCount int64 `json:"todayAgentRunFailCount"`
|
||||
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"`
|
||||
}
|
||||
266
internal/pkg/dto/response/knowledge_response.go
Normal file
266
internal/pkg/dto/response/knowledge_response.go
Normal file
@@ -0,0 +1,266 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"agent-desk/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"`
|
||||
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"`
|
||||
DirectoryID int64 `json:"directoryId"`
|
||||
DirectoryName string `json:"directoryName,omitempty"`
|
||||
DirectoryPath string `json:"directoryPath,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 KnowledgeDocumentListResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
KnowledgeBaseName string `json:"knowledgeBaseName,omitempty"`
|
||||
DirectoryID int64 `json:"directoryId"`
|
||||
DirectoryName string `json:"directoryName,omitempty"`
|
||||
DirectoryPath string `json:"directoryPath,omitempty"`
|
||||
Title string `json:"title"`
|
||||
ContentType enums.KnowledgeDocumentContentType `json:"contentType"`
|
||||
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"`
|
||||
DirectoryID int64 `json:"directoryId"`
|
||||
DirectoryName string `json:"directoryName,omitempty"`
|
||||
DirectoryPath string `json:"directoryPath,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 KnowledgeDirectoryResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
ParentID int64 `json:"parentId"`
|
||||
Name string `json:"name"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Status enums.Status `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"`
|
||||
Children []KnowledgeDirectoryResponse `json:"children"`
|
||||
}
|
||||
|
||||
type KnowledgeFAQExportedFile struct {
|
||||
Filename string
|
||||
ContentType string
|
||||
Data []byte
|
||||
}
|
||||
|
||||
type KnowledgeFAQImportError struct {
|
||||
Row int `json:"row"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type KnowledgeFAQImportResult struct {
|
||||
Total int `json:"total"`
|
||||
Created int `json:"created"`
|
||||
Updated int `json:"updated"`
|
||||
Skipped int `json:"skipped"`
|
||||
Failed int `json:"failed"`
|
||||
Errors []KnowledgeFAQImportError `json:"errors"`
|
||||
}
|
||||
|
||||
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"`
|
||||
}
|
||||
121
internal/pkg/dto/response/mcp_response.go
Normal file
121
internal/pkg/dto/response/mcp_response.go
Normal file
@@ -0,0 +1,121 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"agent-desk/internal/ai/mcps"
|
||||
"agent-desk/internal/pkg/enums"
|
||||
)
|
||||
|
||||
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"`
|
||||
ReadOnlyHint bool `json:"readOnlyHint"`
|
||||
}
|
||||
|
||||
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,
|
||||
ReadOnlyHint: item.ReadOnlyHint,
|
||||
})
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
type MCPToolCatalogResponse struct {
|
||||
ToolCode string `json:"toolCode"`
|
||||
ServerCode string `json:"serverCode"`
|
||||
ToolName string `json:"toolName"`
|
||||
SourceType enums.ToolSourceType `json:"sourceType"`
|
||||
AutoInjected bool `json:"autoInjected"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
InputSchema any `json:"inputSchema"`
|
||||
OutputSchema any `json:"outputSchema,omitempty"`
|
||||
RiskLevel string `json:"riskLevel"`
|
||||
RequireConfirmation bool `json:"requireConfirmation"`
|
||||
RiskEditable bool `json:"riskEditable"`
|
||||
}
|
||||
|
||||
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,
|
||||
}
|
||||
}
|
||||
28
internal/pkg/dto/response/message_response.go
Normal file
28
internal/pkg/dto/response/message_response.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/internal/pkg/enums"
|
||||
|
||||
type MessageResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
RequestID string `json:"requestId,omitempty"`
|
||||
WorkflowRunID int64 `json:"workflowRunId,omitempty"`
|
||||
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"`
|
||||
SendStatus enums.IMMessageStatus `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"`
|
||||
}
|
||||
18
internal/pkg/dto/response/notification_response.go
Normal file
18
internal/pkg/dto/response/notification_response.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package response
|
||||
|
||||
type NotificationResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
RecipientUserID int64 `json:"recipientUserId"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
NotificationType string `json:"notificationType"`
|
||||
BizType string `json:"bizType"`
|
||||
BizID int64 `json:"bizId"`
|
||||
ActionURL string `json:"actionUrl"`
|
||||
ReadAt string `json:"readAt,omitempty"`
|
||||
CreatedAt string `json:"createdAt,omitempty"`
|
||||
}
|
||||
|
||||
type NotificationUnreadCountResponse struct {
|
||||
UnreadCount int64 `json:"unreadCount"`
|
||||
}
|
||||
23
internal/pkg/dto/response/organization_response.go
Normal file
23
internal/pkg/dto/response/organization_response.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"agent-desk/internal/pkg/enums"
|
||||
"time"
|
||||
)
|
||||
|
||||
type OrganizationResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Logo string `json:"logo"`
|
||||
Plan string `json:"plan"`
|
||||
Status enums.Status `json:"status"`
|
||||
Role string `json:"role,omitempty"`
|
||||
IsActive bool `json:"isActive"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type UserOrganizationListResponse struct {
|
||||
CurrentOrganizationID int64 `json:"currentOrganizationId"`
|
||||
Organizations []OrganizationResponse `json:"organizations"`
|
||||
}
|
||||
13
internal/pkg/dto/response/quick_reply_response.go
Normal file
13
internal/pkg/dto/response/quick_reply_response.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/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"`
|
||||
}
|
||||
9
internal/pkg/dto/response/satisfaction_response.go
Normal file
9
internal/pkg/dto/response/satisfaction_response.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package response
|
||||
|
||||
type ConversationSatisfactionResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
Score int `json:"score"`
|
||||
Feedback string `json:"feedback"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
}
|
||||
98
internal/pkg/dto/response/setup_readiness_resp.go
Normal file
98
internal/pkg/dto/response/setup_readiness_resp.go
Normal file
@@ -0,0 +1,98 @@
|
||||
package response
|
||||
|
||||
type SetupIssueItem struct {
|
||||
Code string `json:"code"`
|
||||
Severity string `json:"severity"`
|
||||
EntityType string `json:"entity_type"`
|
||||
EntityID int64 `json:"entity_id"`
|
||||
EntityName string `json:"entity_name"`
|
||||
QuickFixAction string `json:"quick_fix_action,omitempty"`
|
||||
}
|
||||
|
||||
type SetupStepItem struct {
|
||||
Key string `json:"key"`
|
||||
StepNumber int `json:"step_number"`
|
||||
Status string `json:"status"`
|
||||
SummaryCode string `json:"summary_code"`
|
||||
TotalCount int `json:"total_count"`
|
||||
ReadyCount int `json:"ready_count"`
|
||||
Issues []SetupIssueItem `json:"issues"`
|
||||
QuickFixActions []string `json:"quick_fix_actions"`
|
||||
ManagePath string `json:"manage_path"`
|
||||
}
|
||||
|
||||
type CurrentOperatorDiagnostic struct {
|
||||
UserID int64 `json:"user_id"`
|
||||
Username string `json:"username"`
|
||||
Nickname string `json:"nickname"`
|
||||
HasProfile bool `json:"has_profile"`
|
||||
ProfileStatusOk bool `json:"profile_status_ok"`
|
||||
TeamID int64 `json:"team_id"`
|
||||
TeamName string `json:"team_name"`
|
||||
TeamActive bool `json:"team_active"`
|
||||
TeamHasScheduleNow bool `json:"team_has_schedule_now"`
|
||||
ServiceStatus int `json:"service_status"`
|
||||
AutoAssignEnabled bool `json:"auto_assign_enabled"`
|
||||
ActiveConversationCount int64 `json:"active_conversation_count"`
|
||||
MaxConcurrentCount int `json:"max_concurrent_count"`
|
||||
CanReceiveNow bool `json:"can_receive_now"`
|
||||
BlockerCodes []string `json:"blocker_codes"`
|
||||
}
|
||||
|
||||
type SetupChannelBrief struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ChannelType string `json:"channel_type"`
|
||||
ChannelID string `json:"channel_id"`
|
||||
AIAgentID int64 `json:"ai_agent_id"`
|
||||
RolloutPercent int `json:"rollout_percent"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type SetupReadinessResponse struct {
|
||||
OverallStatus string `json:"overall_status"`
|
||||
ReadySteps int `json:"ready_steps"`
|
||||
TotalSteps int `json:"total_steps"`
|
||||
CanReceiveRequestsNow bool `json:"can_receive_requests_now"`
|
||||
Steps []SetupStepItem `json:"steps"`
|
||||
CurrentOperator CurrentOperatorDiagnostic `json:"current_operator"`
|
||||
Channels []SetupChannelBrief `json:"channels"`
|
||||
}
|
||||
|
||||
type SimulatedRouteHop struct {
|
||||
HopKey string `json:"hop_key"`
|
||||
Status string `json:"status"`
|
||||
ReasonCode string `json:"reason_code"`
|
||||
EntityID int64 `json:"entity_id,omitempty"`
|
||||
EntityName string `json:"entity_name,omitempty"`
|
||||
QuickFixAction string `json:"quick_fix_action,omitempty"`
|
||||
}
|
||||
|
||||
type SimulatedOperatorCandidate struct {
|
||||
UserID int64 `json:"user_id"`
|
||||
DisplayName string `json:"display_name"`
|
||||
TeamID int64 `json:"team_id"`
|
||||
TeamName string `json:"team_name"`
|
||||
Eligible bool `json:"eligible"`
|
||||
SkipReasonCode string `json:"skip_reason_code"`
|
||||
ActiveCount int64 `json:"active_count"`
|
||||
MaxConcurrentCount int `json:"max_concurrent_count"`
|
||||
ServiceStatus int `json:"service_status"`
|
||||
AutoAssignEnabled bool `json:"auto_assign_enabled"`
|
||||
}
|
||||
|
||||
type SetupSimulateRouteResponse struct {
|
||||
ChannelID int64 `json:"channel_id"`
|
||||
ChannelName string `json:"channel_name"`
|
||||
ChannelType string `json:"channel_type"`
|
||||
WillReachOperator bool `json:"will_reach_operator"`
|
||||
FinalOutcomeCode string `json:"final_outcome_code"`
|
||||
MatchedOperator *SimulatedOperatorCandidate `json:"matched_operator,omitempty"`
|
||||
Hops []SimulatedRouteHop `json:"hops"`
|
||||
CandidateOperators []SimulatedOperatorCandidate `json:"candidate_operators"`
|
||||
}
|
||||
|
||||
type SetupQuickFixResponse struct {
|
||||
AppliedActions []string `json:"applied_actions"`
|
||||
Readiness SetupReadinessResponse `json:"readiness"`
|
||||
}
|
||||
34
internal/pkg/dto/response/skill_response.go
Normal file
34
internal/pkg/dto/response/skill_response.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package response
|
||||
|
||||
import "time"
|
||||
|
||||
type SkillDefinitionResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Instruction string `json:"instruction"`
|
||||
Examples []string `json:"examples"`
|
||||
ToolWhitelist []string `json:"toolWhitelist"`
|
||||
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 {
|
||||
SkillDefinitionID int64 `json:"skillDefinitionId"`
|
||||
SkillName string `json:"skillName"`
|
||||
ReplyText string `json:"replyText"`
|
||||
ToolWhitelist []string `json:"toolWhitelist"`
|
||||
InvokedToolCodes []string `json:"invokedToolCodes"`
|
||||
InterruptType string `json:"interruptType"`
|
||||
CheckPointID string `json:"checkPointId"`
|
||||
Interrupted bool `json:"interrupted"`
|
||||
TraceData string `json:"traceData"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
ConversationID int64 `json:"conversationId"`
|
||||
AIAgentID int64 `json:"aiAgentId"`
|
||||
}
|
||||
143
internal/pkg/dto/response/support_response.go
Normal file
143
internal/pkg/dto/response/support_response.go
Normal file
@@ -0,0 +1,143 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/internal/pkg/enums"
|
||||
|
||||
type ConfigFieldError struct {
|
||||
Path string `json:"path"`
|
||||
Code string `json:"code"`
|
||||
MessageKey string `json:"-"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type SupportUserResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
UserType enums.UserType `json:"userType"`
|
||||
}
|
||||
|
||||
type SupportNavigationMenuItemResponse struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
URL string `json:"url"`
|
||||
OpenInNewWindow bool `json:"openInNewWindow"`
|
||||
Visible bool `json:"visible"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Children []SupportNavigationMenuItemResponse `json:"children,omitempty"`
|
||||
}
|
||||
|
||||
type PublicSupportConfigResponse struct {
|
||||
NavigationMenu []SupportNavigationMenuItemResponse `json:"navigationMenu"`
|
||||
}
|
||||
|
||||
type DashboardSupportConfigResponse struct {
|
||||
NavigationMenu []SupportNavigationMenuItemResponse `json:"navigationMenu"`
|
||||
}
|
||||
|
||||
// DashboardBrandingResponse shows both what is saved and what is actually in
|
||||
// effect. They differ whenever configuration supplies a fallback, and an operator
|
||||
// editing this form needs to see which one they are changing.
|
||||
type DashboardBrandingResponse struct {
|
||||
CompanyName string `json:"companyName"`
|
||||
CompanyLogoURL string `json:"companyLogoUrl"`
|
||||
// Saved* is what this form would persist; Configured* comes from the file or
|
||||
// environment; Effective* is what every page will render.
|
||||
SavedCompanyName string `json:"savedCompanyName"`
|
||||
SavedCompanyLogoURL string `json:"savedCompanyLogoUrl"`
|
||||
ConfiguredCompanyName string `json:"configuredCompanyName"`
|
||||
ConfiguredCompanyLogo string `json:"configuredCompanyLogoUrl"`
|
||||
EffectiveCompanyName string `json:"effectiveCompanyName"`
|
||||
UsesConfiguredFallback bool `json:"usesConfiguredFallback"`
|
||||
}
|
||||
|
||||
type DocPageResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ParentID int64 `json:"parentId"`
|
||||
Title string `json:"title"`
|
||||
Slug string `json:"slug"`
|
||||
Summary string `json:"summary"`
|
||||
ContentType string `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
CoverURL string `json:"coverUrl"`
|
||||
Tags []string `json:"tags"`
|
||||
Status enums.DocPageStatus `json:"status"`
|
||||
SortNo int `json:"sortNo"`
|
||||
ViewCount int64 `json:"viewCount"`
|
||||
HelpfulCount int64 `json:"helpfulCount"`
|
||||
UnhelpfulCount int64 `json:"unhelpfulCount"`
|
||||
PublishedAt string `json:"publishedAt"`
|
||||
SyncedKnowledgeDocumentID int64 `json:"syncedKnowledgeDocumentId"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// DocPageNavigationResponse is the lightweight public document tree.
|
||||
// Content remains available only from the doc-page detail endpoint.
|
||||
type DocPageNavigationResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ParentID int64 `json:"parentId"`
|
||||
Title string `json:"title"`
|
||||
Slug string `json:"slug"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Children []*DocPageNavigationResponse `json:"children"`
|
||||
}
|
||||
|
||||
type CategoryResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Slug string `json:"slug"`
|
||||
Description string `json:"description"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Status enums.Status `json:"status"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type PostResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
CategoryID int64 `json:"categoryId"`
|
||||
CategoryName string `json:"categoryName"`
|
||||
UserID int64 `json:"userId"`
|
||||
UserName string `json:"userName"`
|
||||
UserType enums.UserType `json:"userType"`
|
||||
Title string `json:"title"`
|
||||
ContentType string `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
Tags []string `json:"tags"`
|
||||
Status enums.PostStatus `json:"status"`
|
||||
AcceptedCommentID int64 `json:"acceptedCommentId"`
|
||||
CommentCount int64 `json:"commentCount"`
|
||||
ReactionCount int64 `json:"reactionCount"`
|
||||
ViewCount int64 `json:"viewCount"`
|
||||
LastCommentedAt string `json:"lastCommentedAt"`
|
||||
LastCommentUserType enums.CommentAuthorType `json:"lastCommentUserType"`
|
||||
LastCommentUserID int64 `json:"lastCommentUserId"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type CommentResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
PostID int64 `json:"postId"`
|
||||
ParentID int64 `json:"parentId"`
|
||||
AuthorType enums.CommentAuthorType `json:"authorType"`
|
||||
AuthorID int64 `json:"authorId"`
|
||||
AuthorName string `json:"authorName"`
|
||||
ContentType string `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
Status enums.CommentStatus `json:"status"`
|
||||
ReactionCount int64 `json:"reactionCount"`
|
||||
ReplyCount int64 `json:"replyCount"`
|
||||
ReportCount int64 `json:"reportCount"`
|
||||
IsAccepted bool `json:"isAccepted"`
|
||||
Replies []CommentResponse `json:"replies"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type PostDetailResponse struct {
|
||||
Post PostResponse `json:"post"`
|
||||
Comments []CommentResponse `json:"comments"`
|
||||
}
|
||||
26
internal/pkg/dto/response/tag_response.go
Normal file
26
internal/pkg/dto/response/tag_response.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/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"`
|
||||
}
|
||||
55
internal/pkg/dto/response/ticket_response.go
Normal file
55
internal/pkg/dto/response/ticket_response.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package response
|
||||
|
||||
import "agent-desk/internal/pkg/enums"
|
||||
|
||||
type TicketProgressResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
TicketID int64 `json:"ticketId"`
|
||||
Content string `json:"content"`
|
||||
AuthorID int64 `json:"authorId"`
|
||||
AuthorName string `json:"authorName,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"`
|
||||
Status enums.TicketStatus `json:"status"`
|
||||
CurrentAssigneeID int64 `json:"currentAssigneeId"`
|
||||
CurrentAssigneeName string `json:"currentAssigneeName,omitempty"`
|
||||
CreatedBy int64 `json:"createdBy"`
|
||||
CreatedByName string `json:"createdByName,omitempty"`
|
||||
HandledAt string `json:"handledAt,omitempty"`
|
||||
CreatedAt string `json:"createdAt,omitempty"`
|
||||
UpdatedAt string `json:"updatedAt,omitempty"`
|
||||
Customer *CustomerResponse `json:"customer,omitempty"`
|
||||
}
|
||||
|
||||
type TicketDetailResponse struct {
|
||||
Ticket TicketResponse `json:"ticket"`
|
||||
Progresses []TicketProgressResponse `json:"progresses,omitempty"`
|
||||
}
|
||||
|
||||
type TicketSummaryResponse struct {
|
||||
All int64 `json:"all"`
|
||||
Pending int64 `json:"pending"`
|
||||
InProgress int64 `json:"inProgress"`
|
||||
Done int64 `json:"done"`
|
||||
Unassigned int64 `json:"unassigned"`
|
||||
Mine int64 `json:"mine"`
|
||||
Stale int64 `json:"stale"`
|
||||
}
|
||||
|
||||
type TicketViewResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Filters map[string]any `json:"filters,omitempty"`
|
||||
SortNo int `json:"sortNo"`
|
||||
}
|
||||
12
internal/pkg/dto/response/widget_response.go
Normal file
12
internal/pkg/dto/response/widget_response.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package response
|
||||
|
||||
type WidgetConfigResponse struct {
|
||||
ChannelID string `json:"channelId"`
|
||||
ChannelType string `json:"channelType"`
|
||||
Title string `json:"title"`
|
||||
Subtitle string `json:"subtitle"`
|
||||
ThemeColor string `json:"themeColor"`
|
||||
Position string `json:"position"`
|
||||
Width string `json:"width"`
|
||||
PromptStarters []string `json:"promptStarters,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user