- UpdateStoreSku

This commit is contained in:
gazebo
2018-09-13 23:11:02 +08:00
parent 20c3c0341a
commit 84ea7d20ba
4 changed files with 119 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
package controllers
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
"github.com/astaxie/beego"
)
@@ -34,3 +35,21 @@ func (c *StoreSkuController) GetStoreSkus() {
return retVal, "", err
})
}
// @Title 修改商家商品绑定
// @Description 修改商家商品绑定
// @Param token header string true "认证token"
// @Param storeID formData int true "需要修改的商品名IDpayload中的相应数据会被忽略"
// @Param payload formData string true "json数据StoreSkuBindInfo对象数组
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateStoreSku [put]
func (c *StoreSkuController) UpdateStoreSku() {
c.callUpdateStoreSku(func(params *tStoreSkuUpdateStoreSkuParams) (retVal interface{}, errCode string, err error) {
var skuBinds []*cms.StoreSkuBindInfo
if err = utils.UnmarshalUseNumber([]byte(params.Payload), &skuBinds); err == nil {
retVal, err = cms.UpdateStoreSku(params.StoreID, skuBinds, GetUserNameFromToken(params.Token))
}
return retVal, "", err
})
}