perf:改变写入逻辑

This commit is contained in:
Amnesia
2026-03-13 16:15:44 +08:00
parent 0ef79f54cb
commit be48ffced5
2 changed files with 31 additions and 4 deletions

View File

@@ -22,6 +22,13 @@ func (vr *VideoRepository) CreateVideo(ctx context.Context, video *Video) error
return nil
}
func (vr *VideoRepository) CreateMsg(ctx context.Context, Msg *OutboxMsg) error {
if err := vr.db.WithContext(ctx).Create(Msg).Error; err != nil {
return err
}
return nil
}
func (vr *VideoRepository) DeleteVideo(ctx context.Context, id uint) error {
if err := vr.db.WithContext(ctx).Delete(&Video{}, id).Error; err != nil {
return err