mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
refactor: rename GetSpiderListDir to GetSpiderFiles for clarity
- Updated route name and handler function to better reflect the purpose of retrieving files in a spider directory. - Renamed parameter struct from GetSpiderListDirParams to GetSpiderFilesParams to maintain consistency in naming conventions.
This commit is contained in:
@@ -299,9 +299,9 @@ func InitRoutes(app *gin.Engine) (err error) {
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/:id/files/list",
|
||||
Name: "Get Spider List Dir",
|
||||
Name: "Get Spider Files",
|
||||
Description: "Get a list of files in a spider directory",
|
||||
HandlerFunc: GetSpiderListDir,
|
||||
HandlerFunc: GetSpiderFiles,
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
|
||||
@@ -531,12 +531,12 @@ func DeleteSpiderList(_ *gin.Context, params *DeleteSpiderListParams) (response
|
||||
return GetDataResponse(models.Spider{})
|
||||
}
|
||||
|
||||
type GetSpiderListDirParams struct {
|
||||
type GetSpiderFilesParams struct {
|
||||
Id string `path:"id" description:"Spider ID" format:"objectid" pattern:"^[0-9a-fA-F]{24}$"`
|
||||
Path string `query:"path" description:"Directory path"`
|
||||
}
|
||||
|
||||
func GetSpiderListDir(c *gin.Context, params *GetSpiderListDirParams) (response *Response[[]interfaces.FsFileInfo], err error) {
|
||||
func GetSpiderFiles(c *gin.Context, params *GetSpiderFilesParams) (response *Response[[]interfaces.FsFileInfo], err error) {
|
||||
rootPath, err := getSpiderRootPathByContext(c)
|
||||
if err != nil {
|
||||
return GetErrorResponse[[]interfaces.FsFileInfo](err)
|
||||
|
||||
Reference in New Issue
Block a user