file.go 472 B

1234567891011121314151617181920
  1. package router
  2. import (
  3. "github.com/gin-gonic/gin"
  4. jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
  5. "go-admin/app/other/apis"
  6. )
  7. func init() {
  8. routerCheckRole = append(routerCheckRole, registerFileRouter)
  9. }
  10. // 需认证的路由代码
  11. func registerFileRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  12. var api = apis.File{}
  13. r := v1.Group("").Use(authMiddleware.MiddlewareFunc())
  14. {
  15. r.POST("/public/uploadFile", api.UploadFile)
  16. }
  17. }