483 lines
35 KiB
Go
483 lines
35 KiB
Go
package mtwmapi
|
||
|
||
//#region 买赠活动
|
||
|
||
// BatchCreateBuyGiftsParam 活动创建参数
|
||
type BatchCreateBuyGiftsParam struct {
|
||
AppSpuCode string `json:"app_spu_code"` // APP方商品id
|
||
StartTime int64 `json:"start_time"` // 活动开始时间,传10位秒级的时间戳
|
||
EndTime int64 `json:"end_time"` // 活动结束时间,传10位秒级的时间戳
|
||
GiftsType int `json:"gifts_type"` // 赠品类型。取值范围:0-非本商品非在售商品;1-本商品;2-非本商品在售商品
|
||
GiftsName string `json:"gifts_name,omitempty"` // 为赠品名称
|
||
GiftsAppSpuCode string `json:"gifts_app_spu_code,omitempty"` // 非本商品在售商品id,当gifts_type=2时上传。
|
||
BuyNum int `json:"buy_num"` // 达到送赠品条件的商品购买数量,须上传大于0的正整数
|
||
GiftsNum int `json:"gifts_num"` // 达到购买数量时赠送的赠品数量。须上传大于0的为正整数。例如buy_num=2,gifts_num=3,则代表买2件商品,赠送3件赠品。
|
||
GiftsCharge float64 `json:"gifts_charge"` // 单个赠品的成本,单位是元。此字段信息须大于0,最多支持两位小数。注意,赠品成本为商家成本,不涉及美团成本。
|
||
GiftsDayLimit int `json:"gifts_day_limit"` // 当日活动赠品库存,字段类型int。须上传大于0的正整数或-1,如传-1则表示不限制活动赠品库存。
|
||
}
|
||
|
||
// BatchQueryBuyGiftsAll 活动创建参数
|
||
type BatchQueryBuyGiftsAll struct {
|
||
ItemId int `json:"item_id"` // 活动id
|
||
AppSpuCode string `json:"app_spu_code"` // 活动商品,为APP方商品id,即商家中台系统里商品的编码(spu_code值)。
|
||
AppPoiCode string `json:"app_poi_code"` //
|
||
GiftsType int `json:"gifts_type"` // 赠品类型,参考值:0-非本商品非在售商品;1-本商品;2-非本商品在售商品。
|
||
GiftsName string `json:"gifts_name"` // 赠品名称
|
||
GiftsAppSpuCode string `json:"gifts_app_spu_code"` // 赠品的app_spu_code信息,非活动本商品的店内在售商品。
|
||
StartTime int64 `json:"start_time"` // 开始时间
|
||
EndTime int64 `json:"end_time"` // 结束时间
|
||
BuyNum int `json:"buy_num"` // 达到送赠品条件的商品购买数量
|
||
GiftsNum int `json:"gifts_num"` //
|
||
BuyGiftsNum int `json:"buy_gifts_num"` //
|
||
GiftsCharge float64 `json:"gifts_charge"` //
|
||
GiftsDayLimit int `json:"gifts_day_limit"` // 当日活动赠品库存,为大于0的正整数或-1,如为-1则表示不限制活动赠品库存。
|
||
Status int `json:"status"` // 活动当前的状态,参考值:2-待生效;1-生效;0-过期
|
||
ItemName string `json:"item_name"` // 活动名称
|
||
BuyGiftsModel string `json:"buy_gifts_model"` // 补贴模式,目前仅有“商家进货补贴模式(走结算流程)”模式。
|
||
Charge string `json:"charge"` // 成本相关,单位是元。参数包括: giftsCharge,赠品成本; giftsPoiCharge,商家承担成本; giftsMtCharge,美团承担成本。
|
||
}
|
||
|
||
type GiftsChargeObj struct {
|
||
GiftsPoiCharge string `json:"giftsPoiCharge"` // 商家成本
|
||
GiftsMtCharge int `json:"giftsMtCharge"` // 美团成本
|
||
GiftsCharge string `json:"giftsCharge"` // 赠品成本
|
||
}
|
||
|
||
//#endregion
|
||
|
||
//#region 满减活动
|
||
|
||
// GetDiscountList 获取满减活动列表
|
||
type GetDiscountList struct {
|
||
ActDetails []struct {
|
||
ActId interface{} `json:"act_id"`
|
||
ActPrice float64 `json:"act_price"`
|
||
AppFoodCode interface{} `json:"app_food_code"`
|
||
AppPoiCode interface{} `json:"app_poi_code"`
|
||
AppSpuCode interface{} `json:"app_spu_code"`
|
||
DayLimit interface{} `json:"day_limit"`
|
||
EndTime interface{} `json:"end_time"`
|
||
Name interface{} `json:"name"`
|
||
OrderLimit interface{} `json:"order_limit"`
|
||
OriginPrice float64 `json:"origin_price"`
|
||
Period interface{} `json:"period"`
|
||
StartTime interface{} `json:"start_time"`
|
||
Status interface{} `json:"status"`
|
||
Stock interface{} `json:"stock"`
|
||
UserType interface{} `json:"user_type"`
|
||
WeeksTime interface{} `json:"weeks_time"`
|
||
} `json:"act_details"` // 满减活动详情
|
||
ActInfo struct { // 活动信息,json格式字符串。
|
||
ActIds string `json:"act_ids"`
|
||
ActName string `json:"act_name"`
|
||
ActType interface{} `json:"act_type"`
|
||
AutoDelay interface{} `json:"auto_delay"`
|
||
EndTime int64 `json:"end_time"`
|
||
StartTime int64 `json:"start_time"`
|
||
ExtraInfo struct {
|
||
Offset interface{} `json:"offset"`
|
||
TotalCount interface{} `json:"total_count"`
|
||
Limit interface{} `json:"limit"`
|
||
PageNum interface{} `json:"page_num"`
|
||
TaskId interface{} `json:"task_id"`
|
||
BatchActId int64 `json:"batch_act_id"` // 批次维度活动ID
|
||
SkuExtraInfo []struct {
|
||
AppSpuCode interface{} `json:"app_spu_code"` // 同入参app_spu_code或app_food_code,仅在指定商品满减时返回
|
||
SkuId interface{} `json:"sku_id"` // 同入参sku_id,
|
||
SkuActId interface{} `json:"sku_act_id"` // 商品维度的活动ID
|
||
} `json:"sku_extra_info"` // sku维度活动额外信息,仅在指定商品满减时返回
|
||
PageSize interface{} `json:"page_size"`
|
||
} `json:"extraInfo"`
|
||
Period interface{} `json:"period"`
|
||
Quantity int `json:"quantity"` // 参加指定商品满减活动的商品数,仅适用于指定商品满减活动类型。
|
||
Status int `json:"status"` // 活动状态。(1)指定商品满减活动状态:2-待生效;1-生效;0-过期。(2)全店满减活动状态:0-待生效;1-生效;2-过期。
|
||
WeeksTime interface{} `json:"weeks_time"`
|
||
} `json:"act_info"`
|
||
ActRemark string `json:"act_remark"`
|
||
AppPoiCode string `json:"app_poi_code"`
|
||
}
|
||
|
||
// CreateDiscountList 创建满减活动(门店/商品)
|
||
type CreateDiscountList struct {
|
||
AppPoiCode string `json:"app_poi_code"` // APP方门店id
|
||
ActInfo string `json:"act_info"` // 活动信息 CreateDisCountActInfo
|
||
ActDetails string `json:"act_details"` // 活动详情信息,json格式数组。活动满减不能超过5层阶梯。[CreateDiscountActDetails]
|
||
AppFoods string `json:"app_foods"` // 活动商品信息,为json格式数组,此字段仅用于创建指定商品满减活动时上传 [CreateDiscountAppFoods]
|
||
}
|
||
|
||
type CreateDisCountActInfo struct {
|
||
ActName string `json:"act_name"` // 活动名字
|
||
StartTime int64 `json:"start_time"` // 开始时间
|
||
EndTime int64 `json:"end_time"` // 结束时间
|
||
ActType int `json:"act_type"` // 活动类型,取值范围:0-全店满减;1-指定商品满减。如此字段不传则默认act_type=1,表示指定商品满减类型;act_type=0时,不可以传app_foods字段。
|
||
WeeksTime string `json:"weeks_time"` // 生效活动周期, 1、仅当act_type传0(全店满减)时,支持传本参数; 2、取值范围及意义:1,2,3,4,5,6,7;分别表示周一至周日,多个星期之间用英文逗号分隔; 3、非必传,创建时如不传,则默认周期为"1,2,3,4,5,6,7"。 4、上传的周期相互不能重复
|
||
Period string `json:"period"` // 生效时间段, 1、仅当act_type传0(全店满减)时,支持传本参数; 2、精确到分钟,24小时制,格式为HH:MM-HH:MM,最多支持上传3个时段,多个时段之间用英文逗号分隔; 3、每个时段的开始时间必须小于结束时间。传的多个时段不允许有重叠。 4、上传多个时段时,必须按时间先后顺序进行上传。每个时段最短为30分钟。 5、非必传,创建时如不传则默认时段为"00:00:-23:59"。
|
||
AutoDelay int `json:"auto_delay"` // 每次活动到期后自动延期30天,传1表示开启。 1、仅当act_type传0(全店满减)时,支持传本参数。 2、仅支持传1,表示开启,每当活动到期时自动延期30天。 3、非必传,创建活动时如不传则为关闭状态,不自动延期。
|
||
}
|
||
|
||
type CreateDiscountActDetails struct {
|
||
OriginPrice int `json:"origin_price"` // 表示满的金额
|
||
ActPrice int `json:"act_price"` // 表示减的金额
|
||
}
|
||
|
||
type CreateDiscountAppFoods struct {
|
||
AppSpuCode string `json:"app_spu_code"` // PP方商品id,即商家中台系统里商品的编码
|
||
DayLimit int `json:"day_limit"` // 当日活动商品库存,仅支持上传大于0的整数或-1,如传-1时则表示不限制商品活动库存。
|
||
}
|
||
|
||
// CreateDiscountResult 创建满减活动返回值结构
|
||
type CreateDiscountResult struct {
|
||
Data string `json:"data"` // ok
|
||
SuccessMsg string `json:"success_msg"` // 活动ID
|
||
ExtraInfo []DiscountData `json:"extra_info"` //
|
||
ResultCode int `json:"result_code"` // 1-全部操作成功,查询到的数据在data字段中;2-部分成功,成功的数据存储在data字段中,失败的数据存在error_list字段中;3-全部操作失败,失败的数据存在error_list字段中;4-请求失败,一般为签名或限流问题,关注error字段中的具体描述即可
|
||
SuccessMap []DiscountData `json:"success_map"` // 成功的集合信息
|
||
}
|
||
|
||
type DiscountData struct {
|
||
TaskId string `json:"task_id"` // 当商家使用异步排队方式请求接口时返回,商家可使用任务id查询任务进度
|
||
TaskDetailLink string `json:"task_detail_link"` // 创建异步排队任务成功,返回任务详情链接,通过浏览器打开链接查看任务处理结果
|
||
BatchActId string `json:"batch_act_id"` // 批次维度活动ID,
|
||
SkuExtraInfo []struct {
|
||
SkuActId int64 // 商品维度的活动ID
|
||
AppSpuCode string // 同入参app_spu_code
|
||
SkuId string // 同入参sku_id
|
||
} `json:"sku_extra_info"` // sku维度活动额外信息,仅在创建成功时返回,仅在指定商品满减时返回
|
||
}
|
||
|
||
//#endregion
|
||
|
||
//#region 运费满减活动
|
||
|
||
// ShippingFeeResult 满减运费活动配置
|
||
type ShippingFeeResult struct {
|
||
ResultCode int `json:"result_code"` // 返回状态码
|
||
SuccessList []ShippingFeeDetail `json:"success_list"` // 成功上数据列表
|
||
Data []ShippingFeeDetail `json:"data"` // 好像是所有的数据列表
|
||
}
|
||
|
||
// ShippingFeeDetail 运费活动返回详情值
|
||
type ShippingFeeDetail struct {
|
||
AppPoiCode string `json:"app_poi_code"` // 门店code
|
||
ActId int `json:"act_id"` // 活动ID
|
||
StartTime int `json:"start_time"` // 开始时间
|
||
EndTime int `json:"end_time"` // 结束时间
|
||
WeeksTime string `json:"weeks_time"` // 活动周期(周一-周末)
|
||
Period string `json:"period"` // 生效时间段,多个时段以英文逗号分隔;如创建活动时此字段未填写,则默认时段为"00:00:-23:59"。
|
||
ActDetail []struct {
|
||
LimitPrice float64 `json:"limit_price"` // 满减门槛
|
||
DiscountPrice float64 `json:"discount_price"` // 减配送费
|
||
PoiCharge float64 `json:"poi_charge"` // 门店承担费用
|
||
MtCharge float64 `json:"mt_charge"` // 美团承担费用
|
||
} `json:"act_detail"` // 活动详情
|
||
MaxPrice float64 `json:"max_price"` // 免配送费门槛
|
||
ActStatus string `json:"actStatus"` // 活动状态:NOT_START=待生效;IN_PROGRESS=已生效;EXPIRED=已过期;APPROVE=待审批;FREEZE=冻结中。
|
||
}
|
||
|
||
// ShippingFeeBatchCreate 批量创建阶梯满减活动
|
||
type ShippingFeeBatchCreate struct {
|
||
AppPoiCode string `json:"app_poi_code"` // 门店code
|
||
ActData string `json:"act_data"` // 门店满减运费活动信息,json格式数组。(1)同一门店同一时间仅允许参加一个活动。(2)同一门店的生效中+待生效活动最多支持20组。
|
||
}
|
||
|
||
// ShippingFeeBatchCreateActData 活动详情
|
||
type ShippingFeeBatchCreateActData struct {
|
||
StartTime int `json:"start_time"` // 开始时间
|
||
EndTime int `json:"end_time"` // 结束时间
|
||
WeeksTime string `json:"weeks_time"` // 活动周期(周一-周末)
|
||
Period string `json:"period"` // 生效时间段,多个时段以英文逗号分隔;如创建活动时此字段未填写,则默认时段为"00:00:-23:59"。
|
||
MaxPrice float64 `json:"max_price"` // 免配送费门槛
|
||
ActDetail []ShippingFeeBatchCreateActDataActDetail `json:"act_detail"` // 活动详情
|
||
}
|
||
|
||
type ShippingFeeBatchCreateActDataActDetail struct {
|
||
LimitPrice float64 `json:"limit_price"` // 满减门槛
|
||
DiscountPrice float64 `json:"discount_price"` // 减配送费
|
||
}
|
||
|
||
// ShippingResultData 运费满减活动创建返回值
|
||
type ShippingResultData struct {
|
||
ResultCode int `json:"result_code"` // 返回状态码
|
||
SuccessList []ShippingFeeDetail `json:"success_list"` // 成功上数据列表
|
||
SuccessMsg []ShippingFeeDetail `json:"success_msg"` // 好像是所有的数据列表
|
||
Data string `json:"data"`
|
||
Msg string `json:"msg"`
|
||
}
|
||
|
||
//#endregion
|
||
|
||
//#region 创建X元M件活动
|
||
|
||
// CreateBundlesActParam 创建X件优惠活动
|
||
type CreateBundlesActParam struct {
|
||
ActId int64 `json:"act_id"` // 更新时填写,活动ID
|
||
// 创建时填写
|
||
ActName string `json:"act_name"` // 活动名称
|
||
StartTime int `json:"start_time"` // 开始时间
|
||
EndTime int `json:"end_time"` // 结束时间
|
||
ActPrice float64 `json:"act_price"` // 活动价格
|
||
ActNum int `json:"act_num"` // 活动数量(表示“X元M件”中的M)
|
||
AppFoods []struct {
|
||
AppSpuCode string `json:"app_spu_code"` // 传APP方商品id
|
||
DayLimit int `json:"day_limit"` // 商品当日活动库存,须传大于0的整数或-1,如传-1则表示不限制商品活动库存。
|
||
} `json:"app_foods"` // 参加活动的商品信息
|
||
}
|
||
|
||
// BundlesSuccessListDetail 创建X件优惠活动返回值
|
||
type BundlesSuccessListDetail struct {
|
||
ActId int64 `json:"act_id"` // 活动id
|
||
BatchActId int64 `json:"batch_act_id"` // 批次维度活动ID
|
||
ActDetails []struct {
|
||
Discount float64 `json:"discount"` // 活动折扣,表示“X件Y折”中的Y折
|
||
ActNum int `json:"act_num"` // 活动数量,表示“X件Y折”中的X件
|
||
} `json:"act_details"` // 活动优惠信息,最多返回3个阶梯(只有X件Y折返回该信息)
|
||
ExtraInfo struct {
|
||
BatchActId int64 `json:"batch_act_id"` // 批次维度活动ID
|
||
SkuExtraInfo []struct {
|
||
SkuActId int64 `json:"sku_act_id"` // 商品维度的活动ID,该ID是对act_id的补全
|
||
AppSpuCode string `json:"app_spu_code"` // 活动商品,传APP方商品id,即商家中台系统里商品的编码(spu_code值)。
|
||
SkuId string `json:"sku_id"` // 商品规格id,本接口暂未支持多规格商品创建活动,均返回null
|
||
}
|
||
} `json:"extraInfo"` // 活动额外信息,包括批次和商品维度活动id(X件Y折不返回该信息)
|
||
ActName string `json:"act_name"` // 活动名称
|
||
StartTime int `json:"start_time"` // 开始时间
|
||
EndTime int `json:"end_time"` // 结束时间
|
||
ActRemark string `json:"act_remark"` //活动文案
|
||
}
|
||
|
||
// BundlesSkuSuccessListDetail 查询X件商品优惠活动商品信息返回值
|
||
type BundlesSkuSuccessListDetail struct {
|
||
AppSpuCode string `json:"app_spu_code"` // 活动商品,传APP方商品id,即商家中台系统里商品的编码(spu_code值)。
|
||
SkuId string `json:"sku_id"` // 商品规格id,本接口暂未支持多规格商品创建活动,均返回null
|
||
DayLimit int `json:"day_limit"` // 商品当日活动库存,须为大于0的整数或-1,如传-1则表示不限制。
|
||
}
|
||
|
||
//#endregion
|
||
|
||
//#region 加价购活动
|
||
|
||
// RepurchaseCreate 创建门店加价购活动
|
||
type RepurchaseCreate struct {
|
||
// 修改时填写
|
||
ActId int64 `json:"act_id"` // 活动ID
|
||
|
||
// 创建时填写
|
||
ActName string `json:"act_name"` // 活动名称
|
||
StartTime int `json:"start_time"` // 开始时间
|
||
EndTime int `json:"end_time"` // 结束时间
|
||
ActPrice float64 `json:"act_price"` // 换购门槛,表示可参加本次换购活动的订单金额门店(不包含运费),
|
||
ActRemark string `json:"actRemark"` // 加价换购活动描述
|
||
AppFoods []RepurchaseCreateAppFoods `json:"app_foods"` // 参加换购的活动商品数据
|
||
}
|
||
|
||
type RepurchaseCreateAppFoods struct {
|
||
AppSpuCode string `json:"app_spu_code"` // 活动商品,传APP方商品id
|
||
ActPrice float64 `json:"act_price"` // 活动价(单价),表示换购一件此商品需额外支付的价格,单位元;活动价不能大于商品原价
|
||
DayLimit int `json:"day_limit"` // 商品当日活动库存,须为大于0的整数或-1,如传-1则表示不限制。
|
||
}
|
||
|
||
type RepurchaseCreateResult struct {
|
||
SkuActId string `json:"sku_act_id"` // 商品维度的活动ID,该ID是对act_id的补全
|
||
AppSpuCode string `json:"app_spu_code"` // 同入参app_spu_code
|
||
SkuId string `json:"sku_id"` // 商品规格id,本接口暂未支持多规格商品创建活动,均返回null
|
||
}
|
||
|
||
// RepurchaseResult 获取门店加价购活动返回值
|
||
type RepurchaseResult struct {
|
||
ActId int64 `json:"act_id"` // 活动ID
|
||
ActName string `json:"act_name"` // 活动名称
|
||
StartTime int `json:"start_time"` // 开始时间
|
||
EndTime int `json:"end_time"` // 结束时间
|
||
ActPrice float64 `json:"act_price"` // 换购门槛,表示可参加本次换购活动的订单金额门店(不包含运费),
|
||
ActRemark string `json:"actRemark"` // 加价换购活动描述
|
||
OrderLimitTotal int `json:"order_limit_total"` // 每单可换购的商品总数,为大于0的整数或-1,如为-1则表示不限制。
|
||
ExtraInfo struct {
|
||
BatchActId int64 `json:"batch_act_id"` // 批次维度活动ID
|
||
SkuExtraInfo []struct {
|
||
SkuActId int64 `json:"sku_act_id"` // 商品维度的活动ID
|
||
AppSpuCode string `json:"app_spu_code"` // 活动商品,传APP方商品id
|
||
SkuId interface{} `json:"sku_id"` // 商品规格id,本接口暂未支持多规格商品创建活动,均返回nu
|
||
} `json:"sku_extra_info"` // sku维度活动额外信息
|
||
} `json:"extraInfo"` // 活动额外信息,包括批次和商品维度活动id
|
||
}
|
||
|
||
//#endregion
|
||
|
||
//#region 商品券活动
|
||
|
||
// CreateCouponAct 创建门店优惠券活动
|
||
type CreateCouponAct struct {
|
||
AppPoiCodes string `json:"app_poi_codes"` // 可使用券的门店id列表,多个用英文逗号分隔
|
||
CouponName string `json:"coupon_name"` // 券名称,不能超过12个字符,仅支持汉字、数字和字母。
|
||
IsSinglePoi int `json:"is_single_poi"` // 券使用范围是否限制单门店,取值范围:0-门店通用券;1-单门店券。(1)门店通用券:如app_poi_codes字段传的门店ABC,则A门店领,ABC门店通用。(2)单门店券:A门店领,仅A门店用。
|
||
AppSpuCodes string `json:"app_spu_codes"` // 参加活动的商品,传APP方商品id,即商家中台系统里商品的编码(spu_code值)。(1)如不同门店内同一商品的app_spu_code不同,则视为不同商品,多个商品id用英文逗号分隔。(2)当创建按折扣的商品券活动且discount=0时,本参数仅支持传一个参加活动的商品
|
||
SpuData []CreateCouponActSpuData `json:"spu_data"` // 创建商品券活动支持按照sku维度创建,传入spu_data字段。若同时传入spu_data和app_spu_code字段,默认以spu_data数据为准进行创建商品券
|
||
TakeCouponStartTime int64 `json:"take_coupon_start_time"` // 领券开始时间,传10位秒级的时间戳。
|
||
TakeCouponEndTime int64 `json:"take_coupon_end_time"` // 领券结束时间,传10位秒级的时间戳。
|
||
UseCouponStartTime int64 `json:"use_coupon_start_time"` // 用券开始时间,传10位秒级的时间戳。
|
||
CouponLimitCount int64 `json:"coupon_limit_count"` // 活动期间每个用户领券的最大数量限制,范围1~99999999的整数。
|
||
Type int `json:"type"` // 商品券类型,取值范围:1-按活动价格;2-按折扣。
|
||
ActPriceCouponInfo []GetStoreCouponActSuccessListActPriceCouponInfo `json:"act_price_coupon_info"` // 按活动价格的商品券信息,json格式数组。按活动价格的商品券活动最多支持设置三层优惠。
|
||
DiscountCouponInfo []GetStoreCouponActSuccessListDiscountCouponInfo `json:"discount_coupon_info"` // 按折扣的商品券信息,json格式数组。(1)当discount大于0时,折扣商品券活动的优惠信息不能超过三层。(2)当discount等于0时,为商品兑换券活动,仅支持设置一层。
|
||
}
|
||
|
||
// CreateCouponActSpuData SpuData参数
|
||
type CreateCouponActSpuData struct {
|
||
AppSpuCode string `json:"app_spu_code"` // APP方商品id
|
||
SkuId string `json:"sku_id"` // 是sku唯一标识码,字段信息限定长度不能超过40个字符。不允许上传emoji等表情符。
|
||
Upc string `json:"upc"` // upc
|
||
}
|
||
|
||
//// CreateActPriceCouponInfo ActPriceCouponInfo 参数
|
||
//type CreateActPriceCouponInfo struct {
|
||
// FullPrice int `json:"full_price"` // 券使用门槛金额,范围是1~999的正整数,单位元。
|
||
// ReducePrice int `json:"reduce_price"` // 券金额,范围是1~999的正整数,单位元;表示达到使用门槛后可以减的金额
|
||
// Stock int `json:"stock"` // 券库存,范围1-99999的正整数。(1)当选择单门店券时(is_single_poi=1),该库存指的是每门店的券库存。(2) 当选择门店通用券时(is_single_poi=0),该库存指的是所有门店共享的券库存
|
||
// UseType int `json:"user_type"` // 可领券的用户,取值范围:0-新客&老客;1-门店联合新客(原新客,全部可用门店为新客);2-老客; 7-门店新客(当前门店为新客)。如不传此字段,则默认为0。
|
||
//}
|
||
//
|
||
//// CreateDiscountCouponInfo DiscountCouponInfo 参数
|
||
//type CreateDiscountCouponInfo struct {
|
||
// FullPrice int `json:"full_price"` // 券使用门槛金额,范围是1~999的正整数,单位元。
|
||
// Discount float64 `json:"discount"` // 折扣系数,需大于0且小于10,最多一位小数;或传0,表示兑换券。当discount=0时,则此活动为无门槛商品兑换券活动;此时app_spu_codes字段上传的商品数不能大于1个,且该商品不可再参加其他优惠活动。
|
||
// MaxReducePrice int64 `json:"max_reduce_price"`
|
||
// Stock int `json:"stock"` // 券库存,范围1-99999的正整数。(1)当选择单门店券时(is_single_poi=1),该库存指的是每门店的券库存。(2) 当选择门店通用券时(is_single_poi=0),该库存指的是所有门店共享的券库存
|
||
// UseType int `json:"user_type"` // 可领券的用户,取值范围:0-新客&老客;1-门店联合新客(原新客,全部可用门店为新客);2-老客; 7-门店新客(当前门店为新客)。如不传此字段,则默认为0。
|
||
//}
|
||
|
||
// CreateStoreCouponActResult 获取门店优惠券活动
|
||
type CreateStoreCouponActResult struct {
|
||
AppPoiCodes []string `json:"app_poi_codes"` // 门店ID列表
|
||
AppSpuCodes []string `json:"app_spu_codes"` // 成功商品列表
|
||
UpcList []string `json:"upc_list"` // 成功商品upc列表
|
||
ActId int64 `json:"act_id"` // 活动ID
|
||
}
|
||
|
||
// GetStoreCouponActParam 获取门店商品券活动
|
||
type GetStoreCouponActParam struct {
|
||
AppPoiCode string `json:"app_poi_code"` // 门店ID
|
||
ActStatus int `json:"act_status"` // 活动当前状态,取值范围:-1-全部;0-未生效;1-已生效;2-已结束。
|
||
StartTime int64 `json:"start_time"` // 开始时间
|
||
EndTime int64 `json:"end_time"` // 结束时间
|
||
PageNum int `json:"page_num"` // 页码
|
||
PageSize int `json:"page_size"` // 页数
|
||
}
|
||
|
||
// GetStoreCouponActSuccessList 获取门店优惠券返回列表
|
||
type GetStoreCouponActSuccessList struct {
|
||
ActId int64 `json:"actId"` // 活动id
|
||
AppPoiCodes string `json:"app_poi_codes"` // 可使用券的门店列表
|
||
CouponName string `json:"coupon_name"` // 券名称
|
||
IsSinglePoi int `json:"is_single_poi"` // 券使用范围是否限制单门店,参考值:0-门店通用券;1-单门店券。(1)门店通用券:如app_poi_codes字段传的门店ABC,则A门店领,ABC门店通用。(2)单门店券:A门店领,仅A门店用。
|
||
TakeCouponStartTime int64 `json:"take_coupon_start_time"` // 领券开始时间
|
||
TakeCouponEndTime int64 `json:"take_coupon_end_time"` // 领券结束时间
|
||
UseCouponStartTime int64 `json:"use_coupon_start_time"` // 用券开始时间
|
||
CouponLimitCount int64 `json:"coupon_limit_count"` // 活动期间每个用户领券的最大数量限制,范围1~99999999的整数
|
||
Type int64 `json:"type"` // 商品券类型,参考值:1-按活动价格;2-按折扣。
|
||
//ActPriceCouponInfo []interface{} `json:"act_price_coupon_info"` // 按活动价格的商品券信息,json格式数组。按活动价格的商品券活动最多支持设置三层优惠
|
||
ActPriceCouponInfo []GetStoreCouponActSuccessListActPriceCouponInfo `json:"-"`
|
||
//DiscountCouponInfo []interface{} `json:"discount_coupon_info"` // 按折扣的商品券信息,json格式数组。(1)当discount大于0时,为折扣商品券活动,优惠信息最多三层。(2)当discount等于0时,为商品兑换券活动,优惠信息仅一层
|
||
DiscountCouponInfo []GetStoreCouponActSuccessListDiscountCouponInfo `json:"-"`
|
||
}
|
||
|
||
// GetStoreCouponActSuccessListActPriceCouponInfo ActPriceCouponInfo数据
|
||
type GetStoreCouponActSuccessListActPriceCouponInfo struct {
|
||
FullPrice int `json:"full_price"` // 券使用门槛金额,范围是1~999的正整数,单位元。
|
||
ReducePrice int `json:"reduce_price"` // 券金额,范围是1~999的正整数,单位元;表示达到使用门槛后可以减的金额。
|
||
Stock int `json:"stock"` // 券库存,范围1-99999的正整数。(1)当选择单门店券时(is_single_poi=1),该库存指的是每门店的券库存。(2) 当选择门店通用券时(is_single_poi=0),该库存指的是所有门店共享的券库存。
|
||
UserType int `json:"user_type"` // 可领券的用户,取值范围:null或0-新客&老客;1-门店联合新客(原新客,全部可用门店为新客);2-老客; 7-门店新客(当前门店为新客)。
|
||
}
|
||
|
||
// GetStoreCouponActSuccessListDiscountCouponInfo DiscountCouponInfo
|
||
type GetStoreCouponActSuccessListDiscountCouponInfo struct {
|
||
FullPrice int `json:"full_price"` // 券使用门槛金额,范围是1~999的正整数,单位元。
|
||
Discount float64 `json:"discount"` // 折扣系数,范围0-10之间,最多一位小数;或为0,表示无门槛商品兑换券活
|
||
MaxReducePrice int `json:"max_reduce_price"` // 券最高可减金额,单位元。(1)当discount大于0时,为折扣商品券活动,优惠信息最多三层。(2)当discount等于0时,为商品兑换券活动,不支持设置最高可减金额,max_reduce_price默认为0。
|
||
Stock int `json:"stock"` // 券库存,范围1-99999的正整数。(1)当选择单门店券时(is_single_poi=1),该库存指的是每门店的券库存。(2) 当选择门店通用券时(is_single_poi=0),该库存指的是所有门店共享的券库存。
|
||
UserType int `json:"user_type"` // 可领券的用户,取值范围:null或0-新客&老客;1-门店联合新客(原新客,全部可用门店为新客);2-老客; 7-门店新客(当前门店为新客)。
|
||
}
|
||
|
||
// CouponActSkuListSuccessList 获取商品券活动商品列表
|
||
type CouponActSkuListSuccessList struct {
|
||
ActId int `json:"actId"` // 活动ID
|
||
AppPoiCodes string `json:"app_poi_codes"` // 门店ID
|
||
CouponName string `json:"coupon_name"` // 活动名称
|
||
IsSinglePoi int `json:"is_single_poi"` // 券使用范围是否限制单门店,参考值:0-门店通用券;1-单门店券。(1)门店通用券:如app_poi_codes字段传的门店ABC,则A门店领,ABC门店通用。(2)单门店券:A门店领,仅A门店用。
|
||
AppSpuCodes string `json:"app_spu_codes"` // 商品ID
|
||
TakeCouponStartTime int64 `json:"take_coupon_start_time"` // 领券开始时间
|
||
TakeCouponEndTime int64 `json:"take_coupon_end_time"` // 领券结束时间
|
||
UseCouponStartTime int64 `json:"use_coupon_start_time"` // 使用开始时间
|
||
CouponLimitCount int64 `json:"coupon_limit_count"` // 用户领券最大数
|
||
Type int `json:"type"` // 商品券类型,参考值:1-按活动价格;2-按折扣。
|
||
ActPriceCouponInfo []GetStoreCouponActSuccessListActPriceCouponInfo `json:"act_price_coupon_info"` // 按活动价格的商品券信息,json格式数组。按活动价格的商品券活动最多支持设置三层优惠。
|
||
DiscountCouponInfo []GetStoreCouponActSuccessListDiscountCouponInfo `json:"discount_coupon_info"` // 按折扣的商品券信息,json格式数组。(1)当discount大于0时,为折扣商品券活动,优惠信息最多三层。(2)当discount等于0时,为商品兑换券活动,优惠信息仅一层。
|
||
|
||
ActStatus int `json:"act_status"`
|
||
AppFoodCodes string `json:"app_food_codes"`
|
||
CouponRetailType int `json:"coupon_retail_type"`
|
||
IsShare int `json:"is_share"`
|
||
SpuData []struct {
|
||
AppSpuCode string `json:"app_spu_code"`
|
||
SkuId string `json:"sku_id"`
|
||
Upc string `json:"upc"`
|
||
} `json:"spu_data"`
|
||
UseCouponEndTime int `json:"use_coupon_end_time"`
|
||
ValidityDays int `json:"validity_days"`
|
||
}
|
||
|
||
//#endregion
|
||
|
||
//#region 第X件优惠活动
|
||
|
||
// GetStoreXDiscountSuccessList 第X件优惠返回值
|
||
type GetStoreXDiscountSuccessList struct {
|
||
ActId int64 `json:"act_id"`
|
||
BatchActId string `json:"batch_act_id"` // 批次维度活动ID,
|
||
StartTime int64 `json:"start_time"` // 开始时间
|
||
EndTime int64 `json:"end_time"` // 结束时间
|
||
ActName string `json:"act_name"` // 活动名字
|
||
ActSettingType int `json:"act_setting_type"` // 1)字段描述:活动子类型选择。 2)取值范围:0-第N件X折;1-第N件X元。 3)活动信息的字段规则根据此字段而变化
|
||
ActDetails []GetStoreXDiscountSuccessListActDetails `json:"act_details"` // 1)字段描述:活动具体信息。 2)至少有一阶,最多三阶。
|
||
ExtraInfo GetStoreXDiscountSuccessListExtraInfo `json:"extra_info"`
|
||
}
|
||
|
||
// GetStoreXDiscountSuccessListActDetails ActDetails
|
||
type GetStoreXDiscountSuccessListActDetails struct {
|
||
Price string `json:"price"` // 1)字段描述:活动商品售价 2)取值范围:0≤X,最多支持两位小数。 3)此范围当“活动子类型”为1时有效
|
||
Discount string `json:"discount"` // 1)字段描述:活动商品折扣系数。 2)取值范围:0≤X≤9.99,最多支持两位小数。 3)此范围当“活动子类型”为0时有效
|
||
Index int `json:"index"` // 1)字段描述:活动商品件数。 2)取值范围:N:1≤N≤5
|
||
}
|
||
|
||
// GetStoreXDiscountSuccessListExtraInfo ExtraInfo
|
||
type GetStoreXDiscountSuccessListExtraInfo struct {
|
||
BatchActId int64 `json:"batch_act_id"` // 批次维度活动ID
|
||
SkuExtraInfo []struct {
|
||
SkuActId int64 `json:"sku_act_id"` // 商品维度的活动ID,该ID是对act_id的补全
|
||
AppSpuCode string `json:"app_spu_code"` // 同入参app_spu_code
|
||
SkuId string `json:"sku_id"` // 商品规格id,本接口暂未支持多规格商品创建活动,均返回null
|
||
} `json:"sku_extra_info"` // sku维度活动额外信息
|
||
}
|
||
|
||
// CreateStoreXDiscountParam 创建地X件优惠活动
|
||
type CreateStoreXDiscountParam struct {
|
||
ActId int64 `json:"act_id"`
|
||
ActName string `json:"act_name"` // 活动名字
|
||
StartTime int64 `json:"start_time"` // 开始时间
|
||
EndTime int64 `json:"end_time"` // 结束时间
|
||
ActSettingType int `json:"act_setting_type"` // 1)字段描述:活动子类型选择。 2)取值范围:0-第N件X折;1-第N件X元。 3)活动信息的字段规则根据此字段而变化
|
||
ActDetails []GetStoreXDiscountSuccessListActDetails `json:"act_details"` // 1)字段描述:活动具体信息。 2)至少有一阶,最多三阶。
|
||
ActProducts []struct {
|
||
AppSpuCode string `json:"app_spu_code"` // (原app_food_code字段) 1)字段描述:活动商品编码。 2)选择第N件X元时,所选商品原价必须大于活动价X。 3)仅支持单规格商品参加活动 4)商品原价乘活动件数必须大于活动价。 5)如填写了活动id,输入未在活动中存在的app_spu_code,默认为在该活动中新增参加活动的商品。 6)如填写了活动id,输入已在活动中存在的app_spu_code,则认为更新此活动中该商品库存信息。
|
||
DayLimit int `json:"day_limit"` // 1)字段描述:活动商品当日库存。 2)格式:正整数,不大于999999999。 3)如当日库存为无限,则传-1。
|
||
} `json:"act_products"`
|
||
}
|
||
|
||
// CreateStoreXDiscountResult 创建X件优惠返回值
|
||
type CreateStoreXDiscountResult struct {
|
||
SkuActId int64 `json:"sku_act_id"` // 商品维度的活动ID,该ID是对act_id的补全
|
||
AppSpuCode string `json:"app_spu_code"` // 同入参app_spu_code
|
||
SkuId string `json:"sku_id"` // 商品规格id,本接口暂未支持多规格商品创建活动,均返回null
|
||
}
|
||
|
||
//#endregion
|