22 lines
420 B
Go
22 lines
420 B
Go
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)
|
|
}
|
|
}
|