Files
ai-agent/internal/pkg/dto/response/channel_response.go
T

46 lines
1.7 KiB
Go
Raw Normal View History

2026-04-09 10:01:23 +08:00
package response
import (
"agent-desk/internal/models"
"agent-desk/internal/pkg/enums"
2026-04-09 10:01:23 +08:00
)
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"`
2026-04-09 10:01:23 +08:00
}
type WxWorkKFAccountResponse struct {
OpenKfID string `json:"openKfId"`
Name string `json:"name"`
Avatar string `json:"avatar"`
ManagePrivilege bool `json:"managePrivilege"`
}
2026-04-09 10:01:23 +08:00
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,
2026-04-09 10:01:23 +08:00
}
}