JM-WechatMini/router/app/user.go
2023-11-02 04:34:46 +08:00

31 lines
851 B
Go

package app
import (
"github.com/gin-gonic/gin"
v1 "miniapp/api/v1"
"miniapp/middleware"
)
type UserRouter struct {
}
func (s *LoginRouter) InitUserRouter(Router *gin.RouterGroup) {
userRouter := Router.Group("user").Use(middleware.AuthorizeToken())
//publicRouter := Router.Group("user")
baseApi := v1.ApiGroupApp.AppApiGroup.UserApi
filrApi := v1.ApiGroupApp.ExampleApiGroup.FileUploadAndDownloadApi
todoApi := v1.ApiGroupApp.AppApiGroup.TodosApi
{
userRouter.POST("upload", filrApi.UploadFile)
userRouter.POST("binding/wechat", baseApi.BindingWeChat)
userRouter.PUT("info", baseApi.UpdateUser)
userRouter.GET("info", baseApi.GetInfo)
userRouter.PUT("hospital", baseApi.UpdateUserHospital)
userRouter.GET("", baseApi.GetUser)
userRouter.GET("todo", todoApi.GetUserTodos)
userRouter.PUT("todo", todoApi.UpdateTodo)
}
}