提交 78506403 authored 作者: lihaixin's avatar lihaixin

初始

上级 60e5e630
package weimob
import (
"encoding/json"
"errors"
)
func (w *weimobConfig) RightsDetial(accessToken, rightsId string) (res RightsDetialRes, err error) {
url := w.ApiUrl + "api/1_0/ec/rights/getRightsOrderDetail?accesstoken=" + accessToken
query := map[string]interface{}{"id": rightsId}
queryBody, err := json.Marshal(query)
if err != nil {
return
}
queryData := w.PostJSON(url, queryBody)
err = json.Unmarshal([]byte(queryData), &res)
return
}
//拒绝售后
func (w *weimobConfig) AfterSaleRefuse(accesstoken string, id int64, refusedReason string) (res string, err error) {
if id <= 0 {
err = errors.New("售后id不能为空")
return
}
deliveryParams := map[string]interface{}{
"id": id,
"cancelType": 2,
"refusedReason": "售后申请被拒绝",
}
if len(refusedReason) > 0 {
deliveryParams["refusedReason"] = refusedReason
}
url := w.ApiUrl + "api/1_0/ec/rights/cancelRightsOrder?accesstoken=" + accesstoken
body, err := json.Marshal(deliveryParams)
if err != nil {
return
}
res = w.PostJSON(url, body)
return
}
//同意售后
func (w *weimobConfig) AfterSaleAgree(accesstoken string, id, rightsType int64) (res string, err error) {
if id <= 0 {
err = errors.New("售后id不能为空")
return
}
if rightsType != 1 && rightsType != 2 && rightsType != 5 {
err = errors.New("售后id不能为空")
return
}
deliveryParams := map[string]interface{}{
"id": id,
"rightsType": rightsType,
}
url := w.ApiUrl + "api/1_0/ec/rights/agreeRightsOrder?accesstoken=" + accesstoken
body, err := json.Marshal(deliveryParams)
if err != nil {
return
}
res = w.PostJSON(url, body)
return
}
//商家确认收货 a
func (w *weimobConfig) ConfirmReceivedRightsGoods(accesstoken string, id int64) (res string, err error) {
if id <= 0 {
err = errors.New("售后id不能为空")
return
}
deliveryParams := map[string]interface{}{
"id": id,
}
url := w.ApiUrl + "api/1_0/ec/rights/confirmReceivedRightsGoods?accesstoken=" + accesstoken
body, err := json.Marshal(deliveryParams)
if err != nil {
return
}
res = w.PostJSON(url, body)
return
}
package weimob
import (
"encoding/json"
)
//获取授权店铺
func (w *weimobConfig) GetShopRefreshToken(clientId, clientSecret, redirectUri, code string) (data *ShopAccessTokenRes, err error) {
url := w.ApiUrl + "fuwu/b/oauth2/token?code=" + code + "&grant_type=authorization_code&client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=" + redirectUri
res := w.DoPost(url, map[string]interface{}{})
err = json.Unmarshal([]byte(res), &data)
return
}
//刷新店铺access_token接口
func (w *weimobConfig) GetShopAccessToken(clientId, clientSecret, refreshToken string) (data *ShopAccessTokenRes, err error) {
url := w.ApiUrl + "fuwu/b/oauth2/token?grant_type=refresh_token&client_id=" + clientId + "&client_secret=" + clientSecret + "&refresh_token=" + refreshToken
res := w.DoPost(url, map[string]interface{}{})
err = json.Unmarshal([]byte(res), &data)
return
}
package weimob
import (
"encoding/json"
)
func (w *weimobConfig) GetSkuId(accesstoken string, outerSkuCode int, storeId string) (res *GetSkuIdRes, err error) {
url := w.ApiUrl + "api/1_0/ec/singleProduct/queryProductListBySkuCode?accesstoken=" + accesstoken
data := w.DoPost(url, map[string]interface{}{"skuCode": outerSkuCode, "storeId": storeId})
err = json.Unmarshal([]byte(data), &res)
return
}
func (w *weimobConfig) UpdatePrice(accesstoken string, req map[string]interface{}) (res *WeimobRes, err error) {
url := w.ApiUrl + "api/1_0/ec/retailGoods/updatePrice?accesstoken=" + accesstoken
data := w.DoPost(url, req)
err = json.Unmarshal([]byte(data), &res)
return
}
func (w *weimobConfig) UpdateStock(accesstoken string, req map[string]interface{}) (res *WeimobRes, err error) {
url := w.ApiUrl + "api/1_0/ec/goods/updateStock?accesstoken=" + accesstoken
data := w.DoPost(url, req)
err = json.Unmarshal([]byte(data), &res)
return
}
func (w *weimobConfig) GoodsDetail(accesstoken, goodId string) (res *WeimobGoodsDetialResult, err error) {
url := w.ApiUrl + "api/1_0/ec/goods/queryGoodsDetail?accesstoken=" + accesstoken
body, _ := json.Marshal(map[string]string{"goodsId": goodId})
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
//查询模板
func (w *weimobConfig) FindFreightTemplateList(accesstoken string) (res *FindFreightTemplateListRes, err error) {
url := w.ApiUrl + "api/1_0/ec/goods/findFreightTemplateList?accesstoken=" + accesstoken
data := w.DoPost(url, map[string]interface{}{})
err = json.Unmarshal([]byte(data), &res)
return
}
//查询快递
func (w *weimobConfig) FindDeliveryTypeList(accesstoken string) (res *FindDeliveryTypeListRes, err error) {
url := w.ApiUrl + "api/1_0/ec/goods/findDeliveryTypeList?accesstoken=" + accesstoken
data := w.DoPost(url, map[string]interface{}{})
err = json.Unmarshal([]byte(data), &res)
return
}
//查询sku
func (w *weimobConfig) CategoryAttrInfo(accesstoken string, deliveryParams map[string]interface{}) (res *CategoryAttrInfoRes, err error) {
url := w.ApiUrl + "api/1_0/ec/category/queryCategoryAttrInfo?accesstoken=" + accesstoken
queryBody, err := json.Marshal(deliveryParams)
if err != nil {
return
}
queryData := w.PostJSON(url, queryBody)
err = json.Unmarshal([]byte(queryData), &res)
return
}
//添加sku
func (w *weimobConfig) AddAttributeName(accesstoken string, deliveryParams map[string]interface{}) (res *AddAttributeNameRes, err error) {
url := w.ApiUrl + "api/1_0/ec/category/addAttribute?accesstoken=" + accesstoken
body, err := json.Marshal(deliveryParams)
if err != nil {
return
}
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
//添加sku值
func (w *weimobConfig) AddAttributeValue(accesstoken string, deliveryParams map[string]interface{}) (res *AddAttributeValueRes, err error) {
url := w.ApiUrl + "api/1_0/ec/category/addAttrValue?accesstoken=" + accesstoken
body, err := json.Marshal(deliveryParams)
if err != nil {
return
}
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
func (w *weimobConfig) Add(accesstoken string, good map[string]interface{}) (res *WeimobGoodsResult, err error) {
url := w.ApiUrl + "api/1_0/ec/goods/addGoods?accesstoken=" + accesstoken
body, err := json.Marshal(good)
if err != nil {
return
}
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
func (w *weimobConfig) Update(accesstoken string, good map[string]interface{}) (res *WeimobGoodsResult, err error) {
url := w.ApiUrl + "api/1_0/ec/goods/updateGoods?accesstoken=" + accesstoken
body, err := json.Marshal(good)
if err != nil {
return
}
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
func (w *weimobConfig) Dels(accesstoken string, goodIds []int64) (res *WeimobGoodsDelResult, err error) {
url := w.ApiUrl + "api/1_0/ec/goods/deleteGoods?accesstoken=" + accesstoken
body, _ := json.Marshal(map[string][]int64{"goodsIdList": goodIds})
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
func (w *weimobConfig) CategoryTree(accesstoken string) (res *Result, err error) {
url := w.ApiUrl + "api/1_0/ec/category/queryCategoryTree?accesstoken=" + accesstoken
data := w.DoPost(url, map[string]interface{}{})
err = json.Unmarshal([]byte(data), &res)
return
}
func (w *weimobConfig) ChildrenCategory(accesstoken string, categoryId int) (res *Result, err error) {
url := w.ApiUrl + "api/1_0/ec/category/queryChildrenCategory?accesstoken=" + accesstoken
body := map[string]interface{}{
"categoryId": categoryId,
}
data, _ := json.Marshal(body)
r := w.PostJSON(url, data)
err = json.Unmarshal([]byte(r), &res)
return
}
package weimob
//解析授权信息
type ShopAccessTokenRes struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
RefreshToken string `json:"refresh_token"`
RefreshTokenExpiresIn int `json:"refresh_token_expires_in"`
ExpiresIn int `json:"expires_in"`
Scope string `json:"scope"`
PublicAccountID string `json:"public_account_id"`
BusinessID string `json:"business_id"`
Error string `json:"error"`
ErrorDescription string `json:"error_description"`
}
//订单详情
type WeimodOrderDetialRes struct {
Data struct {
Autocanceltime interface{} `json:"autoCancelTime"`
Autoconfirmreceivedtime interface{} `json:"autoConfirmReceivedTime"`
Bizinfo struct {
Bizid interface{} `json:"bizId"`
Bizorderid interface{} `json:"bizOrderId"`
Biztype int `json:"bizType"`
Biztypename string `json:"bizTypeName"`
Subbiztype interface{} `json:"subBizType"`
} `json:"bizInfo"`
Buyerinfo struct {
Membershipinfo interface{} `json:"membershipInfo"`
Userarea interface{} `json:"userArea"`
Usernickname string `json:"userNickname"`
Usersex interface{} `json:"userSex"`
Wid int `json:"wid"`
} `json:"buyerInfo"`
Buyerremark string `json:"buyerRemark"`
Canceltime interface{} `json:"cancelTime"`
Canceltype interface{} `json:"cancelType"`
Channeltypename string `json:"channelTypeName"`
Commentinfo interface{} `json:"commentInfo"`
Confirmreceivedtime interface{} `json:"confirmReceivedTime"`
Createtime int64 `json:"createTime"`
Customfieldlist []struct {
Key string `json:"key"`
Name string `json:"name"`
Sort int `json:"sort"`
Value string `json:"value"`
} `json:"customFieldList"`
Deliveryamount int `json:"deliveryAmount"`
Deliverydetail struct {
Citydeliverydetail interface{} `json:"cityDeliveryDetail"`
Deliverytype int `json:"deliveryType"`
Deliverytypename string `json:"deliveryTypeName"`
Expectdeliverytime interface{} `json:"expectDeliveryTime"`
Issplitpackage interface{} `json:"isSplitPackage"`
Logisticsdeliverydetail struct {
Expectdeliverydate interface{} `json:"expectDeliveryDate"`
Expectdeliverytime string `json:"expectDeliveryTime"`
Expectdeliverytype interface{} `json:"expectDeliveryType"`
Idcardno interface{} `json:"idCardNo"`
Issplitpackage interface{} `json:"isSplitPackage"`
Logisticsorderlist []interface{} `json:"logisticsOrderList"`
Receiveraddress string `json:"receiverAddress"`
Receiverarea string `json:"receiverArea"`
Receivercity string `json:"receiverCity"`
Receivercounty string `json:"receiverCounty"`
Receiverlatitude string `json:"receiverLatitude"`
Receiverlongitude string `json:"receiverLongitude"`
Receivermobile string `json:"receiverMobile"`
Receivername string `json:"receiverName"`
Receiverprovince string `json:"receiverProvince"`
Receiverzip interface{} `json:"receiverZip"`
} `json:"logisticsDeliveryDetail"`
Selfpickupdetail interface{} `json:"selfPickupDetail"`
} `json:"deliveryDetail"`
Deliverydiscountamount interface{} `json:"deliveryDiscountAmount"`
Deliverypaymentamount int `json:"deliveryPaymentAmount"`
Deliverytime interface{} `json:"deliveryTime"`
Discountinfo struct {
Balancediscountamount int `json:"balanceDiscountAmount"`
Balancediscountdeliveryamount interface{} `json:"balanceDiscountDeliveryAmount"`
Couponcodediscountamount int `json:"couponCodeDiscountAmount"`
Couponcodediscountinfo interface{} `json:"couponCodeDiscountInfo"`
Coupondiscountamount int `json:"couponDiscountAmount"`
Coupondiscountinfo interface{} `json:"couponDiscountInfo"`
Deliveryusedpoints interface{} `json:"deliveryUsedPoints"`
Memberpointsdiscountamount int `json:"memberPointsDiscountAmount"`
Membershipdiscountamount int `json:"membershipDiscountAmount"`
Membershipdiscountinfo interface{} `json:"membershipDiscountInfo"`
Merchantdiscountamount int `json:"merchantDiscountAmount"`
Nynjdiscountamount interface{} `json:"nynjDiscountAmount"`
Pointsdiscountdeliveryamount interface{} `json:"pointsDiscountDeliveryAmount"`
Promotiondiscountamount int `json:"promotionDiscountAmount"`
Usedmemberpoints int `json:"usedMemberPoints"`
} `json:"discountInfo"`
Enabledelivery int `json:"enableDelivery"`
Flagcontent interface{} `json:"flagContent"`
Flagrank interface{} `json:"flagRank"`
Goodsamount float64 `json:"goodsAmount"`
Goodspromotioninfo struct {
Cycleorderinfo struct {
Currentcyclenum interface{} `json:"currentCycleNum"`
Cycledeliverytime interface{} `json:"cycleDeliveryTime"`
Cycleitemlist interface{} `json:"cycleItemList"`
Cyclepackagelist []interface{} `json:"cyclePackageList"`
Cyclesize interface{} `json:"cycleSize"`
Cycletype interface{} `json:"cycleType"`
Cycletypename interface{} `json:"cycleTypeName"`
Firsttime interface{} `json:"firstTime"`
} `json:"cycleOrderInfo"`
Goodsdistributiontype int `json:"goodsDistributionType"`
Promotionid interface{} `json:"promotionId"`
Promotionorderid interface{} `json:"promotionOrderId"`
Promotiontype int `json:"promotionType"`
} `json:"goodsPromotionInfo"`
Itemlist []struct {
Basediscountinfo struct {
Balancediscountamount interface{} `json:"balanceDiscountAmount"`
Couponcodediscountamount interface{} `json:"couponCodeDiscountAmount"`
Coupondiscountamount interface{} `json:"couponDiscountAmount"`
Memberpointsdiscountamount interface{} `json:"memberPointsDiscountAmount"`
Membershipdiscountamount interface{} `json:"membershipDiscountAmount"`
Merchantdiscountamount interface{} `json:"merchantDiscountAmount"`
Nynjdiscountamount interface{} `json:"nynjDiscountAmount"`
Promotiondiscountamount interface{} `json:"promotionDiscountAmount"`
Usedmemberpoints interface{} `json:"usedMemberPoints"`
} `json:"baseDiscountInfo"`
Bizinfo struct {
Bizid interface{} `json:"bizId"`
Bizorderid interface{} `json:"bizOrderId"`
Biztype interface{} `json:"bizType"`
Subbiztype interface{} `json:"subBizType"`
} `json:"bizInfo"`
Commentstatus interface{} `json:"commentStatus"`
Goodscategoryid interface{} `json:"goodsCategoryId"`
Goodscode interface{} `json:"goodsCode"`
Goodsid int64 `json:"goodsId"`
Goodstitle string `json:"goodsTitle"`
Goodstype int `json:"goodsType"`
Haddeliveryitemnum int `json:"hadDeliveryItemNum"`
ID int `json:"id"`
Imageurl string `json:"imageUrl"`
Originalprice float64 `json:"originalPrice"`
Paymentamount float64 `json:"paymentAmount"`
Point interface{} `json:"point"`
Price float64 `json:"price"`
Productinfolist interface{} `json:"productInfoList"`
Producttype interface{} `json:"productType"`
Rightsorderid interface{} `json:"rightsOrderId"`
Rightsstatus interface{} `json:"rightsStatus"`
Rightsstatusname interface{} `json:"rightsStatusName"`
Shouldpaymentamount float64 `json:"shouldPaymentAmount"`
Skuamount float64 `json:"skuAmount"`
Skucode interface{} `json:"skuCode"`
Skuid int64 `json:"skuId"`
Skuname interface{} `json:"skuName"`
Skunum int `json:"skuNum"`
Taginfo struct {
Activitytag interface{} `json:"activityTag"`
Advancedactivitytaglist interface{} `json:"advancedActivityTagList"`
Allactivitytaglist interface{} `json:"allActivityTagList"`
Alltaglist interface{} `json:"allTagList"`
Biztaglist interface{} `json:"bizTagList"`
Coupontag interface{} `json:"couponTag"`
Customizedtag interface{} `json:"customizedTag"`
Generalactivitytaglist interface{} `json:"generalActivityTagList"`
Goodsbiztag []interface{} `json:"goodsBizTag"`
Goodsusertag interface{} `json:"goodsUserTag"`
Industrytaglist interface{} `json:"industryTagList"`
Merchanttag interface{} `json:"merchantTag"`
Usertag interface{} `json:"userTag"`
} `json:"tagInfo"`
Totalamount float64 `json:"totalAmount"`
Totalpoint interface{} `json:"totalPoint"`
} `json:"itemList"`
Merchantinfo struct {
Merchanttitle string `json:"merchantTitle"`
Operatorid interface{} `json:"operatorId"`
Operatorname interface{} `json:"operatorName"`
Operatorphone interface{} `json:"operatorPhone"`
Pid int64 `json:"pid"`
Processstoreid int `json:"processStoreId"`
Processstoretitle string `json:"processStoreTitle"`
Selfpickupsiteid interface{} `json:"selfPickupSiteId"`
Storeid int `json:"storeId"`
Storetitle string `json:"storeTitle"`
} `json:"merchantInfo"`
Operationlist []struct {
Name string `json:"name"`
Operationtype int `json:"operationType"`
Parameter interface{} `json:"parameter"`
Uitype interface{} `json:"uiType"`
URL interface{} `json:"url"`
} `json:"operationList"`
Orderno int64 `json:"orderNo"`
Orderstatus int `json:"orderStatus"`
Orderstatusname string `json:"orderStatusName"`
Paymentamount float64 `json:"paymentAmount"`
Paymentinfo struct {
Channeltrxno interface{} `json:"channelTrxNo"`
Paymentmethodname interface{} `json:"paymentMethodName"`
Paymentstatus int `json:"paymentStatus"`
Paymenttime interface{} `json:"paymentTime"`
Paymenttype int `json:"paymentType"`
Paymenttypename string `json:"paymentTypeName"`
Tradeid interface{} `json:"tradeId"`
} `json:"paymentInfo"`
Refundinfo interface{} `json:"refundInfo"`
Selfpickupdealinfovo interface{} `json:"selfPickupDealInfoVo"`
Shouldpaymentamount float64 `json:"shouldPaymentAmount"`
Totalamount float64 `json:"totalAmount"`
Totalpoint interface{} `json:"totalPoint"`
Transferstatus int `json:"transferStatus"`
Transfertype int `json:"transferType"`
Transfertypereality interface{} `json:"transferTypeReality"`
} `json:"data"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
}
//售后详情
type RightsDetialRes struct {
GlobalTicket string `json:"globalTicket"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data struct {
RightsInfo struct {
FlagRank interface{} `json:"flagRank"`
Goods struct {
GoodsPreviewURL string `json:"goodsPreviewUrl"`
GoodsID int64 `json:"goodsId"`
OrderItemID int64 `json:"orderItemId"`
CostPrice interface{} `json:"costPrice"`
WarehouseName string `json:"warehouseName"`
SkuName string `json:"skuName"`
Price float64 `json:"price"`
ImageURL string `json:"imageUrl"`
GoodsTitle string `json:"goodsTitle"`
WarehouseType int `json:"warehouseType"`
ProductType int `json:"productType"`
SkuCode string `json:"skuCode"`
SkuID int64 `json:"skuId"`
SkuNum int `json:"skuNum"`
} `json:"goods"`
ChannelType int `json:"channelType"`
Pid int64 `json:"pid"`
AutoRefundPayTime int `json:"autoRefundPayTime"`
DefaultReturnAddress interface{} `json:"defaultReturnAddress"`
RefundStorageCardAmount float64 `json:"refundStorageCardAmount"`
AlreadyRefundAmount interface{} `json:"alreadyRefundAmount"`
RefundInvoiceTexAmount float64 `json:"refundInvoiceTexAmount"`
ThreeTime interface{} `json:"threeTime"`
RightsReason interface{} `json:"rightsReason"`
ExpandLabelInfo struct {
AttributeStatus interface{} `json:"attributeStatus"`
VirtualWid bool `json:"virtualWid"`
} `json:"expandLabelInfo"`
RefundPoints int `json:"refundPoints"`
ChannelTypeName string `json:"channelTypeName"`
ID int64 `json:"id"`
GoodsSourceType int `json:"goodsSourceType"`
SkuID int64 `json:"skuId"`
TwoTime interface{} `json:"twoTime"`
AgreeRightsTime int64 `json:"agreeRightsTime"`
FinishTime int64 `json:"finishTime"`
StoreTitle string `json:"storeTitle"`
BizInfoList []interface{} `json:"bizInfoList"`
ReasonImageURLList interface{} `json:"reasonImageUrlList"`
FiveTime interface{} `json:"fiveTime"`
BalanceDeductionAmount interface{} `json:"balanceDeductionAmount"`
UserNickname interface{} `json:"userNickname"`
StorageCardDiscountAmount float64 `json:"storageCardDiscountAmount"`
CustomRightsReason interface{} `json:"customRightsReason"`
FourTime interface{} `json:"fourTime"`
AmountReturnFailCode interface{} `json:"amountReturnFailCode"`
OrderInfo struct {
PayMethodIDName string `json:"payMethodIdName"`
OrderNo int64 `json:"orderNo"`
PaymentWay struct {
RefundType int `json:"refundType"`
PaymentMethodList string `json:"paymentMethodList"`
} `json:"paymentWay"`
ApplyOrderStatus int `json:"applyOrderStatus"`
PaymentType interface{} `json:"paymentType"`
} `json:"orderInfo"`
RefundBalance float64 `json:"refundBalance"`
WxRefundPromotionDetailList interface{} `json:"wxRefundPromotionDetailList"`
RightsCauseType int `json:"rightsCauseType"`
AgreeWid interface{} `json:"agreeWid"`
RightsStatusType int `json:"rightsStatusType"`
OutRightsID interface{} `json:"outRightsId"`
RefundMethod int `json:"refundMethod"`
RightsOuterCustomFieldVo interface{} `json:"rightsOuterCustomFieldVo"`
BizType interface{} `json:"bizType"`
ExchangeInfo interface{} `json:"exchangeInfo"`
RightsStatus int `json:"rightsStatus"`
UsedMemberPoints interface{} `json:"usedMemberPoints"`
GoodsPreviewURL interface{} `json:"goodsPreviewUrl"`
IsArchived interface{} `json:"isArchived"`
DeliveryAmount float64 `json:"deliveryAmount"`
ProcessStoreTitle string `json:"processStoreTitle"`
AotuConfrimReceivedTime int `json:"aotuConfrimReceivedTime"`
PaymentAmount float64 `json:"paymentAmount"`
ProcessStoreID int64 `json:"processStoreId"`
ReturnGoodsTime interface{} `json:"returnGoodsTime"`
ApplyAmount float64 `json:"applyAmount"`
BenefitInfoVoList interface{} `json:"benefitInfoVoList"`
PaymentType int `json:"paymentType"`
ReferOrderType int `json:"referOrderType"`
TagInfo struct {
AllActivityTagList interface{} `json:"allActivityTagList"`
AllTagList interface{} `json:"allTagList"`
GoodsUserTag interface{} `json:"goodsUserTag"`
AdvancedActivityTagList interface{} `json:"advancedActivityTagList"`
MerchantTag interface{} `json:"merchantTag"`
IndustryTagList interface{} `json:"industryTagList"`
CouponTag interface{} `json:"couponTag"`
UserTag interface{} `json:"userTag"`
GoodsBizTag interface{} `json:"goodsBizTag"`
ActivityTag interface{} `json:"activityTag"`
GeneralActivityTagList interface{} `json:"generalActivityTagList"`
BizTagList interface{} `json:"bizTagList"`
CustomizedTag interface{} `json:"customizedTag"`
} `json:"tagInfo"`
OperationList []interface{} `json:"operationList"`
RefundAccountInfo interface{} `json:"refundAccountInfo"`
Wid int64 `json:"wid"`
RightsCauseTypeName string `json:"rightsCauseTypeName"`
ApplyRefundAmount interface{} `json:"applyRefundAmount"`
AutoHandleText interface{} `json:"autoHandleText"`
PointsDiscountAmount interface{} `json:"pointsDiscountAmount"`
RefundAmount float64 `json:"refundAmount"`
DeliveryInfo interface{} `json:"deliveryInfo"`
OrderRightsSource int `json:"orderRightsSource"`
StatusDesc interface{} `json:"statusDesc"`
RightsType int `json:"rightsType"`
PaymentTypeName string `json:"paymentTypeName"`
RightsStatusName string `json:"rightsStatusName"`
UpdateTime int64 `json:"updateTime"`
OneTime interface{} `json:"oneTime"`
RefundPaySuccessTime interface{} `json:"refundPaySuccessTime"`
StoreID int64 `json:"storeId"`
OutOrderNo interface{} `json:"outOrderNo"`
HeadStoreID int64 `json:"headStoreId"`
OperatorInfo struct {
OperatorPhone interface{} `json:"operatorPhone"`
OperatorID interface{} `json:"operatorId"`
OperatorName interface{} `json:"operatorName"`
} `json:"operatorInfo"`
CreateTime int64 `json:"createTime"`
OrderRightsSourceName string `json:"orderRightsSourceName"`
OutRemark interface{} `json:"outRemark"`
AutoHandleTime int `json:"autoHandleTime"`
RefusedReason interface{} `json:"refusedReason"`
DefaultAddressType int `json:"defaultAddressType"`
DistributionRightsStatusName interface{} `json:"distributionRightsStatusName"`
FlagContent interface{} `json:"flagContent"`
RefundPaymentInfo struct {
RefundCustomPayMethodID interface{} `json:"refundCustomPayMethodId"`
RefundCustomPayMethodName interface{} `json:"refundCustomPayMethodName"`
RefundPaymentMethodName interface{} `json:"refundPaymentMethodName"`
RefundPaymentType interface{} `json:"refundPaymentType"`
RefundPaymentMethodID interface{} `json:"refundPaymentMethodId"`
} `json:"refundPaymentInfo"`
AmountReturnFailReason interface{} `json:"amountReturnFailReason"`
ConfirmReceivedTime interface{} `json:"confirmReceivedTime"`
} `json:"rightsInfo"`
} `json:"data"`
}
type GetSkuIdRes struct {
GlobalTicket string `json:"globalTicket"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data struct {
SkuVoList []struct {
SingleProductTitle interface{} `json:"singleProductTitle"`
SingleProduct struct {
SingleProductTitle string `json:"singleProductTitle"`
Unit interface{} `json:"unit"`
SingleProductID int64 `json:"singleProductId"`
Num int `json:"num"`
CostPrice interface{} `json:"costPrice"`
SingleProductCode string `json:"singleProductCode"`
UnitID interface{} `json:"unitId"`
SingleProductImageURLList interface{} `json:"singleProductImageUrlList"`
DefaultImageURL string `json:"defaultImageUrl"`
ProductAttribute string `json:"productAttribute"`
} `json:"singleProduct"`
OriginalPrice interface{} `json:"originalPrice"`
ChangeGoodsLimitNum int `json:"changeGoodsLimitNum"`
GoodsID int64 `json:"goodsId"`
SingleProductID int64 `json:"singleProductId"`
OuterSkuCode string `json:"outerSkuCode"`
AvailableStockNum int `json:"availableStockNum"`
ChangeAvailableGoodsLimitNum interface{} `json:"changeAvailableGoodsLimitNum"`
FixedPrice interface{} `json:"fixedPrice"`
SkuAttrMap struct {
} `json:"skuAttrMap"`
SkuAttrKey interface{} `json:"skuAttrKey"`
ActivityPrice interface{} `json:"activityPrice"`
MerchantSalePrice interface{} `json:"merchantSalePrice"`
AdviseSalePriceMax interface{} `json:"adviseSalePriceMax"`
AvailableGoodsLimitNum interface{} `json:"availableGoodsLimitNum"`
IsDeleted bool `json:"isDeleted"`
CombineProductID int64 `json:"combineProductId"`
OuterSkuID interface{} `json:"outerSkuId"`
ImageURL interface{} `json:"imageUrl"`
CombineProduct struct {
SingleProductList []struct {
IsOccupy interface{} `json:"isOccupy"`
SingleProductTitle string `json:"singleProductTitle"`
SingleProductID int64 `json:"singleProductId"`
Num int `json:"num"`
CostPrice interface{} `json:"costPrice"`
SingleProductCode string `json:"singleProductCode"`
Pid interface{} `json:"pid"`
Source int `json:"source"`
AvailableStockNum interface{} `json:"availableStockNum"`
DefaultImageURL string `json:"defaultImageUrl"`
ProductAttribute string `json:"productAttribute"`
UnitType interface{} `json:"unitType"`
Unit interface{} `json:"unit"`
IsDeleted interface{} `json:"isDeleted"`
CreateStoreID interface{} `json:"createStoreId"`
WarehouseStockList []struct {
WarehouseRelationType interface{} `json:"warehouseRelationType"`
AvaliableStockNum interface{} `json:"avaliableStockNum"`
WarehouseID int `json:"warehouseId"`
WarehouseDeliveryType interface{} `json:"warehouseDeliveryType"`
WarehouseInstock bool `json:"warehouseInstock"`
Sort int `json:"sort"`
AvailableStockNum int `json:"availableStockNum"`
WarehouseName interface{} `json:"warehouseName"`
} `json:"warehouseStockList"`
UnitID interface{} `json:"unitId"`
SingleProductImageURLList interface{} `json:"singleProductImageUrlList"`
ImageURLFlag bool `json:"imageUrlFlag"`
ClassifyName interface{} `json:"classifyName"`
} `json:"singleProductList"`
CombineProductID int64 `json:"combineProductId"`
CombineProductTitle string `json:"combineProductTitle"`
CombineProductCode interface{} `json:"combineProductCode"`
} `json:"combineProduct"`
GoodsLimitNum interface{} `json:"goodsLimitNum"`
InStock interface{} `json:"inStock"`
IsDisabled bool `json:"isDisabled"`
DistributorLimitStock interface{} `json:"distributorLimitStock"`
ProductType int `json:"productType"`
SkuID int64 `json:"skuId"`
SkuInfoMap struct {
Num124617560166 int64 `json:"124617560166"`
} `json:"skuInfoMap"`
B2CSku interface{} `json:"b2cSku"`
ChangeStockNum int `json:"changeStockNum"`
SupplierStockMax interface{} `json:"supplierStockMax"`
SalePrice interface{} `json:"salePrice"`
AdviseSalePriceMin interface{} `json:"adviseSalePriceMin"`
SkuAttrValueNameList []string `json:"skuAttrValueNameList"`
CostPrice interface{} `json:"costPrice"`
ProductTitle string `json:"productTitle"`
LockPriceStatus interface{} `json:"lockPriceStatus"`
ProductCode string `json:"productCode"`
BizSkuVo interface{} `json:"bizSkuVo"`
FrontPrice interface{} `json:"frontPrice"`
} `json:"skuVoList"`
} `json:"data"`
}
type WeimobRes struct {
Data struct {
Success bool `json:"success"`
} `json:"data"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
}
type WeimobGoodsDelResult struct {
Code struct {
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data struct {
Result bool `json:"result"`
} `json:"data"`
}
type WeimobGoodsDetialResult struct {
Globalticket string `json:"globalTicket"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data struct {
Goods struct {
Selectedclassifylist interface{} `json:"selectedClassifyList"`
Selectedgoodsattrinfolist interface{} `json:"selectedGoodsAttrInfoList"`
Archivestemplate interface{} `json:"archivesTemplate"`
Selectedgoodsattrlist struct {
} `json:"selectedGoodsAttrList"`
Minsaleprice interface{} `json:"minSalePrice"`
Pointdeductrule interface{} `json:"pointDeductRule"`
Minfrontprice interface{} `json:"minFrontPrice"`
Goodslimitvo interface{} `json:"goodsLimitVo"`
Source int `json:"source"`
Singleordercanbuynum interface{} `json:"singleOrderCanBuyNum"`
Iscansell int `json:"isCanSell"`
Limitbuynum int `json:"limitBuyNum"`
Goodsinvoiceruleinfovo struct {
Taxrate interface{} `json:"taxRate"`
Goodsservicename interface{} `json:"goodsServiceName"`
Invoiceruleid interface{} `json:"invoiceRuleId"`
Goodsid interface{} `json:"goodsId"`
Rulename interface{} `json:"ruleName"`
Taxclassfictioncode interface{} `json:"taxClassFictionCode"`
Taxtype interface{} `json:"taxType"`
} `json:"goodsInvoiceRuleInfoVo"`
Goodsvideoimageurl interface{} `json:"goodsVideoImageUrl"`
Bizgoodsvo interface{} `json:"bizGoodsVo"`
Minfixedprice interface{} `json:"minFixedPrice"`
Goodscertificateurl []string `json:"goodsCertificateUrl"`
Drawgoods interface{} `json:"drawGoods"`
Pointdeductratio int `json:"pointDeductRatio"`
Brand struct {
Trademarkregistrantnewno interface{} `json:"trademarkRegistrantNewNo"`
Trademarkregistrant interface{} `json:"trademarkRegistrant"`
Importedgoodsform interface{} `json:"importedGoodsForm"`
Trademarktype interface{} `json:"trademarkType"`
Trademarkauthorizationperiod interface{} `json:"trademarkAuthorizationPeriod"`
Trademarkchangecertificate interface{} `json:"trademarkChangeCertificate"`
Pid interface{} `json:"pid"`
Storeid interface{} `json:"storeId"`
Title interface{} `json:"title"`
Brandmanagementtype interface{} `json:"brandManagementType"`
Trademarkapplicant interface{} `json:"trademarkApplicant"`
Isdeleted interface{} `json:"isDeleted"`
Trademarkapplicationtime interface{} `json:"trademarkApplicationTime"`
Trademarkregistrationapplication interface{} `json:"trademarkRegistrationApplication"`
Brandaudittype interface{} `json:"brandAuditType"`
ID interface{} `json:"id"`
Saleauthorization interface{} `json:"saleAuthorization"`
Trademarkregistrantno interface{} `json:"trademarkRegistrantNo"`
} `json:"brand"`
Invoicetitle interface{} `json:"invoiceTitle"`
Goodsdesc string `json:"goodsDesc"`
Minactivityprice interface{} `json:"minActivityPrice"`
Skumap struct {
Singlesku struct {
Singleproducttitle interface{} `json:"singleProductTitle"`
Singleproduct struct {
Singleproducttitle string `json:"singleProductTitle"`
Unit interface{} `json:"unit"`
Singleproductid int64 `json:"singleProductId"`
Num int `json:"num"`
Costprice interface{} `json:"costPrice"`
Singleproductcode string `json:"singleProductCode"`
Unitid interface{} `json:"unitId"`
Singleproductimageurllist interface{} `json:"singleProductImageUrlList"`
Defaultimageurl string `json:"defaultImageUrl"`
Productattribute interface{} `json:"productAttribute"`
} `json:"singleProduct"`
Originalprice interface{} `json:"originalPrice"`
Changegoodslimitnum int `json:"changeGoodsLimitNum"`
Goodsid int64 `json:"goodsId"`
Singleproductid int64 `json:"singleProductId"`
Outerskucode string `json:"outerSkuCode"`
Availablestocknum int `json:"availableStockNum"`
Changeavailablegoodslimitnum interface{} `json:"changeAvailableGoodsLimitNum"`
Fixedprice interface{} `json:"fixedPrice"`
Skuattrmap interface{} `json:"skuAttrMap"`
Skuattrkey interface{} `json:"skuAttrKey"`
Activityprice interface{} `json:"activityPrice"`
Merchantsaleprice float64 `json:"merchantSalePrice"`
Advisesalepricemax interface{} `json:"adviseSalePriceMax"`
Availablegoodslimitnum interface{} `json:"availableGoodsLimitNum"`
Isdeleted bool `json:"isDeleted"`
Combineproductid interface{} `json:"combineProductId"`
Outerskuid interface{} `json:"outerSkuId"`
Imageurl interface{} `json:"imageUrl"`
Combineproduct interface{} `json:"combineProduct"`
Goodslimitnum int `json:"goodsLimitNum"`
Instock bool `json:"inStock"`
Isdisabled bool `json:"isDisabled"`
Distributorlimitstock interface{} `json:"distributorLimitStock"`
Producttype int `json:"productType"`
Skuid int64 `json:"skuId"`
Skuinfomap interface{} `json:"skuInfoMap"`
B2Csku struct {
Volume float64 `json:"volume"`
Weight float64 `json:"weight"`
} `json:"b2cSku"`
Changestocknum int `json:"changeStockNum"`
Supplierstockmax interface{} `json:"supplierStockMax"`
Saleprice float64 `json:"salePrice"`
Advisesalepricemin interface{} `json:"adviseSalePriceMin"`
Skuattrvaluenamelist interface{} `json:"skuAttrValueNameList"`
Costprice interface{} `json:"costPrice"`
Producttitle string `json:"productTitle"`
Lockpricestatus int `json:"lockPriceStatus"`
Productcode string `json:"productCode"`
Bizskuvo interface{} `json:"bizSkuVo"`
Frontprice interface{} `json:"frontPrice"`
} `json:"singleSku"`
} `json:"skuMap"`
Goodslimitswitch interface{} `json:"goodsLimitSwitch"`
Sort int `json:"sort"`
Outergoodscode string `json:"outerGoodsCode"`
Defaultimageurl interface{} `json:"defaultImageUrl"`
Maxfixedprice interface{} `json:"maxFixedPrice"`
Salechanneltype int `json:"saleChannelType"`
Startputawaytime interface{} `json:"startPutAwayTime"`
Startselltime interface{} `json:"startSellTime"`
Deductstocktype int `json:"deductStockType"`
Goodsvideourl interface{} `json:"goodsVideoUrl"`
Goodsdetailtemplatevo interface{} `json:"goodsDetailTemplateVo"`
Ismultisku int `json:"isMultiSku"`
Skulist []struct {
Singleproducttitle interface{} `json:"singleProductTitle"`
Singleproduct struct {
Singleproducttitle string `json:"singleProductTitle"`
Unit interface{} `json:"unit"`
Singleproductid int64 `json:"singleProductId"`
Num int `json:"num"`
Costprice interface{} `json:"costPrice"`
Singleproductcode string `json:"singleProductCode"`
Unitid interface{} `json:"unitId"`
Singleproductimageurllist interface{} `json:"singleProductImageUrlList"`
Defaultimageurl string `json:"defaultImageUrl"`
Productattribute interface{} `json:"productAttribute"`
} `json:"singleProduct"`
Originalprice interface{} `json:"originalPrice"`
Changegoodslimitnum int `json:"changeGoodsLimitNum"`
Goodsid int64 `json:"goodsId"`
Singleproductid int64 `json:"singleProductId"`
Outerskucode string `json:"outerSkuCode"`
Availablestocknum int `json:"availableStockNum"`
Changeavailablegoodslimitnum interface{} `json:"changeAvailableGoodsLimitNum"`
Fixedprice interface{} `json:"fixedPrice"`
Skuattrmap interface{} `json:"skuAttrMap"`
Skuattrkey interface{} `json:"skuAttrKey"`
Activityprice interface{} `json:"activityPrice"`
Merchantsaleprice float64 `json:"merchantSalePrice"`
Advisesalepricemax interface{} `json:"adviseSalePriceMax"`
Availablegoodslimitnum interface{} `json:"availableGoodsLimitNum"`
Isdeleted bool `json:"isDeleted"`
Combineproductid interface{} `json:"combineProductId"`
Outerskuid interface{} `json:"outerSkuId"`
Imageurl interface{} `json:"imageUrl"`
Combineproduct interface{} `json:"combineProduct"`
Goodslimitnum int `json:"goodsLimitNum"`
Instock bool `json:"inStock"`
Isdisabled bool `json:"isDisabled"`
Distributorlimitstock interface{} `json:"distributorLimitStock"`
Producttype int `json:"productType"`
Skuid int64 `json:"skuId"`
Skuinfomap interface{} `json:"skuInfoMap"`
B2Csku struct {
Volume float64 `json:"volume"`
Weight float64 `json:"weight"`
} `json:"b2cSku"`
Changestocknum int `json:"changeStockNum"`
Supplierstockmax interface{} `json:"supplierStockMax"`
Saleprice float64 `json:"salePrice"`
Advisesalepricemin interface{} `json:"adviseSalePriceMin"`
Skuattrvaluenamelist interface{} `json:"skuAttrValueNameList"`
Costprice interface{} `json:"costPrice"`
Producttitle string `json:"productTitle"`
Lockpricestatus int `json:"lockPriceStatus"`
Productcode string `json:"productCode"`
Bizskuvo interface{} `json:"bizSkuVo"`
Frontprice interface{} `json:"frontPrice"`
} `json:"skuList"`
Selectedsaleattrinfolist interface{} `json:"selectedSaleAttrInfoList"`
Goodsid int64 `json:"goodsId"`
Presellgoods interface{} `json:"presellGoods"`
Selectedsaleattrlist struct {
} `json:"selectedSaleAttrList"`
Isautocansell int `json:"isAutoCanSell"`
Isputaway int `json:"isPutAway"`
Selectedgoodspropinfolist interface{} `json:"selectedGoodsPropInfoList"`
Maxactivityprice interface{} `json:"maxActivityPrice"`
Availablestocknum interface{} `json:"availableStockNum"`
Title string `json:"title"`
Initialsales int `json:"initialSales"`
Sellmodeltype int `json:"sellModelType"`
Isdeleted bool `json:"isDeleted"`
Categorylist []struct {
Childrencategorylist interface{} `json:"childrenCategoryList"`
Enablecustom interface{} `json:"enableCustom"`
Categorylevel interface{} `json:"categoryLevel"`
Title string `json:"title"`
Isleaf interface{} `json:"isLeaf"`
Categoryid int `json:"categoryId"`
} `json:"categoryList"`
Isstorepresell int `json:"isStorePreSell"`
Sellunitid interface{} `json:"sellUnitId"`
Ismembershipdiscount int `json:"isMemberShipDiscount"`
Selectedtag interface{} `json:"selectedTag"`
Maxfrontprice interface{} `json:"maxFrontPrice"`
Isautoforbidsell interface{} `json:"isAutoForbidSell"`
Ispresell interface{} `json:"isPreSell"`
Barcodematchedlist interface{} `json:"barCodeMatchedList"`
Barcodesinglematched interface{} `json:"barCodeSingleMatched"`
Goodsslogan interface{} `json:"goodsSlogan"`
Isallowoversold interface{} `json:"isAllowOversold"`
Selectedgoodsrightsinfolist interface{} `json:"selectedGoodsRightsInfoList"`
Maxsaleprice interface{} `json:"maxSalePrice"`
Startforbidtime interface{} `json:"startForbidTime"`
Goodsbiztype int `json:"goodsBizType"`
B2Cgoods struct {
Selectedcityfreighttemplate interface{} `json:"selectedCityFreightTemplate"`
Cityfreighttemplateid interface{} `json:"cityFreightTemplateId"`
Freighttemplateid interface{} `json:"freightTemplateId"`
B2Cgoodstype int `json:"b2cGoodsType"`
Selectedfreighttemplate interface{} `json:"selectedFreightTemplate"`
Deliverytypeidlist interface{} `json:"deliveryTypeIdList"`
} `json:"b2cGoods"`
Goodsimageurl []string `json:"goodsImageUrl"`
Goodsextravo struct {
Extrainfotypes interface{} `json:"extraInfoTypes"`
Storefixedprice bool `json:"storeFixedPrice"`
Fixedpricegoodsvo interface{} `json:"fixedPriceGoodsVo"`
} `json:"goodsExtraVo"`
Isassignstore interface{} `json:"isAssignStore"`
Selectedsaleattridlist interface{} `json:"selectedSaleAttrIdList"`
Issupplysource int `json:"isSupplySource"`
Selectedinnergoodspropinfolist interface{} `json:"selectedInnerGoodsPropInfoList"`
Goodscombinationbuyinfo interface{} `json:"goodsCombinationBuyInfo"`
} `json:"goods"`
Pid int64 `json:"pid"`
Storeid int64 `json:"storeId"`
} `json:"data"`
}
type FindFreightTemplateListRes struct {
GlobalTicket string `json:"globalTicket"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data struct {
FreightTemplateList []struct {
IsFree int `json:"isFree"`
TemplateName string `json:"templateName"`
TemplateRuleList []struct {
DeliveryMethodName string `json:"deliveryMethodName"`
TemplateRuleID int `json:"templateRuleId"`
TemplateRuleItemList []struct {
ExtendWeightUnit interface{} `json:"extendWeightUnit"`
UpperWeight interface{} `json:"upperWeight"`
ExtendAmount float64 `json:"extendAmount"`
ExtendVolumeUnit interface{} `json:"extendVolumeUnit"`
IsDefault int `json:"isDefault"`
UpperNum int `json:"upperNum"`
ExtendNumUnit int `json:"extendNumUnit"`
SupportAreaName string `json:"supportAreaName"`
UpperVolume interface{} `json:"upperVolume"`
TemplateRuleItemID int `json:"templateRuleItemId"`
BaseAmount float64 `json:"baseAmount"`
} `json:"templateRuleItemList"`
} `json:"templateRuleList"`
CalculateType int `json:"calculateType"`
TemplateID int `json:"templateId"`
} `json:"freightTemplateList"`
SelectedFreightTemplate interface{} `json:"selectedFreightTemplate"`
DefaultFreightTemplate struct {
IsFree int `json:"isFree"`
TemplateName string `json:"templateName"`
TemplateRuleList []struct {
DeliveryMethodName string `json:"deliveryMethodName"`
TemplateRuleID int `json:"templateRuleId"`
TemplateRuleItemList []struct {
ExtendWeightUnit interface{} `json:"extendWeightUnit"`
UpperWeight interface{} `json:"upperWeight"`
ExtendAmount float64 `json:"extendAmount"`
ExtendVolumeUnit interface{} `json:"extendVolumeUnit"`
IsDefault int `json:"isDefault"`
UpperNum int `json:"upperNum"`
ExtendNumUnit int `json:"extendNumUnit"`
SupportAreaName string `json:"supportAreaName"`
UpperVolume interface{} `json:"upperVolume"`
TemplateRuleItemID int `json:"templateRuleItemId"`
BaseAmount float64 `json:"baseAmount"`
} `json:"templateRuleItemList"`
} `json:"templateRuleList"`
CalculateType int `json:"calculateType"`
TemplateID int `json:"templateId"`
} `json:"defaultFreightTemplate"`
} `json:"data"`
}
type FindDeliveryTypeListRes struct {
GlobalTicket string `json:"globalTicket"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data struct {
DeliveryTypeList []struct {
DeliveryID int `json:"deliveryId"`
DeliveryTypeName string `json:"deliveryTypeName"`
GoodsID interface{} `json:"goodsId"`
DeliveryType int `json:"deliveryType"`
Pid interface{} `json:"pid"`
StoreID int64 `json:"storeId"`
Selected bool `json:"selected"`
} `json:"deliveryTypeList"`
} `json:"data"`
}
type AddAttributeNameRes struct {
GlobalTicket string `json:"globalTicket"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data struct {
AttrID int64 `json:"attrId"`
AttrValueList []struct {
AttrID interface{} `json:"attrId"`
IsCustomDefined interface{} `json:"isCustomDefined"`
ImageURL interface{} `json:"imageUrl"`
Value string `json:"value"`
Key int64 `json:"key"`
} `json:"attrValueList"`
} `json:"data"`
}
type AddAttributeValueRes struct {
GlobalTicket string `json:"globalTicket"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data []struct {
AttrID interface{} `json:"attrId"`
IsCustomDefined interface{} `json:"isCustomDefined"`
ImageURL interface{} `json:"imageUrl"`
Value string `json:"value"`
Key int64 `json:"key"`
} `json:"data"`
}
type CategoryAttrInfoRes struct {
GlobalTicket string `json:"globalTicket"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data struct {
GoodsAttrList []struct {
AttributeID int `json:"attributeId"`
Name string `json:"name"`
AttrValueList []interface{} `json:"attrValueList"`
} `json:"goodsAttrList"`
SaleAttrList []struct {
AttributeID int `json:"attributeId"`
Name string `json:"name"`
AttrValueList []interface{} `json:"attrValueList"`
} `json:"saleAttrList"`
} `json:"data"`
}
type WeimobGoodsResult struct {
Globalticket string `json:"globalTicket"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
Data struct {
Result bool `json:"result"`
Applyid interface{} `json:"applyId"`
Skulist []struct {
Goodsid interface{} `json:"goodsId"`
Validateid interface{} `json:"validateId"`
Imageurl interface{} `json:"imageUrl"`
Outerskucode interface{} `json:"outerSkuCode"`
Storeid interface{} `json:"storeId"`
Title interface{} `json:"title"`
Skuid int64 `json:"skuId"`
} `json:"skuList"`
Distributorid interface{} `json:"distributorId"`
Goodsid int64 `json:"goodsId"`
Notdeldeliverygoodsids interface{} `json:"notDelDeliveryGoodsIds"`
Outergoodsidlist interface{} `json:"outerGoodsIdList"`
Deletedgoodsids interface{} `json:"deletedGoodsIds"`
Distributorresponse interface{} `json:"distributorResponse"`
} `json:"data"`
}
type WeimodOrderListReq struct {
Pagenum int `json:"pageNum"`
Pagesize int `json:"pageSize"`
Queryparameter struct {
Createstarttime int64 `json:"createStartTime"`
Createendtime int64 `json:"createEndTime"`
Updatestarttime int64 `json:"updateStartTime"`
Updateendtime int64 `json:"updateEndTime"`
Orderstatuses []int `json:"orderStatuses"`
Biztypes []int `json:"bizTypes"`
Deliverytypes []int `json:"deliveryTypes"`
} `json:"queryParameter"`
}
type WeimodOrderListRes struct {
Data struct {
Pagelist []struct {
Bizorderid interface{} `json:"bizOrderId"`
Biztype int `json:"bizType"`
Buyerremark string `json:"buyerRemark"`
Channeltype int `json:"channelType"`
Channeltypename string `json:"channelTypeName"`
Confirmreceivedtime interface{} `json:"confirmReceivedTime"`
Createtime int64 `json:"createTime"`
Deliveryamount int `json:"deliveryAmount"`
Deliveryorderid interface{} `json:"deliveryOrderId"`
Deliverytime interface{} `json:"deliveryTime"`
Deliverytype int `json:"deliveryType"`
Deliverytypename string `json:"deliveryTypeName"`
Enabledelivery int `json:"enableDelivery"`
Expectdeliverytime string `json:"expectDeliveryTime"`
Flagcontent interface{} `json:"flagContent"`
Flagrank interface{} `json:"flagRank"`
Goodsamount float64 `json:"goodsAmount"`
Goodspromotioninfo struct {
Cycleorderinfo struct {
Currentcyclenum interface{} `json:"currentCycleNum"`
Cycledeliverytime interface{} `json:"cycleDeliveryTime"`
Cycleitemlist interface{} `json:"cycleItemList"`
Cyclepackagelist interface{} `json:"cyclePackageList"`
Cyclesize interface{} `json:"cycleSize"`
Cycletype interface{} `json:"cycleType"`
Cycletypename interface{} `json:"cycleTypeName"`
Firsttime interface{} `json:"firstTime"`
} `json:"cycleOrderInfo"`
Goodsdistributiontype interface{} `json:"goodsDistributionType"`
Promotiontype int `json:"promotionType"`
} `json:"goodsPromotionInfo"`
Itemlist []struct {
Basediscountinfo struct {
Balancediscountamount interface{} `json:"balanceDiscountAmount"`
Balancediscountdeliveryamount interface{} `json:"balanceDiscountDeliveryAmount"`
Couponcodediscountamount interface{} `json:"couponCodeDiscountAmount"`
Couponcodediscountinfo interface{} `json:"couponCodeDiscountInfo"`
Coupondiscountamount interface{} `json:"couponDiscountAmount"`
Coupondiscountinfo interface{} `json:"couponDiscountInfo"`
Deliveryusedpoints interface{} `json:"deliveryUsedPoints"`
Memberpointsdiscountamount interface{} `json:"memberPointsDiscountAmount"`
Membershipdiscountamount interface{} `json:"membershipDiscountAmount"`
Membershipdiscountinfo interface{} `json:"membershipDiscountInfo"`
Merchantdiscountamount interface{} `json:"merchantDiscountAmount"`
Nynjdiscountamount interface{} `json:"nynjDiscountAmount"`
Pointsdiscountdeliveryamount interface{} `json:"pointsDiscountDeliveryAmount"`
Promotiondiscountamount interface{} `json:"promotionDiscountAmount"`
Usedmemberpoints interface{} `json:"usedMemberPoints"`
} `json:"baseDiscountInfo"`
Bizinfo struct {
Bizid interface{} `json:"bizId"`
Bizorderid interface{} `json:"bizOrderId"`
Biztype interface{} `json:"bizType"`
Subbiztype interface{} `json:"subBizType"`
} `json:"bizInfo"`
Commentstatus interface{} `json:"commentStatus"`
Goodscategoryid interface{} `json:"goodsCategoryId"`
Goodscode interface{} `json:"goodsCode"`
Goodsid int64 `json:"goodsId"`
Goodstitle string `json:"goodsTitle"`
Goodstype int `json:"goodsType"`
Haddeliveryitemnum int `json:"hadDeliveryItemNum"`
ID int `json:"id"`
Imageurl string `json:"imageUrl"`
Originalprice float64 `json:"originalPrice"`
Paymentamount float64 `json:"paymentAmount"`
Point interface{} `json:"point"`
Price float64 `json:"price"`
Rightsorderid interface{} `json:"rightsOrderId"`
Rightsstatus interface{} `json:"rightsStatus"`
Rightsstatusname interface{} `json:"rightsStatusName"`
Shouldpaymentamount interface{} `json:"shouldPaymentAmount"`
Skuamount float64 `json:"skuAmount"`
Skucode interface{} `json:"skuCode"`
Skuid int64 `json:"skuId"`
Skuname interface{} `json:"skuName"`
Skunum int `json:"skuNum"`
Taginfo struct {
Biztaglist interface{} `json:"bizTagList"`
Coupontag interface{} `json:"couponTag"`
Goodsbiztag []interface{} `json:"goodsBizTag"`
Goodsusertag interface{} `json:"goodsUserTag"`
Merchanttag interface{} `json:"merchantTag"`
Usertag interface{} `json:"userTag"`
} `json:"tagInfo"`
Totalamount float64 `json:"totalAmount"`
Totalpoint interface{} `json:"totalPoint"`
} `json:"itemList"`
Orderno int64 `json:"orderNo"`
Orderstatus int `json:"orderStatus"`
Orderstatusname string `json:"orderStatusName"`
Paymentamount float64 `json:"paymentAmount"`
Paymentmethodname string `json:"paymentMethodName"`
Paymentstatus int `json:"paymentStatus"`
Paymenttime interface{} `json:"paymentTime"`
Paymenttype int `json:"paymentType"`
Paymenttypename string `json:"paymentTypeName"`
Pid int64 `json:"pid"`
Processstoreid int `json:"processStoreId"`
Processstoretitle string `json:"processStoreTitle"`
Receiveraddress string `json:"receiverAddress"`
Receiverarea string `json:"receiverArea"`
Receivercity string `json:"receiverCity"`
Receivercounty string `json:"receiverCounty"`
Receivermobile string `json:"receiverMobile"`
Receivername string `json:"receiverName"`
Receiverprovince string `json:"receiverProvince"`
Selfpickupsitename interface{} `json:"selfPickupSiteName"`
Selfpickupstatus interface{} `json:"selfPickupStatus"`
Storeid int `json:"storeId"`
Storetitle string `json:"storeTitle"`
Subbiztype interface{} `json:"subBizType"`
Totalpoint interface{} `json:"totalPoint"`
Transferfailreason interface{} `json:"transferFailReason"`
Transferstatus int `json:"transferStatus"`
Transfertype int `json:"transferType"`
Updatetime int64 `json:"updateTime"`
Usernickname string `json:"userNickname"`
Wid int `json:"wid"`
} `json:"pageList"`
Pagenum int `json:"pageNum"`
Pagesize int `json:"pageSize"`
Totalcount int `json:"totalCount"`
} `json:"data"`
Code struct {
Errcode string `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
}
type Result struct {
Data map[string]interface{} `json:"data"`
Code struct {
Errcode int64 `json:"errcode"`
Errmsg string `json:"errmsg"`
} `json:"code"`
}
package weimob
import (
"encoding/json"
"errors"
)
func (w *weimobConfig) OrderDetial(accesstoken, orderNo string) (res *WeimodOrderDetialRes, err error) {
if len(orderNo) <= 0 {
err = errors.New("订单号错误")
return
}
url := w.ApiUrl + "api/1_0/ec/order/queryOrderDetail?accesstoken=" + accesstoken
body, err := json.Marshal(map[string]string{"orderNo": orderNo})
if err != nil {
return
}
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
//微店取消订单
func (w *weimobConfig) WeimobCancelOrder(accesstoken, orderNo, specificCancelReason, cancelReason string, cancelReasonId int) (res string, err error) {
if len(orderNo) <= 0 {
err = errors.New("订单号错误")
return
}
deliveryParams := map[string]interface{}{
"orderNo": orderNo,
}
if len(specificCancelReason) > 0 {
deliveryParams["specificCancelReason"] = specificCancelReason
}
if len(cancelReason) > 0 {
deliveryParams["cancelReason"] = cancelReason
}
if cancelReasonId > 0 {
deliveryParams["cancelReasonId"] = cancelReasonId
}
url := w.ApiUrl + "api/1_0/ec/order/cancelOrder?accesstoken=" + accesstoken
body, err := json.Marshal(deliveryParams)
if err != nil {
return
}
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
//微店发货接口
func (w *weimobConfig) WeimobLogisticsAddMultiPack(accesstoken string, deliveryParams map[string]interface{}) (res string, err error) {
url := w.ApiUrl + "api/1_0/ec/order/deliveryOrder?accesstoken=" + accesstoken
body, err := json.Marshal(deliveryParams)
if err != nil {
return
}
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
func (w *weimobConfig) OrderList(accesstoken string, order *WeimodOrderListReq) (res *WeimodOrderListRes, err error) {
url := w.ApiUrl + "api/1_0/ec/order/queryOrderList?accesstoken=" + accesstoken
body, err := json.Marshal(order)
if err != nil {
return
}
data := w.PostJSON(url, body)
err = json.Unmarshal([]byte(data), &res)
return
}
package weimob
import (
"bytes"
"encoding/json"
"io/ioutil"
"net/http"
)
type weimobConfig struct {
ApiUrl string
ServerName string
}
var Weimob = weimobConfig{
" you ApiUrl", //无特殊情况为 "https://dopen.weimob.com/",
"you ServerName", //项目名
}
//post json参数
func (w *weimobConfig) PostJSON(url string, data []byte) string {
req, err := http.NewRequest("POST", url, bytes.NewReader(data))
if err != nil {
return ""
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("service_name", w.ServerName)
client := http.Client{}
resp, err := client.Do(req)
if err != nil || resp.StatusCode != 200 {
return ""
}
respBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
return ""
}
return string(respBytes)
}
//Json post
func (w *weimobConfig) DoPost(url string, params map[string]interface{}) string {
data, errp := json.Marshal(params)
if errp != nil {
// logs.Log("POST/PostJSON/ERR", "error", "参数json化错误:【%v】 ", errp)
return ""
}
req, err := http.NewRequest("POST", url, bytes.NewReader(data))
if err != nil {
return ""
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("service_name", w.ServerName)
client := http.Client{}
resp, err := client.Do(req)
if err != nil || resp.StatusCode != 200 {
return ""
}
respBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
return ""
}
return string(respBytes)
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论