feat(model,service): add folder_path and user_id to FileResponse, add user_id filter to ListFiles
- FileResponse gains folder_path ("/" for root) and user_id fields
- folder_id no longer uses omitempty, root files return null
- ListFiles accepts optional userID parameter for filtering by owner
- New buildFileResponse helper populates folder_path from FolderStore
- New GetFileResponse method wraps GetFileMetadata + buildFileResponse
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -130,14 +130,16 @@ type UploadSessionResponse struct {
|
||||
|
||||
// FileResponse is the DTO for a file in API responses.
|
||||
type FileResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
FolderID *int64 `json:"folder_id,omitempty"`
|
||||
Size int64 `json:"size"`
|
||||
MimeType string `json:"mime_type"`
|
||||
SHA256 string `json:"sha256"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
FolderID *int64 `json:"folder_id"`
|
||||
FolderPath *string `json:"folder_path"`
|
||||
UserID *int64 `json:"user_id"`
|
||||
Size int64 `json:"size"`
|
||||
MimeType string `json:"mime_type"`
|
||||
SHA256 string `json:"sha256"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// FolderResponse is the DTO for a folder in API responses.
|
||||
|
||||
Reference in New Issue
Block a user