mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-26 17:49:15 +01:00
refactor: standardize response types across controllers
- Updated multiple controller methods to return VoidResponse instead of generic Response[any]. - Consolidated error handling to utilize GetErrorVoidResponse for consistent error responses. - Enhanced parameter handling in export and file management functions for improved clarity and maintainability. - Refactored health check and login/logout methods to align with new response structure. - Improved overall consistency in response formatting across various endpoints.
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
package interfaces
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Export interface {
|
||||
GetId() string
|
||||
GetType() string
|
||||
GetTarget() string
|
||||
GetFilter() Filter
|
||||
GetQuery() bson.M
|
||||
GetStatus() string
|
||||
GetStartTs() time.Time
|
||||
GetEndTs() time.Time
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package interfaces
|
||||
|
||||
import "go.mongodb.org/mongo-driver/bson"
|
||||
|
||||
type ExportService interface {
|
||||
GenerateId() (exportId string, err error)
|
||||
Export(exportType, target string, filter Filter) (exportId string, err error)
|
||||
Export(exportType, target string, query bson.M) (exportId string, err error)
|
||||
GetExport(exportId string) (export Export, err error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user