router.go 3.1 KB
package routers

import (
	"github.com/astaxie/beego"
	"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/port/beego/controllers"
)

func init() {
	adminRouter := beego.NewNamespace("/v1",
		beego.NSNamespace("/auth",
			beego.NSRouter("/login", &controllers.AdminLoginController{}, "POST:Login"),
			beego.NSRouter("/captcha-init", &controllers.AdminLoginController{}, "POST:CaptchaInit"),
			beego.NSRouter("/profile", &controllers.AdminLoginController{}, "POST:AdminpPofile"),
			beego.NSRouter("/pwd-update", &controllers.AdminLoginController{}, "POST:PwdUpdate"),
		),
		beego.NSNamespace("/admin",
			beego.NSRouter("/update", &controllers.AdminUserController{}, "POST:SaveAdminUser"),
			beego.NSRouter("/detail", &controllers.AdminUserController{}, "POST:GetAdminUser"),
			beego.NSRouter("/list", &controllers.AdminUserController{}, "POST:ListAdminUser"),
			beego.NSRouter("/forbidden", &controllers.AdminUserController{}, "POST:ForbiddenAdminUser"),
			beego.NSRouter("/permission", &controllers.AdminUserController{}, "POST:BeforeEditAdminUser"),
		),
		beego.NSNamespace("/partners",
			beego.NSRouter("/list", &controllers.PartnerInfoController{}, "POST:ListPartnerInfo"),
			beego.NSRouter("/add", &controllers.PartnerInfoController{}, "POST:CreatePartnerInfo"),
			beego.NSRouter("/edit", &controllers.PartnerInfoController{}, "POST:UpdatePartnerInfo"),
			beego.NSRouter("/detail", &controllers.PartnerInfoController{}, "POST:GetPartnerInfo"),
			beego.NSRouter("/set-status", &controllers.PartnerInfoController{}, "POST:PartnerInfoSetState"),
		),
		beego.NSNamespace("/dividends",
			beego.NSRouter("/edit", &controllers.DividendsController{}, "POST:Edit"),
			beego.NSRouter("/detail", &controllers.DividendsController{}, "POST:Detail"),
			beego.NSRouter("/list", &controllers.DividendsController{}, "POST:List"),
		),
		beego.NSNamespace("/order",
			// beego.NSRouter("/purpose/list", &controllers.OrderController{}, "POST:PageListOrderPurpose"),
			// beego.NSRouter("/purpose/update", &controllers.OrderController{}, "POST:UpdateOrderPurpose"),
			// beego.NSRouter("/purpose/detail", &controllers.OrderController{}, "POST:GetOrderPurpose"),
			// beego.NSRouter("/purpose/del", &controllers.OrderController{}, "POST:RemoveOrderPurpose"),
			beego.NSRouter("/purpose/list", &controllers.OrderInfoController{}, "POST:PageListOrderPurpose"),
			beego.NSRouter("/purpose/update", &controllers.OrderInfoController{}, "POST:UpdateOrderPurpose"),
			beego.NSRouter("/purpose/detail", &controllers.OrderInfoController{}, "POST:GetOrderPurpose"),
			beego.NSRouter("/purpose/del", &controllers.OrderInfoController{}, "POST:RemoveOrderPurpose"),

			beego.NSRouter("/purpose/convert", &controllers.OrderController{}, "POST:OrderPurposeToReal"),
			beego.NSRouter("/actual/list", &controllers.OrderController{}, "POST:PageListOrderReal"),
			beego.NSRouter("/actual/update", &controllers.OrderController{}, "POST:UpdateOrderReal"),
			beego.NSRouter("/actual/detail", &controllers.OrderController{}, "POST:GetOrderReal"),
		),

		beego.NSNamespace("/common",
			beego.NSRouter("/partner", &controllers.CommonController{}, "POST:GetPartnerList"),
		),
	)

	beego.AddNamespace(adminRouter)
}