feat(chat): add batch management for conversations

This commit is contained in:
AndyYang
2026-02-25 11:37:36 +08:00
committed by lyingbug
parent b536e86cd0
commit 172bf797ee
13 changed files with 610 additions and 1 deletions
@@ -87,3 +87,11 @@ func (r *sessionRepository) Update(ctx context.Context, session *types.Session)
func (r *sessionRepository) Delete(ctx context.Context, tenantID uint64, id string) error {
return r.db.WithContext(ctx).Where("tenant_id = ?", tenantID).Delete(&types.Session{}, "id = ?", id).Error
}
// BatchDelete deletes multiple sessions by IDs
func (r *sessionRepository) BatchDelete(ctx context.Context, tenantID uint64, ids []string) error {
if len(ids) == 0 {
return nil
}
return r.db.WithContext(ctx).Where("tenant_id = ? AND id IN ?", tenantID, ids).Delete(&types.Session{}).Error
}