feat(*): 生图与视频工作台 - 新增独立生成流程并整合平台配置
This commit is contained in:
@@ -157,6 +157,19 @@ func (r *Repository) ResourceReferenceSnapshotExcludingAssets(userID string, exc
|
||||
}
|
||||
snapshot.Documents = append(snapshot.Documents, ResourceReferenceDocument{Kind: "工具", ID: strconv.FormatInt(tool.ID, 10), Title: tool.Label, PrimaryJSON: string(payload)})
|
||||
}
|
||||
var workbenchTools []model.WorkbenchTool
|
||||
if err := r.db.Where("(icon_resource_id IN ? OR cover_resource_id IN ?) AND enabled = ?", resourceIDs, resourceIDs, true).Find(&workbenchTools).Error; err != nil {
|
||||
return snapshot, err
|
||||
}
|
||||
for _, tool := range workbenchTools {
|
||||
if tool.IconResourceID != "" && slices.Contains(resourceIDs, tool.IconResourceID) {
|
||||
snapshot.Direct = append(snapshot.Direct, ResourceDirectReference{Kind: "工作台工具图标", ID: tool.ID, Title: tool.Name, ResourceID: tool.IconResourceID})
|
||||
}
|
||||
if tool.CoverResourceID != "" && slices.Contains(resourceIDs, tool.CoverResourceID) {
|
||||
snapshot.Direct = append(snapshot.Direct, ResourceDirectReference{Kind: "工作台工具封面", ID: tool.ID, Title: tool.Name, ResourceID: tool.CoverResourceID})
|
||||
}
|
||||
}
|
||||
|
||||
var assets []model.Asset
|
||||
assetQuery := r.db.Where("user_id = ?", userID)
|
||||
if len(excludingAssetIDs) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user