- fix GetStores bug.

- isFocus on sku name.
This commit is contained in:
gazebo
2018-09-20 12:06:06 +08:00
parent 65e5587cba
commit 582b4c9722
4 changed files with 73 additions and 48 deletions

View File

@@ -14,7 +14,7 @@ type StoreSkuController struct {
// @Description 得到商家商品信息,如下条件之间是与的关系
// @Param token header string true "认证token"
// @Param storeID query int true "门店ID"
// @Param isFocused query bool true "是否已关注(认领)"
// @Param isFocus query bool true "是否已关注(认领)"
// @Param keyword query string false "查询关键字(可以为空,为空表示不限制)"
// @Param nameID query int false "SkuName ID"
// @Param skuID query int false "Sku ID"
@@ -32,7 +32,7 @@ type StoreSkuController struct {
// @router /GetStoreSkus [get]
func (c *StoreSkuController) GetStoreSkus() {
c.callGetStoreSkus(func(params *tStoreSkuGetStoreSkusParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetStoreSkus(params.StoreID, params.IsFocused, params.Keyword, params.MapData, params.Offset, params.PageSize)
retVal, err = cms.GetStoreSkus(params.StoreID, params.IsFocus, params.Keyword, params.MapData, params.Offset, params.PageSize)
return retVal, "", err
})
}
@@ -41,7 +41,7 @@ func (c *StoreSkuController) GetStoreSkus() {
// @Description 修改商家商品绑定
// @Param token header string true "认证token"
// @Param storeID formData int true "需要修改的商品名IDpayload中的相应数据会被忽略"
// @Param payload formData string true "json数据StoreSkuBindInfo对象数组
// @Param payload formData string true "json数据StoreSkuBindInfo对象
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateStoreSku [put]
@@ -54,3 +54,21 @@ func (c *StoreSkuController) UpdateStoreSku() {
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 /UpdateStoreSkus [put]
func (c *StoreSkuController) UpdateStoreSkus() {
c.callUpdateStoreSkus(func(params *tStoreSkuUpdateStoreSkusParams) (retVal interface{}, errCode string, err error) {
var skuBindInfos []*cms.StoreSkuBindInfo
if err = utils.UnmarshalUseNumber([]byte(params.Payload), &skuBindInfos); err == nil {
retVal, err = cms.UpdateStoreSkus(params.StoreID, skuBindInfos, GetUserNameFromToken(params.Token))
}
return retVal, "", err
})
}