update
This commit is contained in:
@@ -3,6 +3,7 @@ package miniapp
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"log/slog"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
@@ -41,8 +42,10 @@ func (r *Repository) Update(ctx context.Context, id uint64, cols map[string]inte
|
|||||||
return errors.Wrap(50000, "update mini program", res.Error)
|
return errors.Wrap(50000, "update mini program", res.Error)
|
||||||
}
|
}
|
||||||
if res.RowsAffected == 0 {
|
if res.RowsAffected == 0 {
|
||||||
|
slog.Warn("update mini program affected 0 rows", slog.Uint64("id", id), slog.Any("cols", cols))
|
||||||
return errors.ErrNotFound
|
return errors.ErrNotFound
|
||||||
}
|
}
|
||||||
|
slog.Info("update mini program", slog.Uint64("id", id), slog.Int64("rows_affected", res.RowsAffected), slog.Any("cols", cols))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user