mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
Feat: generate share URL
This commit is contained in:
17
routers/controllers/share.go
Normal file
17
routers/controllers/share.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/HFO4/cloudreve/service/share"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// CreateShare 创建分享
|
||||
func CreateShare(c *gin.Context) {
|
||||
var service share.ShareCreateService
|
||||
if err := c.ShouldBindJSON(&service); err == nil {
|
||||
res := service.Create(c)
|
||||
c.JSON(200, res)
|
||||
} else {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user