Explorar o código

增加取消退款

kobe6258 hai 4 meses
pai
achega
89a25d6ef8
Modificáronse 7 ficheiros con 543 adicións e 0 borrados
  1. 322 0
      controllers/order.go
  2. 2 0
      models/db.go
  3. 103 0
      models/product_order.go
  4. 16 0
      models/response/order.go
  5. 77 0
      models/trade_order.go
  6. 18 0
      routers/commentsRouter.go
  7. 5 0
      routers/router.go

+ 322 - 0
controllers/order.go

@@ -0,0 +1,322 @@
+package controllers
+
+import (
+	"eta/eta_mini_crm_ht/models"
+	"eta/eta_mini_crm_ht/models/response"
+	"eta/eta_mini_crm_ht/utils"
+	"fmt"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"sync"
+	"time"
+)
+
+var (
+	ProductOrderStatus = map[models.OrderStatus]string{
+		"pending":    "待支付",
+		"processing": "支付中",
+		"paid":       "已支付",
+		"closed":     "已关闭",
+		"refund":     "已退款",
+	}
+
+	TradeOrderStatus = map[models.PaymentStatus]string{
+		"pending": "待支付",
+		"failed":  "支付失败",
+		"done":    "支付成功",
+	}
+
+	RefundOrderStatus = map[models.PaymentStatus]string{
+		"pending": "退款中",
+		"failed":  "退款失败",
+		"done":    "退款成功",
+	}
+	RefundStatusMap = map[models.RefundStatus]string{
+		"pending":    "待退款",
+		"processing": "退款中",
+		"failed":     "退款失败",
+		"success":    "退款成功",
+		"canceled":   "已取消",
+	}
+	ProductTypeMap = map[models.MerchantProductType]string{
+		"report":  "报告",
+		"video":   "视频",
+		"audio":   "音频",
+		"package": "套餐",
+	}
+	PaymentWayMap = map[models.PaymentWay]string{
+		"wechat": "微信",
+		"alipay": "支付宝",
+	}
+)
+
+type OrderController struct {
+	BaseAuthController
+}
+
+// ProductOrderList
+// @Title 商品订单列表
+// @Description 商品订单列表
+// @Param   PageSize   query   int  true       "每页数据条数"
+// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Param   ClassifyIds   query   string  true       "二级分类id,可多选用英文,隔开"
+// @Param   KeyWord   query   string  true       "报告标题/创建人"
+// @Param   SortType   query   string  true       "排序方式"
+// @Success 200 {object} models.ReportAuthorResp
+// @router /productOrderList [get]
+func (this *OrderController) ProductOrderList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+	sortType := this.GetString("SortType")
+	KeyWord := this.GetString("KeyWord")
+
+	PaymentDate := this.GetString("PaymentDate")
+	PaymentWay := this.GetString("PaymentWay")
+	CreatedDate := this.GetString("CreatedDate")
+	ProductType := this.GetString("ProductType")
+	RefundStatus := this.GetString("RefundStatus")
+	OrderStatus := this.GetString("OrderStatus")
+	var condition string
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	if KeyWord != "" {
+		condition += " AND (product_name like '%" + KeyWord + "%' or real_name like '%" + KeyWord + "%' order_id like '%" + KeyWord + "%' or mobile like '%" + KeyWord + "%')"
+	}
+	sortCondition := " ORDER BY created_time "
+	if sortType == "" {
+		sortType = "DESC"
+	}
+	if CreatedDate != "" {
+		condition += " AND Date(created_time) = '" + CreatedDate + "'"
+	}
+	if PaymentDate != "" {
+		condition += " AND Date(payment_time) = '" + PaymentDate + "'"
+	}
+	if PaymentWay != "" {
+		condition += " AND payment_way='" + PaymentWay + "'"
+	}
+
+	if OrderStatus != "" {
+		switch OrderStatus {
+		case "pending":
+			condition += " AND status='pending'"
+		case "paid":
+			condition += " AND status='paid'"
+		case "closed":
+			condition += " AND status='closed'"
+		case "refund":
+			condition += " AND status='refund'"
+			if RefundStatus != "" {
+				switch RefundStatus {
+				case "pending":
+					condition += " AND refund_status='pending'"
+				case "processing":
+					condition += " AND refund_status='processing'"
+				case "failed":
+					condition += " AND refund_status='failed'"
+				case "success":
+					condition += " AND refund_status='success'"
+				}
+			}
+		default:
+			br.Msg = "无效的订单状态"
+			br.ErrMsg = "无效的订单状态:" + OrderStatus
+			return
+		}
+	}
+	if ProductType != "" {
+		switch ProductType {
+		case "report":
+			condition += " AND product_type='" + string(models.ProductReport) + "'"
+		case "audio":
+			condition += " AND product_type='" + string(models.ProductAudio) + "'"
+		case "video":
+			condition += " AND product_type='" + string(models.ProductVideo) + "'"
+		case "package":
+			condition += " AND product_type='" + string(models.ProductPackage) + "'"
+		default:
+			br.Msg = "无效的产品类型"
+			br.ErrMsg = "无效的产品类型:" + ProductType
+			return
+		}
+	}
+
+	sortCondition = sortCondition + sortType
+	total, err := models.GetProductOrderCountByCondition(condition)
+	if err != nil {
+		br.Msg = "获取商品列表失败"
+		br.ErrMsg = "获取商品列表失败,Err:" + err.Error()
+		return
+	}
+
+	startSize := utils.StartIndex(currentIndex, pageSize)
+	List, err := models.GetProductOrderByCondition(condition, sortCondition, startSize, pageSize)
+	if err != nil {
+		br.Msg = "获取商品列表失败"
+		br.ErrMsg = "获取商品列表失败,Err:" + err.Error()
+		return
+	}
+	var ListView []*models.ProductOrderView
+	for _, order := range List {
+		view := &models.ProductOrderView{
+			OrderID:          order.OrderID,
+			RealName:         order.RealName,
+			Mobile:           fmt.Sprintf("+%s %s", order.AreaCode, order.Mobile),
+			ProductType:      ProductTypeMap[order.ProductType],
+			ProductName:      order.ProductName,
+			TotalAmount:      order.TotalAmount,
+			TradeNO:          order.TradeNO,
+			RefundAmount:     order.RefundAmount,
+			PaymentWay:       PaymentWayMap[order.PaymentWay],
+			PaymentTime:      order.PaymentTime.Format(time.DateTime),
+			Status:           ProductOrderStatus[order.Status],
+			RefundStatus:     RefundStatusMap[order.RefundStatus],
+			RefundFinishTime: order.RefundFinishTime.Format(time.DateTime),
+			Remark:           order.Remark,
+			CreatedTime:      order.CreatedTime.Format(time.DateTime),
+		}
+		ListView = append(ListView, view)
+	}
+	page := paging.GetPaging(currentIndex, pageSize, total)
+	resp := new(response.ProductOrderListResp)
+	resp.List = ListView
+	resp.Paging = page
+	br.Ret = 200
+	br.Success = true
+	br.Data = resp
+	br.Msg = "获取成功"
+}
+
+// TradeOrderList
+// @Title 支付订单列表
+// @Description 支付订单列表
+// @Param   PageSize   query   int  true       "每页数据条数"
+// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Param   ClassifyIds   query   string  true       "二级分类id,可多选用英文,隔开"
+// @Param   KeyWord   query   string  true       "报告标题/创建人"
+// @Param   SortType   query   string  true       "排序方式"
+// @Success 200 {object} models.ReportAuthorResp
+// @router /tradeOrderList [get]
+func (this *OrderController) TradeOrderList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+	sortType := this.GetString("SortType")
+	KeyWord := this.GetString("KeyWord")
+	DealDate := this.GetString("DealDate")
+	PaymentWay := this.GetString("PaymentWay")
+	CreatedDate := this.GetString("CreatedDate")
+	OrderStatus := this.GetString("OrderStatus")
+	IsRefund, _ := this.GetBool("IsRefund", false)
+	var condition string
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	if IsRefund {
+		condition += " AND payment_type ='" + string(models.PaymentTypeRefund) + "'"
+	} else {
+		condition += " AND payment_type ='" + string(models.PaymentTypePay) + "'"
+	}
+	if KeyWord != "" {
+		condition += " AND (product_name like '%" + KeyWord + "%' or real_name like '%" + KeyWord + "%' order_id like '%" + KeyWord + "%' or mobile like '%" + KeyWord + "%')"
+	}
+	sortCondition := " ORDER BY created_time "
+	if sortType == "" {
+		sortType = "DESC"
+	}
+	if CreatedDate != "" {
+		condition += " AND Date(created_time) = '" + CreatedDate + "'"
+	}
+	if DealDate != "" {
+		condition += " AND Date(deal_time) = '" + DealDate + "'"
+	}
+	if PaymentWay != "" {
+		condition += " AND payment_way='" + PaymentWay + "'"
+	}
+
+	if OrderStatus != "" {
+		switch OrderStatus {
+		case "pending":
+			condition += " AND payment_status='pending'"
+		case "done":
+			condition += " AND payment_status='done'"
+		case "failed":
+			condition += " AND payment_status='failed'"
+		default:
+			br.Msg = "无效的支付订单状态"
+			br.ErrMsg = "无效的支付订单状态:" + OrderStatus
+			return
+		}
+	}
+	sortCondition = sortCondition + sortType
+	total, err := models.GetTradeOrderCountByCondition(condition)
+	if err != nil {
+		br.Msg = "获取支付明细列表失败"
+		br.ErrMsg = "获取支付明细列表失败,Err:" + err.Error()
+		return
+	}
+
+	startSize := utils.StartIndex(currentIndex, pageSize)
+	List, err := models.GetTradeOrderByCondition(condition, sortCondition, startSize, pageSize)
+	if err != nil {
+		br.Msg = "获取支付明细列表失败"
+		br.ErrMsg = "获取支付明细列表失败,Err:" + err.Error()
+		return
+	}
+	var ListView []*models.TradeOrderView
+	var wg sync.WaitGroup
+	wg.Add(len(List))
+	for i := 0; i < len(List); i++ {
+		go func(order *models.TradeOrder) {
+			defer wg.Done()
+			productOrder, pdErr := models.GetProductOrderByID(order.ProductOrderId)
+			if pdErr != nil {
+				utils.FileLog.Error("获取商品订单信息失败,Err:" + pdErr.Error())
+			}
+			view := &models.TradeOrderView{
+				RealName:       productOrder.RealName,
+				Mobile:         fmt.Sprintf("+%s %s", productOrder.AreaCode, productOrder.Mobile),
+				ProductName:    productOrder.ProductName,
+				Amount:         order.Amount,
+				TransactionID:  order.TransactionId,
+				ProductOrderID: order.ProductOrderId,
+				PaymentWay:     PaymentWayMap[order.PaymentWay],
+				PaymentAccount: order.PaymentAccount,
+				MerchantID:     order.MerchantId,
+				DealTime:       order.DealTime.Format(time.DateTime),
+				CreatedTime:    order.CreatedTime.Format(time.DateTime),
+			}
+			if IsRefund {
+				view.PaymentStatus = RefundOrderStatus[order.PaymentStatus]
+			} else {
+				view.PaymentStatus = TradeOrderStatus[order.PaymentStatus]
+			}
+			ListView = append(ListView, view)
+		}(List[i])
+
+	}
+	wg.Wait()
+	page := paging.GetPaging(currentIndex, pageSize, total)
+	resp := new(response.TradeOrderListResp)
+	resp.List = ListView
+	resp.Paging = page
+	br.Ret = 200
+	br.Success = true
+	br.Data = resp
+	br.Msg = "获取成功"
+}

