poi_page.PackagePriceUpdate

This commit is contained in:
gazebo
2019-12-30 16:30:21 +08:00
parent 548225b04b
commit 4d8c4d67d4
6 changed files with 75 additions and 11 deletions

View File

@@ -0,0 +1,37 @@
package mtwmapi
import "git.rosy.net.cn/baseapi/utils"
type PackagePriceItem struct {
Label string `json:"label"`
Value int `json:"value"`
}
type PackagePriceInfo struct {
PackagePayType int `json:"packagePayType"`
PackagePrice int `json:"packagePrice"`
PackagePriceRange []*PackagePriceItem `json:"packagePriceRange"`
WmPoiID int `json:"wmPoiId"`
Message string `json:"message"`
}
func (a *API) PackagePriceUpdate(poiCode string, packetPayType, packetPrice int) (err error) {
params := map[string]interface{}{
"wmPoiId": poiCode,
"packetPayType": packetPayType,
"packetPrice": packetPrice,
}
_, err = a.AccessUserPage2("reuse/sc/product/packageprice/w/update", params, true)
return err
}
func (a *API) PackagePriceGet(poiCode string) (priceInfo *PackagePriceInfo, err error) {
params := map[string]interface{}{
"wmPoiId": poiCode,
}
result, err := a.AccessUserPage2("reuse/sc/product/packageprice/r/get", params, true)
if err == nil {
err = utils.Map2StructByJson(result, &priceInfo, false)
}
return priceInfo, err
}