You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
714 B
39 lines
714 B
4 months ago
|
package handlers
|
||
|
|
||
|
import (
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"product/backend/handlers/file"
|
||
|
"product/backend/handlers/label"
|
||
|
"product/backend/handlers/labelValue"
|
||
|
"product/backend/handlers/mw"
|
||
|
"product/backend/handlers/priv"
|
||
|
"product/backend/handlers/role"
|
||
|
"product/backend/handlers/subject"
|
||
|
"product/backend/handlers/user"
|
||
|
"product/backend/handlers/util"
|
||
|
)
|
||
|
|
||
|
func Init() *gin.Engine {
|
||
|
r := gin.Default()
|
||
|
|
||
|
// common middleware
|
||
|
mw.Handler(r)
|
||
|
r.Use(user.AuthJWT, user.PrivCheck)
|
||
|
|
||
|
// Handler
|
||
|
file.Handler(r)
|
||
|
subject.Handler(r)
|
||
|
label.Handler(r)
|
||
|
labelValue.Handler(r)
|
||
|
role.Handler(r)
|
||
|
priv.Handler(r)
|
||
|
user.Handler(r)
|
||
|
|
||
|
// static
|
||
|
r.Static("/assets", "./data/file")
|
||
|
|
||
|
// utils
|
||
|
util.Handler(r)
|
||
|
return r
|
||
|
}
|