作者 tangxvhui

调整更新调用

... ... @@ -44,7 +44,7 @@ func (repository *ArticleAndTagRepository) Update(ctx context.Context, conn tran
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -42,7 +42,7 @@ func (repository *ArticleBackupRepository) Update(ctx context.Context, conn tran
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -46,7 +46,7 @@ func (repository *ArticleCommentRepository) Update(ctx context.Context, conn tra
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -42,7 +42,7 @@ func (repository *ArticleDraftRepository) Update(ctx context.Context, conn trans
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -66,7 +66,7 @@ func (repository *ArticleTagRepository) Update(ctx context.Context, conn transac
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -44,7 +44,7 @@ func (repository *CompanyRepository) Update(ctx context.Context, conn transactio
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *DepartmentRepository) Update(ctx context.Context, conn transac
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *DiscussionAcceptRepository) Update(ctx context.Context, conn t
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *DiscussionOpinionRepository) Update(ctx context.Context, conn
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *DiscussionRepository) Update(ctx context.Context, conn transac
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *MessageBusinessRepository) Update(ctx context.Context, conn tr
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *MessageSystemRepository) Update(ctx context.Context, conn tran
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *RoleRepository) Update(ctx context.Context, conn transaction.C
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *UserFollowRepository) Update(ctx context.Context, conn transac
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -42,7 +42,7 @@ func (repository *UserLoveFlagRepository) Update(ctx context.Context, conn trans
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *UserReadArticleRepository) Update(ctx context.Context, conn tr
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -44,7 +44,7 @@ func (repository *UserRepository) Update(ctx context.Context, conn transaction.C
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...
... ... @@ -43,7 +43,7 @@ func (repository *UserRoleRepository) Update(ctx context.Context, conn transacti
return nil, err
}
queryFunc := func() (interface{}, error) {
tx = tx.Model(m).Save(m)
tx = tx.Model(m).Select("*").Updates(m)
return nil, tx.Error
}
if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
... ...