feat(*): 分镜与资产 - 完善五类资产、候选去重、搜索、中文镜头编号与分类整理
This commit is contained in:
1 parent
ce6e20f749
commit
f548681787
53 files changed
+816
-188
No files matched your search
@@ -2041,6 +2041,11 @@ func (r *Repository) CreateProjectAssetCandidates(candidates []model.ProjectAsse
|
||||
return r.db.Create(&candidates).Error
|
||||
}
|
||||
|
||||
func (r *Repository) CreateProjectAssetCandidate(candidate *model.ProjectAssetCandidate) (bool, error) {
|
||||
result := r.db.Clauses(clause.OnConflict{DoNothing: true}).Create(candidate)
|
||||
return result.RowsAffected == 1, result.Error
|
||||
}
|
||||
|
||||
// ConfirmProjectAssetCandidate 将正式资产身份、首版本、项目引用和候选状态放在同一事务中,避免出现半确认数据。
|
||||
func (r *Repository) ConfirmProjectAssetCandidate(candidate *model.ProjectAssetCandidate, asset *model.Asset, version *model.AssetVersion, link *model.ProjectAssetLink, createAsset bool) error {
|
||||
return r.db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
Reference in new issue
Block a user