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:
Marvin Zhang
2025-04-14 23:25:26 +08:00
parent 67b51fdc83
commit f167ff7600
2 changed files with 4 additions and 4 deletions

View File

@@ -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,

View File

@@ -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)