refactor: replace skill code with skill ID across the application

- Updated skill handling to use skill IDs instead of skill codes in various components, services, and models.
- Modified tests to reflect changes in skill identification.
- Removed references to skill codes in favor of skill IDs for consistency and clarity.
- Updated localization files to remove skill code references and adjust error messages accordingly.
This commit is contained in:
mlogclub
2026-06-20 20:42:07 +08:00
parent 39c648f3c1
commit 541e4c5874
49 changed files with 258 additions and 341 deletions
+4 -6
View File
@@ -2,12 +2,10 @@ package request
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"`
Instruction string `json:"instruction"`
@@ -35,10 +33,10 @@ type UpdateSkillDefinitionStatusRequest struct {
}
type SkillDebugRunRequest struct {
AIAgentID int64 `json:"aiAgentId"`
ConversationID int64 `json:"conversationId"`
SkillCode string `json:"skillCode"`
UserMessage string `json:"userMessage"`
AIAgentID int64 `json:"aiAgentId"`
ConversationID int64 `json:"conversationId"`
SkillDefinitionID int64 `json:"skillDefinitionId"`
UserMessage string `json:"userMessage"`
}
type SkillDebugResumeRequest struct {
-1
View File
@@ -12,7 +12,6 @@ type AIAgentTeamResponse struct {
type AIAgentSkillResponse struct {
ID int64 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
}
+19 -20
View File
@@ -4,7 +4,6 @@ import "time"
type SkillDefinitionResponse struct {
ID int64 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
Instruction string `json:"instruction"`
@@ -20,24 +19,24 @@ type SkillDefinitionResponse struct {
}
type SkillDebugRunResponse struct {
SkillCode string `json:"skillCode"`
SkillName string `json:"skillName"`
ReplyText string `json:"replyText"`
PlanReason string `json:"planReason"`
SkillRouteTrace string `json:"skillRouteTrace"`
ToolWhitelist []string `json:"toolWhitelist"`
ExposedToolCodes []string `json:"exposedToolCodes"`
InvokedToolCodes []string `json:"invokedToolCodes"`
ToolSearchTrace string `json:"toolSearchTrace"`
GraphToolTrace string `json:"graphToolTrace"`
GraphToolCode string `json:"graphToolCode"`
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"`
SkillDefinitionID int64 `json:"skillDefinitionId"`
SkillName string `json:"skillName"`
ReplyText string `json:"replyText"`
PlanReason string `json:"planReason"`
SkillRouteTrace string `json:"skillRouteTrace"`
ToolWhitelist []string `json:"toolWhitelist"`
ExposedToolCodes []string `json:"exposedToolCodes"`
InvokedToolCodes []string `json:"invokedToolCodes"`
ToolSearchTrace string `json:"toolSearchTrace"`
GraphToolTrace string `json:"graphToolTrace"`
GraphToolCode string `json:"graphToolCode"`
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"`
}
type AgentRunLogResponse struct {
@@ -49,7 +48,7 @@ type AgentRunLogResponse struct {
AIConfigID int64 `json:"aiConfigId"`
UserMessage string `json:"userMessage"`
PlannedAction string `json:"plannedAction"`
PlannedSkillCode string `json:"plannedSkillCode"`
PlannedSkillID int64 `json:"plannedSkillId"`
PlannedSkillName string `json:"plannedSkillName"`
SkillRouteTrace string `json:"skillRouteTrace"`
ToolSearchTrace string `json:"toolSearchTrace"`
+3 -3
View File
@@ -54,8 +54,8 @@ error.e0053: "Skill not found."
error.e0054: "Skill not found or not enabled."
error.e0055: "Enter a Skill name."
error.e0056: "Skill is not enabled."
error.e0057: "Enter a Skill code."
error.e0058: "This Skill code is already in use."
error.e0057: "Skill is required."
error.e0058: "This Skill already exists."
error.e0059: "Web channel position must be left or right."
error.e0060: "Invalid web channel configuration."
error.e0061: "AI Agent ID is required."
@@ -68,7 +68,7 @@ error.e0067: "Invalid index status."
error.e0068: "openKfID is required."
error.e0069: "This openKfId is already used by another channel."
error.e0070: "Server code is required."
error.e0071: "Skill code is required."
error.e0071: "Skill definition ID is required."
error.e0072: "Ticket is required."
error.e0073: "The MCP server bound to this tool code does not exist or is not enabled."
error.e0074: "Tool code is required."
+3 -3
View File
@@ -54,8 +54,8 @@ error.e0053: "Skill 不存在"
error.e0054: "Skill 不存在或未启用"
error.e0055: "Skill 名称不能为空"
error.e0056: "Skill 未启用"
error.e0057: "Skill 编码不能为空"
error.e0058: "Skill 编码已存在"
error.e0057: "Skill 参数不能为空"
error.e0058: "Skill 已存在"
error.e0059: "Web渠道配置 position 只能为 left 或 right"
error.e0060: "Web渠道配置不合法"
error.e0061: "aiAgentId不能为空"
@@ -68,7 +68,7 @@ error.e0067: "indexStatus参数不合法"
error.e0068: "openKfID不能为空"
error.e0069: "openKfId 已被其他渠道使用"
error.e0070: "serverCode不能为空"
error.e0071: "skillCode不能为空"
error.e0071: "skillDefinitionId不能为空"
error.e0072: "ticket 不能为空"
error.e0073: "toolCode 绑定的 MCP 服务不存在或未启用"
error.e0074: "toolCode不能为空"