+ 2 - 0
models/db.go

@@ -53,5 +53,7 @@ func init() {
 		new(CustomerProductRiskMapping),
 		new(UserSourceClickFlow),
 		new(MerchantProduct),
+		new(ProductOrder),
+		new(TradeOrder),
 	)
 }

+ 103 - 0
models/product_order.go

@@ -0,0 +1,103 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"time"
+)
+
+type OrderStatus string
+type RefundStatus string
+type PaymentWay string
+
+const (
+	//订单状态
+	OrderStatusPending    OrderStatus = "pending"
+	OrderStatusProcessing OrderStatus = "processing"
+	OrderStatusPaid       OrderStatus = "paid"
+	OrderStatusClosed     OrderStatus = "closed"
+	OrderStatusRefund     OrderStatus = "refund"
+	//退款状态
+	RefundStatusSuccess    RefundStatus = "success"
+	RefundStatusPending    RefundStatus = "pending"
+	RefundStatusFailed     RefundStatus = "failed"
+	RefundStatusProcessing RefundStatus = "processing"
+	RefundStatusCanceled   RefundStatus = "canceled"
+	WechatPayWay           PaymentWay   = "wechat"
+	AliPayWay              PaymentWay   = "alipay"
+
+	detailColumn = "id,order_id,user_id,template_user_id,product_id,status,created_time,updated_time,total_amount"
+)
+
+type ProductOrderView struct {
+	OrderID          string
+	RealName         string
+	Mobile           string
+	ProductType      string
+	ProductName      string
+	TotalAmount      string
+	TradeNO          string
+	RefundAmount     string
+	PaymentWay       string
+	PaymentTime      string
+	Status           string
+	RefundStatus     string
+	RefundFinishTime string
+	Remark           string
+	CreatedTime      string
+}
+type ProductOrder struct {
+	ID               int                 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
+	OrderID          string              `gorm:"column:order_id;size:255;comment:'订单编号'" json:"order_id"`
+	UserID           int                 `gorm:"column:user_id;default:null;comment:'用户id'" json:"user_id"`
+	TemplateUserID   int                 `gorm:"column:template_user_id;default:null;comment:'临时用户id'" json:"template_user_id"`
+	RealName         string              `gorm:"column:real_name;default:null;comment:'临时用户id'" json:"real_name"`
+	AreaCode         string              `gorm:"column:area_code;default:null;comment:'临时用户id'" json:"area_code"`
+	Mobile           string              `gorm:"column:mobile;default:null;comment:'临时用户id'" json:"mobile"`
+	ProductID        int                 `gorm:"column:product_id;default:null;comment:'产品id'" json:"product_id"`
+	ProductType      MerchantProductType `gorm:"column:product_type;default:null;comment:'产品类型'" json:"product_type"`
+	ProductName      string              `gorm:"column:product_name;default:null;comment:'商品名称'" json:"product_name"`
+	TotalAmount      string              `gorm:"column:total_amount;size:255;default:null;comment:'金额'" json:"total_amount"`
+	TradeID          int                 `gorm:"column:trade_id;default:null;comment:'支付订单'" json:"trade_id"`
+	TradeNO          string              `gorm:"column:trade_no;default:null;comment:'支付订单'" json:"trade_no"`
+	RefundAmount     string              `gorm:"column:refund_amount;size:255;default:null;comment:'退款金额'" json:"refund_amount"`
+	PaymentWay       PaymentWay          `gorm:"column:payment_way;enum('wechat','alipay');default:null;comment:'支付渠道'"`
+	PaymentTime      time.Time           `gorm:"column:payment_time;default:null;comment:'支付时间'" json:"payment_time"`
+	ExpiredTime      time.Time           `gorm:"column:expired_time;default:null;comment:'超时时间'" json:"expired_time"`
+	Status           OrderStatus         `gorm:"column:status;type:enum('pending','processing','paid','closed','refund');default:'pending';comment:'订单状态'" json:"status"`
+	RefundStatus     RefundStatus        `gorm:"column:refund_status;type:enum('pending','processing','failed','success');default:null;comment:'退款状态'" json:"refund_status"`
+	RefundFinishTime time.Time           `gorm:"column:refund_finish_time;default:null;comment:'退款完成时间'" json:"refund_finish_time"`
+	Remark           string              `gorm:"column:remark;size:255;default:null;comment:'备注'" json:"remark"`
+	IsDeleted        int                 `gorm:"column:is_deleted;size:1;default:0;comment:'是否删除'" json:"is_deleted"`
+	CreatedTime      time.Time           `gorm:"column:created_time;default:null;comment:'创建时间'" json:"created_time"`
+	UpdatedTime      time.Time           `gorm:"column:updated_time;default:null;comment:'更新时间'" json:"updated_time"`
+}
+
+func (m *ProductOrder) TableName() string {
+	return "product_orders"
+}
+
+func GetProductOrderByCondition(condition string, sortCondition string, startSize int, pageSize int) (list []*ProductOrder, err error) {
+	o := orm.NewOrm()
+	sql := `select * from product_orders where is_deleted=0`
+	if condition != "" {
+		sql += condition
+	}
+	if sortCondition != "" {
+		sql += sortCondition
+	}
+	sql += ` LIMIT ?,?`
+	_, err = o.Raw(sql, startSize, pageSize).QueryRows(&list)
+	return
+}
+
+func GetProductOrderCountByCondition(condition string) (total int, err error) {
+	o := orm.NewOrm()
+	err = o.Raw("select count(*) from product_orders where is_deleted=0" + condition).QueryRow(&total)
+	return
+}
+
+func GetProductOrderByID(orderNo string) (order *ProductOrder, err error) {
+	o := orm.NewOrm()
+	err = o.Raw("select * from product_orders where is_deleted=0 and order_id =?", orderNo).QueryRow(&order)
+	return
+}

