feat: scaffold files service
This commit is contained in:
67
internal/model/model.go
Normal file
67
internal/model/model.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
NodeTypeFolder = "folder"
|
||||
NodeTypeFile = "file"
|
||||
NodeTypeGoogleSheet = "google_sheet"
|
||||
NodeTypeOfficeDocument = "office_document"
|
||||
|
||||
AccessView = "view"
|
||||
AccessEdit = "edit"
|
||||
)
|
||||
|
||||
type Node struct {
|
||||
ID string `json:"id"`
|
||||
ParentID *string `json:"parent_id,omitempty"`
|
||||
NodeType string `json:"node_type"`
|
||||
Title string `json:"title"`
|
||||
OwnerUserID string `json:"owner_user_id"`
|
||||
OwnerDepartmentID *string `json:"owner_department_id,omitempty"`
|
||||
CreatedBy string `json:"created_by"`
|
||||
UpdatedBy *string `json:"updated_by,omitempty"`
|
||||
StorageKey *string `json:"storage_key,omitempty"`
|
||||
OriginalFilename *string `json:"original_filename,omitempty"`
|
||||
MimeType *string `json:"mime_type,omitempty"`
|
||||
Extension *string `json:"extension,omitempty"`
|
||||
SizeBytes int64 `json:"size_bytes"`
|
||||
OfficeFormat *string `json:"office_format,omitempty"`
|
||||
ExternalURL *string `json:"external_url,omitempty"`
|
||||
Version int `json:"version"`
|
||||
EffectiveAccess string `json:"effective_access"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt *time.Time `json:"deleted_at,omitempty"`
|
||||
}
|
||||
|
||||
type Access struct {
|
||||
UserID string `json:"user_id"`
|
||||
AccessLevel string `json:"access_level"`
|
||||
GrantedBy string `json:"granted_by,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
}
|
||||
|
||||
type CreateFolderRequest struct {
|
||||
ParentID *string `json:"parent_id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
type UpdateNodeRequest struct {
|
||||
ParentID *string `json:"parent_id"`
|
||||
Title *string `json:"title"`
|
||||
}
|
||||
|
||||
type ReplaceAccessRequest struct {
|
||||
Access []Access `json:"access"`
|
||||
}
|
||||
|
||||
type PublicLinkRequest struct {
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
}
|
||||
|
||||
type PublicLinkResponse struct {
|
||||
ID string `json:"id"`
|
||||
URL string `json:"url"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user