package router

import (
	"github.com/gin-gonic/gin"
	"go-admin/app/admin/apis/basic"
	"go-admin/app/admin/middleware"
	jwt "go-admin/pkg/jwtauth"
)

func registerCommodityRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	r := v1.Group("/commodity").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
	r.POST("create", basic.CommodityCreate)                    // 新增商品
	r.POST("edit", basic.CommodityEdit)                        // 编辑商品
	r.POST("delete", basic.CommodityDel)                       // 删除商品
	r.POST("list", basic.CommodityList)                        // 商品列表
	r.POST("detail", basic.CommodityDetail)                    // 商品详情
	r.POST("import_commodity_view", basic.CommodityImportView) // 导入商品资料预览
	r.POST("import_commodity", basic.CommodityImport)          // 导入商品资料
}
