leveldb-demo/gin/router.go

22 lines
420 B
Go
Raw Normal View History

2022-04-01 08:58:03 +00:00
package gin
import (
"fmt"
"github.com/gin-gonic/gin"
"myschools.me/suguo/leveldb-demo/handler"
)
//路由配置
func routerSetup(router *gin.Engine, rootpath *string) {
router.Use(gin.Recovery())
r := router.Group(fmt.Sprintf("/%s", *rootpath))
{
r.POST(`/upload`, handler.FileUpload)
r.POST(`/update`, handler.FileUpdate)
r.POST(`/delete`, handler.FileDelete)
r.GET(`/get/:id`, handler.FileGet)
}
}