xiaohongshu

package module
v0.1.211 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 14 Imported by: 0

README

xiaohongshu

xiaohongshu SDK. xiaohongshu新开放平台 xiaohongshu旧开放平台

install

go get -u github.com/WaltCuller/xiaohongshu

example

packages 订单
refund 售后
items 商品
inventories 库存

license

MIT

Documentation

Index

Constants

View Source
const GatewayURL = "https://ark.xiaohongshu.com"

GatewayURL 抖音小店网关地址

Variables

View Source
var SortKeyList = [4]string{
	"method",
	"appId",
	"timestamp",
	"version",
}

SortKeyList 公共参数排序后的字段列表,签名时用到

Functions

func ReplaceSpecial added in v0.1.1

func ReplaceSpecial(param string) string

func Sign

func Sign(pm ParamMap, secret string) string

Types

type App added in v0.1.1

type App struct {
	AccessToken           string `mapstructure:"access_token"`
	ExpiresAt             uint32 `mapstructure:"expires_at"`
	RefreshToken          string `mapstructure:"refresh_token"`
	RefreshTokenExpiresAt uint32 `mapstructure:"refresh_token_expires_at"`
	Code                  string `mapstructure:"code"`
	SellerID              uint64 `mapstructure:"seller_id"`
	SellerName            string `mapstructure:"seller_name"`
	Error                 error  `mapstructure:"-"`
	// contains filtered or unexported fields
}

func (*App) PackagesDetail added in v0.1.1

func (a *App) PackagesDetail(arg packages.ReqDetail) (rsp packages.RspDetail, err error)

func (*App) PackagesList added in v0.1.1

func (a *App) PackagesList(arg packages.ReqList) (rsp packages.RspList, err error)

func (*App) RefundDetail added in v0.1.1

func (a *App) RefundDetail(arg refund.ReqDetail) (rsp refund.RspDetail, err error)

func (*App) RefundList added in v0.1.1

func (a *App) RefundList(arg refund.ReqList) (rsp refund.RspList, err error)

type BaseApp

type BaseApp struct {
	AppID  string
	Secret string
	// contains filtered or unexported fields
}

BaseApp 应用的基础配置

func NewBaseApp

func NewBaseApp(id, s string) *BaseApp

NewBaseApp 实例化基础应用

func (*BaseApp) NewAccessToken added in v0.1.1

func (b *BaseApp) NewAccessToken(t ...string) (*App, error)

NewAccessToken 获权AccessToken

func (*BaseApp) NewAccessTokenMust added in v0.1.1

func (b *BaseApp) NewAccessTokenMust(t ...string) *App

NewAccessTokenMust 获权AccessToken

func (*BaseApp) NewRequest added in v0.1.1

func (b *BaseApp) NewRequest(method string, postData interface{}, d interface{}) error

NewRequest 执行请求

func (*BaseApp) SetGatewayURL

func (b *BaseApp) SetGatewayURL(u string) *BaseApp

SetGatewayURL 设置小红书网关地址

type BaseResp

type BaseResp struct {
	Data      interface{} `json:"data"`
	ErrorCode int         `json:"error_code"`
	Success   bool        `json:"success"`
}

type Oauth added in v0.1.1

type Oauth interface {
	GetAccessToken()
	RefreshToken()
}

type Packages

type Packages interface {
	PackagesList(arg packages.ReqList) (packages.RspList, error)
	PackagesDetail(arg packages.ReqDetail) (packages.RspDetail, error)
}

type ParamMap added in v0.1.1

type ParamMap map[string]interface{}

ParamMap 用于包装请求数据 值虽然是interface,但最终在请求时都被转成了string

func ToParamMap added in v0.1.1

func ToParamMap(data interface{}, ret ...*ParamMap) ParamMap

ToParamMap 将任意struct转换为成ParamMap paramName "-" 这个字段将被忽略,须要注意的是如果字段是bool,那么将被转换成字符串 类型的"true"和"false"

type Refund

type Refund interface {
	RefundList(arg refund.ReqList) (refund.RspList, error)
	RefundDetail(arg refund.ReqDetail) (refund.RspDetail, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL