品牌类别接口

This commit is contained in:
suyl
2021-09-03 09:07:55 +08:00
parent c75699bdeb
commit a29fef75e5
4 changed files with 342 additions and 0 deletions

View File

@@ -1210,3 +1210,90 @@ func (c *StoreController) UpdateOrCreateCourierStoresByBrand() {
return retVal, "", err
})
}
// @Title 得到品牌类别
// @Description 得到品牌类别
// @Param token header string true "认证token"
// @Param parentID query int false "父ID"
// @Param level query int false "分类等级"
// @Param brandID query int true "品牌ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetBrandCategoryMap [get]
func (c *StoreController) GetBrandCategoryMap() {
c.callGetBrandCategoryMap(func(params *tStoreGetBrandCategoryMapParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetBrandCategoryMap(params.Ctx, params.ParentID, params.Level, params.BrandID)
return retVal, "", err
})
}
// @Title 新增品牌类别
// @Description 新增品牌类别
// @Param token header string true "认证token"
// @Param brandID formData int true "品牌ID"
// @Param categroyID formData int false "京西分类id"
// @Param level formData int true "分类级别"
// @Param parentID formData int true "分类父ID"
// @Param brandCategroyName formData string true "类别name"
// @Param brandCategroySeq formData int true "类别序号"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AddBrandCategoryMap [post]
func (c *StoreController) AddBrandCategoryMap() {
c.callAddBrandCategoryMap(func(params *tStoreAddBrandCategoryMapParams) (retVal interface{}, errCode string, err error) {
brandCategoryMap := &model.BrandCategoryMap{
BrandID: params.BrandID,
CategoryID: params.CategroyID,
BrandCategoryName: params.BrandCategroyName,
BrandCategorySeq: params.BrandCategroySeq,
Level: params.Level,
ParentID: params.ParentID,
}
retVal, err = cms.AddBrandCategoryMap(params.Ctx, brandCategoryMap)
return retVal, "", err
})
}
// @Title 修改品牌类别
// @Description 修改品牌类别
// @Param token header string true "认证token"
// @Param ID formData int true "记录ID"
// @Param categoryID formData int false "京西分类id"
// @Param brandCategroyName formData string false "类别name"
// @Param level formData int true "分类级别"
// @Param parentID formData int true "分类父ID"
// @Param isDelete formData bool false "是否是删除操作默认false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateBrandCategoryMap [put]
func (c *StoreController) UpdateBrandCategoryMap() {
c.callUpdateBrandCategoryMap(func(params *tStoreUpdateBrandCategoryMapParams) (retVal interface{}, errCode string, err error) {
brandCategoryMap := &model.BrandCategoryMap{
CategoryID: params.CategoryID,
BrandCategoryName: params.BrandCategroyName,
Level: params.Level,
ParentID: params.ParentID,
}
retVal, err = cms.UpdateBrandCategoryMap(params.Ctx, params.ID, brandCategoryMap, params.IsDelete)
return retVal, "", err
})
}
// @Title 品牌类别重排序
// @Description 品牌类别重排序
// @Param token header string true "认证token"
// @Param categoryID formData int true "父ID"
// @Param brandID formData int true "门店ID"
// @Param categoryIDs formData string true "同一父类别下的所有子类别ID列表([1,2,3,4])"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /ReorderBrandCategories [put]
func (c *SkuController) ReorderBrandCategories() {
c.callReorderBrandCategories(func(params *tSkuReorderBrandCategoriesParams) (retVal interface{}, errCode string, err error) {
var idList []int
if err = utils.UnmarshalUseNumber([]byte(params.CategoryIDs), &idList); err == nil {
err = cms.ReorderBrandCategories(params.Ctx, params.CategoryID, params.BrandID, idList)
}
return retVal, "", err
})
}