正在显示
18 个修改的文件
包含
18 行增加
和
18 行删除
@@ -44,7 +44,7 @@ func (repository *ArticleAndTagRepository) Update(ctx context.Context, conn tran | @@ -44,7 +44,7 @@ func (repository *ArticleAndTagRepository) Update(ctx context.Context, conn tran | ||
44 | return nil, err | 44 | return nil, err |
45 | } | 45 | } |
46 | queryFunc := func() (interface{}, error) { | 46 | queryFunc := func() (interface{}, error) { |
47 | - tx = tx.Model(m).Save(m) | 47 | + tx = tx.Model(m).Select("*").Updates(m) |
48 | return nil, tx.Error | 48 | return nil, tx.Error |
49 | } | 49 | } |
50 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 50 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -42,7 +42,7 @@ func (repository *ArticleBackupRepository) Update(ctx context.Context, conn tran | @@ -42,7 +42,7 @@ func (repository *ArticleBackupRepository) Update(ctx context.Context, conn tran | ||
42 | return nil, err | 42 | return nil, err |
43 | } | 43 | } |
44 | queryFunc := func() (interface{}, error) { | 44 | queryFunc := func() (interface{}, error) { |
45 | - tx = tx.Model(m).Save(m) | 45 | + tx = tx.Model(m).Select("*").Updates(m) |
46 | return nil, tx.Error | 46 | return nil, tx.Error |
47 | } | 47 | } |
48 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 48 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -46,7 +46,7 @@ func (repository *ArticleCommentRepository) Update(ctx context.Context, conn tra | @@ -46,7 +46,7 @@ func (repository *ArticleCommentRepository) Update(ctx context.Context, conn tra | ||
46 | return nil, err | 46 | return nil, err |
47 | } | 47 | } |
48 | queryFunc := func() (interface{}, error) { | 48 | queryFunc := func() (interface{}, error) { |
49 | - tx = tx.Model(m).Save(m) | 49 | + tx = tx.Model(m).Select("*").Updates(m) |
50 | return nil, tx.Error | 50 | return nil, tx.Error |
51 | } | 51 | } |
52 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 52 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -42,7 +42,7 @@ func (repository *ArticleDraftRepository) Update(ctx context.Context, conn trans | @@ -42,7 +42,7 @@ func (repository *ArticleDraftRepository) Update(ctx context.Context, conn trans | ||
42 | return nil, err | 42 | return nil, err |
43 | } | 43 | } |
44 | queryFunc := func() (interface{}, error) { | 44 | queryFunc := func() (interface{}, error) { |
45 | - tx = tx.Model(m).Save(m) | 45 | + tx = tx.Model(m).Select("*").Updates(m) |
46 | return nil, tx.Error | 46 | return nil, tx.Error |
47 | } | 47 | } |
48 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 48 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -66,7 +66,7 @@ func (repository *ArticleTagRepository) Update(ctx context.Context, conn transac | @@ -66,7 +66,7 @@ func (repository *ArticleTagRepository) Update(ctx context.Context, conn transac | ||
66 | return nil, err | 66 | return nil, err |
67 | } | 67 | } |
68 | queryFunc := func() (interface{}, error) { | 68 | queryFunc := func() (interface{}, error) { |
69 | - tx = tx.Model(m).Save(m) | 69 | + tx = tx.Model(m).Select("*").Updates(m) |
70 | return nil, tx.Error | 70 | return nil, tx.Error |
71 | } | 71 | } |
72 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 72 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -44,7 +44,7 @@ func (repository *CompanyRepository) Update(ctx context.Context, conn transactio | @@ -44,7 +44,7 @@ func (repository *CompanyRepository) Update(ctx context.Context, conn transactio | ||
44 | return nil, err | 44 | return nil, err |
45 | } | 45 | } |
46 | queryFunc := func() (interface{}, error) { | 46 | queryFunc := func() (interface{}, error) { |
47 | - tx = tx.Model(m).Save(m) | 47 | + tx = tx.Model(m).Select("*").Updates(m) |
48 | return nil, tx.Error | 48 | return nil, tx.Error |
49 | } | 49 | } |
50 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 50 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *DepartmentRepository) Update(ctx context.Context, conn transac | @@ -43,7 +43,7 @@ func (repository *DepartmentRepository) Update(ctx context.Context, conn transac | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *DiscussionAcceptRepository) Update(ctx context.Context, conn t | @@ -43,7 +43,7 @@ func (repository *DiscussionAcceptRepository) Update(ctx context.Context, conn t | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *DiscussionOpinionRepository) Update(ctx context.Context, conn | @@ -43,7 +43,7 @@ func (repository *DiscussionOpinionRepository) Update(ctx context.Context, conn | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *DiscussionRepository) Update(ctx context.Context, conn transac | @@ -43,7 +43,7 @@ func (repository *DiscussionRepository) Update(ctx context.Context, conn transac | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *MessageBusinessRepository) Update(ctx context.Context, conn tr | @@ -43,7 +43,7 @@ func (repository *MessageBusinessRepository) Update(ctx context.Context, conn tr | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *MessageSystemRepository) Update(ctx context.Context, conn tran | @@ -43,7 +43,7 @@ func (repository *MessageSystemRepository) Update(ctx context.Context, conn tran | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *RoleRepository) Update(ctx context.Context, conn transaction.C | @@ -43,7 +43,7 @@ func (repository *RoleRepository) Update(ctx context.Context, conn transaction.C | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *UserFollowRepository) Update(ctx context.Context, conn transac | @@ -43,7 +43,7 @@ func (repository *UserFollowRepository) Update(ctx context.Context, conn transac | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -42,7 +42,7 @@ func (repository *UserLoveFlagRepository) Update(ctx context.Context, conn trans | @@ -42,7 +42,7 @@ func (repository *UserLoveFlagRepository) Update(ctx context.Context, conn trans | ||
42 | return nil, err | 42 | return nil, err |
43 | } | 43 | } |
44 | queryFunc := func() (interface{}, error) { | 44 | queryFunc := func() (interface{}, error) { |
45 | - tx = tx.Model(m).Save(m) | 45 | + tx = tx.Model(m).Select("*").Updates(m) |
46 | return nil, tx.Error | 46 | return nil, tx.Error |
47 | } | 47 | } |
48 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 48 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *UserReadArticleRepository) Update(ctx context.Context, conn tr | @@ -43,7 +43,7 @@ func (repository *UserReadArticleRepository) Update(ctx context.Context, conn tr | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -44,7 +44,7 @@ func (repository *UserRepository) Update(ctx context.Context, conn transaction.C | @@ -44,7 +44,7 @@ func (repository *UserRepository) Update(ctx context.Context, conn transaction.C | ||
44 | return nil, err | 44 | return nil, err |
45 | } | 45 | } |
46 | queryFunc := func() (interface{}, error) { | 46 | queryFunc := func() (interface{}, error) { |
47 | - tx = tx.Model(m).Save(m) | 47 | + tx = tx.Model(m).Select("*").Updates(m) |
48 | return nil, tx.Error | 48 | return nil, tx.Error |
49 | } | 49 | } |
50 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 50 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
@@ -43,7 +43,7 @@ func (repository *UserRoleRepository) Update(ctx context.Context, conn transacti | @@ -43,7 +43,7 @@ func (repository *UserRoleRepository) Update(ctx context.Context, conn transacti | ||
43 | return nil, err | 43 | return nil, err |
44 | } | 44 | } |
45 | queryFunc := func() (interface{}, error) { | 45 | queryFunc := func() (interface{}, error) { |
46 | - tx = tx.Model(m).Save(m) | 46 | + tx = tx.Model(m).Select("*").Updates(m) |
47 | return nil, tx.Error | 47 | return nil, tx.Error |
48 | } | 48 | } |
49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 49 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
-
请 注册 或 登录 后发表评论