haixunMaster/haixun-backend/internal/model/persona/domain/repository/repository.go

17 lines
631 B
Go

package repository
import (
"context"
"haixun-backend/internal/model/persona/domain/entity"
)
type Repository interface {
EnsureIndexes(ctx context.Context) error
Create(ctx context.Context, persona *entity.Persona) (*entity.Persona, error)
FindByID(ctx context.Context, tenantID, ownerUID, personaID string) (*entity.Persona, error)
ListByOwner(ctx context.Context, tenantID, ownerUID string) ([]*entity.Persona, error)
Update(ctx context.Context, tenantID, ownerUID, personaID string, patch map[string]interface{}) (*entity.Persona, error)
SoftDelete(ctx context.Context, tenantID, ownerUID, personaID string) error
}