package router

import (
	"gin-vue-admin/api/mobile"
	v1 "gin-vue-admin/api/v1"
	"gin-vue-admin/middleware"
	"github.com/gin-gonic/gin"
)

func InitMobileUserLoginRouter(Router *gin.RouterGroup) {
	UserRouter := Router.Group("mobile")
	{
		UserRouter.POST("login", mobile.Login)
		UserRouter.POST("register", mobile.Register) // 用户注册账号
		UserRouter.POST("getOpenid", mobile.GetOpenid)
		UserRouter.POST("sendCode", mobile.SendCode)
		UserRouter.POST("checkCode", mobile.CheckCode)
		UserRouter.POST("msgData", mobile.MsgData)
		UserRouter.POST("getIdByCode", mobile.GetIdByCode)
		UserRouter.POST("setCode", mobile.SetCode)
	}
}
func InitMobileUserPublicRouter(Router *gin.RouterGroup) {
	UserRouter := Router.Group("mobile").Use(middleware.OperationRecord())
	{
		UserRouter.POST("getRegoinList", mobile.GetRegoinList)
		UserRouter.POST("updateUser", mobile.UpdateUser)
		UserRouter.POST("upload", v1.UploadFile)
		UserRouter.POST("uploadImage", v1.UploadFileImage)
		UserRouter.POST("aiUpload", v1.AiUploadFile)
		UserRouter.POST("aiImageUpload", v1.AiImageUploadFile)
		UserRouter.POST("getTokenForLines", mobile.GetTokenForLines)           // 二维码获取
		UserRouter.POST("delTokenForLines", mobile.DelTokenForLines)           // 二维码获取
		UserRouter.POST("getUnlimited", mobile.GetUnlimited)                   // 二维码获取
		UserRouter.POST("getUnlimitedForSurvey", mobile.GetUnlimitedForSurvey) // 二维码获取
		UserRouter.POST("getUnlimitedForReport", mobile.GetUnlimitedForReport) // 二维码获取
		UserRouter.POST("getUnlimitedForOther", mobile.GetUnlimitedForOther)   // 二维码获取
	}
}

func InitMobileUserPrivateRouter(Router *gin.RouterGroup) {
	UserRouter := Router.Group("mobile").Use(middleware.OperationRecord())
	{
		UserRouter.POST("createUserAuthe", mobile.CreateUserAuthe)
		UserRouter.POST("userAutheInfo", mobile.UserAutheInfo)
		UserRouter.POST("setUserBind", mobile.SetUserBind)
	}
}

func InitAdminUserPrivateRouter(Router *gin.RouterGroup) {
	UserRouter := Router.Group("adminUser").Use(middleware.OperationRecord())
	{
		UserRouter.POST("getMobileUserList", v1.GetMobileUserList)
		UserRouter.POST("getMobileUserInfo", v1.GetMobileUserInfo)
	}
}

func InitAdminUserPublicRouter(Router *gin.RouterGroup) {
	UserRouter := Router.Group("adminUser").Use(middleware.OperationRecord())
	{
		UserRouter.GET("exportMobileUser", v1.ExportMobileUser)
	}
}
