refactor(backend): switch to DDD
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
type FileRepository interface {
|
||||
GetAccess(ctx context.Context, user_id int, file_id string) (canView, canEdit bool, domainErr *DomainError)
|
||||
GetSlice(ctx context.Context, user_id int, filter, sort string, limit, offset int) (files Slice[FileItem], domainErr *DomainError)
|
||||
Get(ctx context.Context, user_id int, file_id string) (file FileFull, domainErr *DomainError)
|
||||
Add(ctx context.Context, user_id int, name, mime string, datetime time.Time, notes string, metadata json.RawMessage) (file FileCore, domainErr *DomainError)
|
||||
Update(ctx context.Context, user_id int, file_id string, updates map[string]interface{}) (domainErr *DomainError)
|
||||
Delete(ctx context.Context, user_id int, file_id string) (domainErr *DomainError)
|
||||
}
|
||||
Reference in New Issue
Block a user