refactor: extract models/routes and env-based server config
- Move API request/response structs into new lib/models package - Centralize Gin route registration in lib/routing to simplify wiring - Add lib/server config helper to allow WARPBOX_BOX_POLL_INTERVAL_MS override - Improves modularity and makes polling behavior configurable per environmentrefactor: extract models/routes and env-based server config - Move API request/response structs into new lib/models package - Centralize Gin route registration in lib/routing to simplify wiring - Add lib/server config helper to allow WARPBOX_BOX_POLL_INTERVAL_MS override - Improves modularity and makes polling behavior configurable per environment
This commit is contained in:
33
lib/models/models.go
Normal file
33
lib/models/models.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package models
|
||||
|
||||
type BoxFile struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Size int64 `json:"size"`
|
||||
SizeLabel string `json:"size_label"`
|
||||
MimeType string `json:"mime_type"`
|
||||
Status string `json:"status"`
|
||||
StatusLabel string `json:"status_label"`
|
||||
Title string `json:"title"`
|
||||
IconPath string `json:"icon_path"`
|
||||
DownloadPath string `json:"download_path"`
|
||||
UploadPath string `json:"upload_path"`
|
||||
IsComplete bool `json:"is_complete"`
|
||||
}
|
||||
|
||||
type BoxManifest struct {
|
||||
Files []BoxFile `json:"files"`
|
||||
}
|
||||
|
||||
type CreateBoxRequest struct {
|
||||
Files []CreateBoxFileRequest `json:"files"`
|
||||
}
|
||||
|
||||
type CreateBoxFileRequest struct {
|
||||
Name string `json:"name"`
|
||||
Size int64 `json:"size"`
|
||||
}
|
||||
|
||||
type UpdateFileStatusRequest struct {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
Reference in New Issue
Block a user