This commit is contained in:
2025-12-23 17:17:41 +08:00
parent 2618105140
commit 34e2c1bc41
5 changed files with 165 additions and 9 deletions

View File

@@ -108,7 +108,8 @@ func (r *GormUIComponentRepository) Update(ctx context.Context, component entiti
// Delete 删除UI组件
func (r *GormUIComponentRepository) Delete(ctx context.Context, id string) error {
if err := r.db.WithContext(ctx).Delete(&entities.UIComponent{}, id).Error; err != nil {
// 记录删除操作的详细信息
if err := r.db.WithContext(ctx).Where("id = ?", id).Delete(&entities.UIComponent{}).Error; err != nil {
return fmt.Errorf("删除UI组件失败: %w", err)
}
return nil