mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
- Removed the print flag from handleError function, simplifying error logging based on the development environment. - Introduced a new performRequest function for standardized HTTP requests with JSON bodies, enhancing code reusability. - Updated SendIMNotification and related functions to utilize the new RequestParam type for better clarity and consistency. - Normalized HTTP request paths in the createHttpRequest method to ensure correct URL formatting. - Added detailed error logging for JSON unmarshaling failures in syncFiles method. - Introduced a NewHttpClient function to create HTTP clients with customizable timeouts.
25 lines
581 B
Go
25 lines
581 B
Go
package entity
|
|
|
|
import "go.mongodb.org/mongo-driver/bson/primitive"
|
|
|
|
type Response struct {
|
|
Status string `json:"status"`
|
|
Message string `json:"message"`
|
|
Data interface{} `json:"data"`
|
|
Error string `json:"error"`
|
|
}
|
|
|
|
type ListResponse struct {
|
|
Status string `json:"status"`
|
|
Message string `json:"message"`
|
|
Total int `json:"total"`
|
|
Data interface{} `json:"data"`
|
|
Error string `json:"error"`
|
|
}
|
|
|
|
type BatchRequestPayload struct {
|
|
Ids []primitive.ObjectID `form:"ids" json:"ids"`
|
|
}
|
|
|
|
type RequestParam map[string]interface{}
|