router.go 4.3 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("/profile", &controllers.AdminLoginController{}, "POST:AdminpPofile"),
		),
		beego.NSNamespace("/admin",
			beego.NSRouter("/update", &controllers.UserController{}, "POST:EditUserPermission"),
			beego.NSRouter("/detail", &controllers.UserController{}, "POST:GetUserData"),
			beego.NSRouter("/list", &controllers.UserController{}, "POST:ListUser"),
			beego.NSRouter("/permission", &controllers.UserController{}, "POST:BeforeEditUser"),
		),
		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("/batchDisabled", &controllers.PartnerInfoController{}, "POST:PartnerInfoSetState"),
			beego.NSRouter("/remove", &controllers.PartnerInfoController{}, "POST:RemovePartnerInfo"),
		),
		beego.NSNamespace("/dividends",
			beego.NSRouter("/list", &controllers.OrderDividendController{}, "POST:PageListOrderDividend"),
			beego.NSRouter("/modify", &controllers.OrderDividendController{}, "POST:EditOrderDividend"),
			beego.NSRouter("/detail", &controllers.OrderDividendController{}, "POST:OrderDividendDetail"),
			beego.NSRouter("/payDividends", &controllers.OrderDividendController{}, "POST:PayOrderGoodBonus"),
			beego.NSRouter("/payDividends/batch", &controllers.OrderDividendController{}, "POST:BatchPayOrderGoodBonus"),
			beego.NSRouter("/remarks", &controllers.OrderDividendController{}, "POST:EditOrderRemarkBonus"),
			beego.NSRouter("/list/excel", &controllers.OrderDividendController{}, "POST:ListOrderBonusForExcel"),
		),
		beego.NSNamespace("/order",
			beego.NSRouter("/actual/list", &controllers.OrderInfoController{}, "POST:PageListOrderReal"),       // 返归订单列表
			beego.NSRouter("/actual/list/excel", &controllers.OrderInfoController{}, "POST:ListOrderForExcel"), // 导出订单记录
			beego.NSRouter("/actual/detail", &controllers.OrderInfoController{}, "POST:GetOrderReal"),          // 查看实际订单详情
			beego.NSRouter("/actual/del", &controllers.OrderInfoController{}, "POST:RemoveOrderReal"),          // 删除实际订单
			beego.NSRouter("/actual/update", &controllers.OrderInfoController{}, "POST:UpdateOrderReal"),       // 新增实际订单
			beego.NSRouter("/actual/close", &controllers.OrderInfoController{}, "POST:OrderDisable"),
			beego.NSRouter("/fileImportTemplate", &controllers.OrderInfoController{}, "POST:DownloadTemplate"),                   // 下载导入模板
			beego.NSRouter("/fileImport", &controllers.OrderInfoController{}, "POST:ImportOrderFromExcel"),                       // 导入订单数据
			beego.NSRouter("/actual/listColumn", &controllers.ColumnSettingController{}, "POST:GetColumnSetting"),                // 返回栏目设置列表
			beego.NSRouter("/actual/updateColumn", &controllers.ColumnSettingController{}, "POST:UpdateColumnSetting"),           // 更新栏目设置
			beego.NSRouter("/actual/resetColumn", &controllers.ColumnSettingController{}, "POST:ResetColumn"),                    // 重置栏目设置
			beego.NSRouter("/actual/createColumn", &controllers.ColumnSettingController{}, "POST:CreateColumnSetting"),           // 创建栏目设置,测试用
			beego.NSRouter("/actual/listDefaultColumn", &controllers.ColumnSettingController{}, "POST:ListDefaultColumnSetting"), // 返回默认栏目设置
		),
		beego.NSNamespace("/common",
			beego.NSRouter("/partner", &controllers.CommonController{}, "POST:GetPartnerList"),
			beego.NSRouter("/partnerType", &controllers.CommonController{}, "POST:GetPartnerCategory"),
			beego.NSRouter("/orderType", &controllers.CommonController{}, "POST:GetOrderType"),
		),
		beego.NSNamespace("/enterprises",
			beego.NSRouter("/setPhone", &controllers.CompanyController{}, "POST:SetPhone"),
		),
	)

	beego.AddNamespace(adminRouter)
}