@@ -9,17 +9,19 @@ import (
|
||||
|
||||
// ConversationResponse 对话响应
|
||||
type ConversationResponse struct {
|
||||
ID uint `json:"id"`
|
||||
CharacterID uint `json:"characterId"`
|
||||
Title string `json:"title"`
|
||||
PresetID *uint `json:"presetId"`
|
||||
AIProvider string `json:"aiProvider"`
|
||||
Model string `json:"model"`
|
||||
Settings map[string]interface{} `json:"settings,omitempty"`
|
||||
MessageCount int `json:"messageCount"`
|
||||
TokenCount int `json:"tokenCount"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
ID uint `json:"id"`
|
||||
CharacterID uint `json:"characterId"`
|
||||
Title string `json:"title"`
|
||||
PresetID *uint `json:"presetId"`
|
||||
WorldbookID *uint `json:"worldbookId"`
|
||||
WorldbookEnabled bool `json:"worldbookEnabled"`
|
||||
AIProvider string `json:"aiProvider"`
|
||||
Model string `json:"model"`
|
||||
Settings map[string]interface{} `json:"settings,omitempty"`
|
||||
MessageCount int `json:"messageCount"`
|
||||
TokenCount int `json:"tokenCount"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
|
||||
// 关联数据
|
||||
Character *CharacterResponse `json:"character,omitempty"`
|
||||
@@ -75,17 +77,19 @@ func ToConversationResponse(conv *app.Conversation) ConversationResponse {
|
||||
}
|
||||
|
||||
return ConversationResponse{
|
||||
ID: conv.ID,
|
||||
CharacterID: conv.CharacterID,
|
||||
Title: conv.Title,
|
||||
PresetID: conv.PresetID,
|
||||
AIProvider: conv.AIProvider,
|
||||
Model: conv.Model,
|
||||
Settings: settings,
|
||||
MessageCount: conv.MessageCount,
|
||||
TokenCount: conv.TokenCount,
|
||||
CreatedAt: conv.CreatedAt,
|
||||
UpdatedAt: conv.UpdatedAt,
|
||||
ID: conv.ID,
|
||||
CharacterID: conv.CharacterID,
|
||||
Title: conv.Title,
|
||||
PresetID: conv.PresetID,
|
||||
WorldbookID: conv.WorldbookID,
|
||||
WorldbookEnabled: conv.WorldbookEnabled,
|
||||
AIProvider: conv.AIProvider,
|
||||
Model: conv.Model,
|
||||
Settings: settings,
|
||||
MessageCount: conv.MessageCount,
|
||||
TokenCount: conv.TokenCount,
|
||||
CreatedAt: conv.CreatedAt,
|
||||
UpdatedAt: conv.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user