diff --git a/backend/src/internal/metadb/db.go b/backend/src/internal/db/metadb/db.go similarity index 69% rename from backend/src/internal/metadb/db.go rename to backend/src/internal/db/metadb/db.go index e783a6d6..da74524e 100644 --- a/backend/src/internal/metadb/db.go +++ b/backend/src/internal/db/metadb/db.go @@ -6,11 +6,19 @@ import ( "log" "os" + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" ) +type Pool interface { + Begin(context.Context) (pgx.Tx, error) + Exec(context.Context, string, ...any) (pgconn.CommandTag, error) + Query(context.Context, string, ...any) (pgx.Rows, error) +} + type MetadataDatabase struct { - Pool *pgxpool.Pool + Pool Pool } func New(ctx context.Context, envVar string) (*MetadataDatabase, error) { diff --git a/backend/src/usecase/files/data/metadata.go b/backend/src/usecase/files/data/metadata.go index 60e58a27..d85ace23 100644 --- a/backend/src/usecase/files/data/metadata.go +++ b/backend/src/usecase/files/data/metadata.go @@ -11,18 +11,18 @@ import ( // Metadata Model - need ContentCID string for IPFS type MetaData struct { - ID uuid.UUID - FileName string - Path string - Size uint64 - FileType string - ModifiedAt time.Time - UploadedAt time.Time - Owner uuid.UUID - AccessTo []uuid.UUID - Group []uuid.UUID - CheckSum []byte - Version time.Time + ID uuid.UUID `json:"uuid"` + FileName string `json:"file_name"` + Path string `json:"path"` + Size uint64 `json:"size"` + FileType string `json:"file_type"` + ModifiedAt time.Time `json:"modified_at"` + UploadedAt time.Time `json:"created_at"` + Owner uuid.UUID `json:"owner_id"` + AccessTo []uuid.UUID `json:"access_to"` + Group []uuid.UUID `json:"group_id"` + CheckSum []byte `json:"checksum"` + Version time.Time `json:"version"` } func (m *MetaData) ToResponse() MetaDataResponse { diff --git a/backend/tempfiles/react-1618799214.svg b/backend/tempfiles/react-1618799214.svg new file mode 100644 index 00000000..6c87de9b --- /dev/null +++ b/backend/tempfiles/react-1618799214.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index b3319331..d166fdf4 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,19 +1,70 @@ -
+ - + + + + + -