- store courier map

This commit is contained in:
gazebo
2018-10-18 09:49:04 +08:00
parent e56eb69b09
commit 6dbadf0569
5 changed files with 186 additions and 6 deletions

View File

@@ -200,3 +200,74 @@ func (c *StoreController) TmpGetJxBadCommentsByStoreId() {
return retVal, "", err
})
}
// @Title 得到门店快递映射信息
// @Description 得到门店快递映射信息
// @Param token header string true "认证token"
// @Param storeID query int true "门店ID"
// @Param vendorID query int false "厂商ID缺省为全部"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetStoreCourierMaps [get]
func (c *StoreController) GetStoreCourierMaps() {
c.callGetStoreCourierMaps(func(params *tStoreGetStoreCourierMapsParams) (retVal interface{}, errCode string, err error) {
if c.GetString("vendorID") == "" {
params.VendorID = -1
}
retVal, err = cms.GetStoreCourierMaps(nil, params.StoreID, params.VendorID)
return retVal, "", err
})
}
// @Title 修改门店快递映射信息
// @Description 修改门店快递映射信息
// @Param token header string true "认证token"
// @Param storeID query int true "门店IDpayload中的相应字段会被忽略"
// @Param vendorID query int true "快递厂商IDpayload中的相应字段会被忽略"
// @Param payload formData string true "json数据StoreCourierMap对象当前只有status, vendorStoreId两项"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateStoreCourierMap [put]
func (c *StoreController) UpdateStoreCourierMap() {
c.callUpdateStoreCourierMap(func(params *tStoreUpdateStoreCourierMapParams) (retVal interface{}, errCode string, err error) {
storeCourierMap := make(map[string]interface{})
if err = utils.UnmarshalUseNumber([]byte(params.Payload), &storeCourierMap); err == nil {
retVal, err = cms.UpdateStoreCourierMap(nil, params.StoreID, params.VendorID, storeCourierMap, GetUserNameFromToken(params.Token))
}
return retVal, "", err
})
}
// @Title 新增门店快递映射信息
// @Description 新增门店快递映射信息
// @Param token header string true "认证token"
// @Param storeID formData int true "门店IDpayload中的相应字段会被忽略"
// @Param vendorID formData int true "快递厂商IDpayload中的相应字段会被忽略"
// @Param payload formData string true "json数据StoreCourierMap对象当前只有status, vendorStoreId两项"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AddStoreCourierMap [post]
func (c *StoreController) AddStoreCourierMap() {
c.callAddStoreCourierMap(func(params *tStoreAddStoreCourierMapParams) (retVal interface{}, errCode string, err error) {
storeCourierMap := &model.StoreCourierMap{}
if err = utils.UnmarshalUseNumber([]byte(params.Payload), storeCourierMap); err == nil {
retVal, err = cms.AddStoreCourierMap(nil, params.StoreID, params.VendorID, storeCourierMap, GetUserNameFromToken(params.Token))
}
return retVal, "", err
})
}
// @Title 删除门店快递映射信息
// @Description 删除门店快递映射信息
// @Param token header string true "认证token"
// @Param storeID query int true "门店ID"
// @Param vendorID query int true "快递厂商ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /DeleteStoreCourierMap [delete]
func (c *StoreController) DeleteStoreCourierMap() {
c.callDeleteStoreCourierMap(func(params *tStoreDeleteStoreCourierMapParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.DeleteStoreCourierMap(nil, params.StoreID, params.VendorID, GetUserNameFromToken(params.Token))
return retVal, "", err
})
}