+ 16 - 0
models/response/order.go

@@ -0,0 +1,16 @@
+package response
+
+import (
+	"eta/eta_mini_crm_ht/models"
+	"github.com/rdlucklib/rdluck_tools/paging"
+)
+
+type ProductOrderListResp struct {
+	List   []*models.ProductOrderView
+	Paging *paging.PagingItem `description:"分页数据"`
+}
+
+type TradeOrderListResp struct {
+	List   []*models.TradeOrderView
+	Paging *paging.PagingItem `description:"分页数据"`
+}

+ 77 - 0
models/trade_order.go

@@ -0,0 +1,77 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"time"
+)
+
+type PaymentType string
+type PaymentStatus string
+
+const (
+	PaymentTypePay          PaymentType   = "pay"
+	PaymentTypeRefund       PaymentType   = "refund"
+	PaymentStatusDone       PaymentStatus = "done"
+	PaymentStatusFailed     PaymentStatus = "failed"
+	PaymentStatusProcessing PaymentStatus = "processing"
+)
+
+type TradeOrderView struct {
+	RealName       string
+	Mobile         string
+	ProductName    string
+	TransactionID  string `gorm:"column:transaction_id;size:255;default:null;comment:'第三方平台ID'" json:"transaction_id"`
+	ProductOrderID string `gorm:"column:product_order_id;size:255;default:null;comment:'商品订单号'" json:"product_order_id"`
+	PaymentAccount string `gorm:"column:payment_account;size:255;default:null;comment:'支付账号'" json:"payment_account"`
+	PaymentWay     string `gorm:"column:payment_way;type:enum('wechat');default:null;comment:'支付渠道'" json:"payment_way"`
+	Amount         string `gorm:"column:amount;size:20;default:null;comment:'支付金额'" json:"amount"`
+	Currency       string `gorm:"column:currency;size:255;default:null;comment:'货币'" json:"currency"`
+	MerchantID     string `gorm:"column:merchant_id;size:255;default:null;comment:'商户id'" json:"merchant_id"`
+	UserID         int    `gorm:"column:user_id;default:null;comment:'用户id'" json:"user_id"`
+	TemplateUserID int    `gorm:"column:template_user_id;default:null;comment:'临时用户id'" json:"template_user_id"`
+	PaymentType    string `gorm:"column:payment_type;type:enum('pay','refund');default:null;comment:'订单类型'" json:"payment_type"`
+	PaymentStatus  string `gorm:"column:payment_status;type:enum('pending','done','failed');default:null;comment:'支付状态'" json:"payment_status"`
+	DealTime       string
+	CreatedTime    string
+}
+type TradeOrder struct {
+	Id             uint          `gorm:"primaryKey;autoIncrement" json:"id"`
+	TransactionId  string        `gorm:"column:transaction_id;size:255;default:null;comment:'第三方平台ID'" json:"transaction_id"`
+	ProductOrderId string        `gorm:"column:product_order_id;size:255;default:null;comment:'商品订单号'" json:"product_order_id"`
+	PaymentAccount string        `gorm:"column:payment_account;size:255;default:null;comment:'支付账号'" json:"payment_account"`
+	PaymentWay     PaymentWay    `gorm:"column:payment_way;type:enum('wechat');default:null;comment:'支付渠道'" json:"payment_way"`
+	Amount         string        `gorm:"column:amount;size:20;default:null;comment:'支付金额'" json:"amount"`
+	Currency       string        `gorm:"column:currency;size:255;default:null;comment:'货币'" json:"currency"`
+	MerchantId     string        `gorm:"column:merchant_id;size:255;default:null;comment:'商户id'" json:"merchant_id"`
+	UserId         int           `gorm:"column:user_id;default:null;comment:'用户id'" json:"user_id"`
+	TemplateUserId int           `gorm:"column:template_user_id;default:null;comment:'临时用户id'" json:"template_user_id"`
+	PaymentType    string        `gorm:"column:payment_type;type:enum('pay','refund');default:null;comment:'订单类型'" json:"payment_type"`
+	PaymentStatus  PaymentStatus `gorm:"column:payment_status;type:enum('pending','done','failed');default:null;comment:'支付状态'" json:"payment_status"`
+	DealTime       time.Time     `gorm:"column:deal_time;default:null;comment:'完成时间'" json:"deal_time"`
+	CreatedTime    time.Time     `gorm:"column:created_time;default:null" json:"created_time"`
+	UpdatedTime    time.Time     `gorm:"column:updated_time;default:null" json:"updated_time"`
+}
+
+func (TradeOrder) TableName() string {
+	return "trade_orders"
+}
+
+func GetTradeOrderByCondition(condition string, sortCondition string, startSize int, pageSize int) (list []*TradeOrder, err error) {
+	o := orm.NewOrm()
+	sql := `select * from trade_orders where 1=1 `
+	if condition != "" {
+		sql += condition
+	}
+	if sortCondition != "" {
+		sql += sortCondition
+	}
+	sql += ` LIMIT ?,?`
+	_, err = o.Raw(sql, startSize, pageSize).QueryRows(&list)
+	return
+}
+
+func GetTradeOrderCountByCondition(condition string) (total int, err error) {
+	o := orm.NewOrm()
+	err = o.Raw("select count(*) from trade_orders where 1=1 " + condition).QueryRow(&total)
+	return
+}

+ 18 - 0
routers/commentsRouter.go

@@ -333,6 +333,24 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["eta/eta_mini_crm_ht/controllers:OrderController"] = append(beego.GlobalControllerRouter["eta/eta_mini_crm_ht/controllers:OrderController"],
+        beego.ControllerComments{
+            Method: "ProductOrderList",
+            Router: `/productOrderList`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_mini_crm_ht/controllers:OrderController"] = append(beego.GlobalControllerRouter["eta/eta_mini_crm_ht/controllers:OrderController"],
+        beego.ControllerComments{
+            Method: "TradeOrderList",
+            Router: `/tradeOrderList`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["eta/eta_mini_crm_ht/controllers:ProductController"] = append(beego.GlobalControllerRouter["eta/eta_mini_crm_ht/controllers:ProductController"],
         beego.ControllerComments{
             Method: "AddProduct",

+ 5 - 0
routers/router.go

@@ -26,6 +26,11 @@ func init() {
 				&controllers.SysDepartmentController{},
 			),
 		),
+		beego.NSNamespace("/order",
+			beego.NSInclude(
+				&controllers.OrderController{},
+			),
+		),
 		beego.NSNamespace("/role",
 			beego.NSInclude(
 				&controllers.SysRoleController{},