Documentation ¶
Overview ¶
Package product 微信小店/商品管理
Index ¶
- func Create(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func Del(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func Get(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func GetByStatus(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func GetProperty(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func GetSku(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func GetSub(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func ModProductStatus(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func Update(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
增加商品
See: https://developers.weixin.qq.com/doc/offiaccount/Instant_Stores/WeChat_Store_Interface.html
POST https://api.weixin.qq.com/merchant/create?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/store/product" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := product.Create(ctx, payload) fmt.Println(resp, err) }
Output:
func Del ¶
func Del(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
删除商品
See: https://developers.weixin.qq.com/doc/offiaccount/Instant_Stores/WeChat_Store_Interface.html
POST https://api.weixin.qq.com/merchant/del?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/store/product" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := product.Del(ctx, payload) fmt.Println(resp, err) }
Output:
func Get ¶
func Get(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
查询商品
See: https://developers.weixin.qq.com/doc/offiaccount/Instant_Stores/WeChat_Store_Interface.html
POST https://api.weixin.qq.com/merchant/get?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/store/product" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := product.Get(ctx, payload) fmt.Println(resp, err) }
Output:
func GetByStatus ¶
func GetByStatus(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
获取指定状态的所有商品
See: https://developers.weixin.qq.com/doc/offiaccount/Instant_Stores/WeChat_Store_Interface.html
POST https://api.weixin.qq.com/merchant/getbystatus?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/store/product" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := product.GetByStatus(ctx, payload) fmt.Println(resp, err) }
Output:
func GetProperty ¶
func GetProperty(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
获取指定分类的所有属性
See: https://developers.weixin.qq.com/doc/offiaccount/Instant_Stores/WeChat_Store_Interface.html
POST https://api.weixin.qq.com/merchant/category/getproperty?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/store/product" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := product.GetProperty(ctx, payload) fmt.Println(resp, err) }
Output:
func GetSku ¶
func GetSku(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
获取指定子分类的所有SKU
See: https://developers.weixin.qq.com/doc/offiaccount/Instant_Stores/WeChat_Store_Interface.html
POST https://api.weixin.qq.com/merchant/category/getsku?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/store/product" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := product.GetSku(ctx, payload) fmt.Println(resp, err) }
Output:
func GetSub ¶
func GetSub(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
获取指定分类的所有子分类
See: https://developers.weixin.qq.com/doc/offiaccount/Instant_Stores/WeChat_Store_Interface.html
POST https://api.weixin.qq.com/merchant/category/getsub?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/store/product" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := product.GetSub(ctx, payload) fmt.Println(resp, err) }
Output:
func ModProductStatus ¶
func ModProductStatus(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
商品上下架
See: https://developers.weixin.qq.com/doc/offiaccount/Instant_Stores/WeChat_Store_Interface.html
POST https://api.weixin.qq.com/merchant/modproductstatus?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/store/product" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := product.ModProductStatus(ctx, payload) fmt.Println(resp, err) }
Output:
func Update ¶
func Update(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
修改商品
See: https://developers.weixin.qq.com/doc/offiaccount/Instant_Stores/WeChat_Store_Interface.html
POST https://api.weixin.qq.com/merchant/update?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/store/product" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := product.Update(ctx, payload) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.