Updata:更新安全检测接口
This commit is contained in:
parent
6f8c473114
commit
e3a14c7857
@ -161,6 +161,7 @@ func NewRouter() *gin.Engine {
|
||||
resourceRoute.GET("/preview/:size/*path", file.Preview)
|
||||
resourceRoute.GET("/list", file.List)
|
||||
resourceRoute.GET("/usage", file.Usage)
|
||||
resourceRoute.POST("/security/scan", file.SecurityScan)
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@ -282,3 +282,17 @@ func getUserSpacePath(ctx *gin.Context) string {
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func SecurityScan(ctx *gin.Context) {
|
||||
var req files.SecurityScanReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
resp, err := service.FilesProvider.SecurityScan(ctx, &req)
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
service.Success(ctx, resp)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user