mirror of
https://github.com/HChaZZY/alist.git
synced 2025-12-22 01:57:04 +08:00
➖ 去除缓存
This commit is contained in:
23
server/controllers/offie_preview.go
Normal file
23
server/controllers/offie_preview.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/Xhofe/alist/alidrive"
|
||||
"github.com/gin-gonic/gin"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// handle office_preview request
|
||||
func OfficePreview(c *gin.Context) {
|
||||
var req alidrive.OfficePreviewUrlReq
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
c.JSON(200, MetaResponse(400, "Bad Request"))
|
||||
return
|
||||
}
|
||||
log.Debugf("preview_req:%+v", req)
|
||||
preview, err := alidrive.GetOfficePreviewUrl(req.FileId)
|
||||
if err != nil {
|
||||
c.JSON(200, MetaResponse(500, err.Error()))
|
||||
return
|
||||
}
|
||||
c.JSON(200, DataResponse(preview))
|
||||
}
|
||||
Reference in New Issue
Block a user