package routers

import (
	"spaceofcheng/services/controllers"
	"spaceofcheng/services/controllers/cases"
	"spaceofcheng/services/controllers/course"
	"spaceofcheng/services/controllers/customer"
	"spaceofcheng/services/controllers/goods"
	"spaceofcheng/services/controllers/message"
	"spaceofcheng/services/controllers/user"

	"github.com/astaxie/beego"
)

func getGuestRoutes() beego.LinkNamespace {
	prefix := beego.AppConfig.String("api::guest")

	return beego.NSNamespace(prefix,
		// cms
		beego.NSRouter("/cms/info", &message.MessageController{}, "get:GetCmsInfoByLocation"),
		beego.NSRouter("/cms/img", &message.MessageController{}, "get:GetImgByLocation"),
		beego.NSRouter("/cms/news", &message.MessageController{}, "get:GetNewsByLocation"),
		beego.NSRouter("/cms/case", &message.MessageController{}, "get:GetCmsCaseList"),
		beego.NSRouter("/cms/location", &message.MessageController{}, "get:GetLocations"),
		beego.NSRouter("/cms/course", &course.CourseController{}, "get:GetCourseByLocation"),

		// 案场
		beego.NSRouter("/case", &cases.CaseController{}, "get:GetOrgCases"),

		// 商品制作状态
		beego.NSRouter("/dict/order/makestatus", &goods.GoodsController{}, "get:GetMakeStatus"),

		// 商品
		beego.NSRouter("/goods", &goods.GoodsController{}, "get:GetListForWechat"),

		// 验证码 获取, 校验
		beego.NSRouter("/captcha", &controllers.BaseController{}, "get:SendCaptcha"),
		beego.NSRouter("/captcha", &controllers.BaseController{}, "post:ValidCaptcha"),

		// 微信 登录, 注册
		beego.NSRouter("/wxsignin", &customer.CustomerController{}, "post:SignIn"),
		beego.NSRouter("/wxsignup", &customer.CustomerController{}, "post:SignUp"),

		// 登录
		beego.NSRouter("/signin", &user.UserController{}, "post:SignIn"),
	)
}
