JM-WechatMini/router/app/user.go
2024-04-26 13:23:20 +08:00

32 lines
957 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)
userRouter.GET("todo/today", todoApi.GetTodayTodos)
userRouter.POST("msg", baseApi.SendMedicineRemind)
}
}