feat(*): 云端 Agent - 增强画布上下文读取并接入 Gemini 缓存

This commit is contained in:
ddcat666
2026-09-26 02:21:47 +08:00
parent 2ce50bbb9d
commit 2cedc4c66b
35 changed files with 1927 additions and 266 deletions

View File

@@ -0,0 +1,19 @@
package model
import "time"
// CloudAgentGeminiCache records an official Gemini CachedContent resource.
// The upstream credential is never stored; CredentialHash is only an identity
// component used to prevent reusing a cache across different credentials.
type CloudAgentGeminiCache struct {
ID string `gorm:"primaryKey;size:80"`
UserID string `gorm:"index;uniqueIndex:idx_cloud_agent_gemini_cache_user_key;size:36;not null"`
CacheKey string `gorm:"uniqueIndex:idx_cloud_agent_gemini_cache_user_key;size:64;not null"`
BaseURL string `gorm:"size:500;not null"`
Model string `gorm:"size:200;not null"`
CredentialHash string `gorm:"size:64;not null"`
ResourceName string `gorm:"size:300;not null"`
ExpireTime time.Time `gorm:"index;not null"`
CreatedAt time.Time
UpdatedAt time.Time
}