mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-25 03:29:13 +08:00
23 lines
611 B
Go
23 lines
611 B
Go
|
package v1
|
||
|
|
||
|
import (
|
||
|
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
|
||
|
"github.com/1Panel-dev/1Panel/app/dto"
|
||
|
"github.com/1Panel-dev/1Panel/constant"
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
func (b *BaseApi) ListFiles(c *gin.Context) {
|
||
|
var req dto.FileOption
|
||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||
|
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
|
||
|
return
|
||
|
}
|
||
|
files, err := fileService.GetFileList(req)
|
||
|
if err != nil {
|
||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||
|
return
|
||
|
}
|
||
|
helper.SuccessWithData(c, files)
|
||
|
}
|