fxg

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Zlib Imports: 19 Imported by: 0

README

抖店开发平台

Documentation

Index

Constants

View Source
const (
	Success            = 10000
	InvalidAccessToken = 50001
)
View Source
const (
	ScTokenExpire  = "dop.token-generate-failed:token-expired"
	ScTokenNoExist = "dop.token-generate-failed:token-invalid"
)
View Source
const ApiPrefixUrl = "https://openapi-fxg.jinritemai.com"

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken(tk token.Token, data token.Data) (access.Token, error)

GetAccessToken https://openapi-fxg.jinritemai.com/token/create?app_key=your_app_key&method=token.create&param_json={"code":"your_code","grant_type":"authorization_code"}&timestamp=2021-06-07 17:34:46&v=2&sign=your_sign_here

func Hmac

func Hmac(s string, appSecret string) string

Hmac 计算hmac

func NewToken

func NewToken(app app.App) token.Token

func RefreshToken

func RefreshToken(tk token.Token, data token.Data) (access.Token, error)

RefreshToken https://openapi-fxg.jinritemai.com/token/refresh?app_key=your_app_key&method=token.refresh&param_json={"grant_type":"refresh_token","refresh_token":"your_refresh_token"}&timestamp=2021-06-07 17:36:56&v=2&sign=your_sign

func Sign

func Sign(appKey, appSecret, method string, timestamp string, paramJson string) string

Sign 计算签名

func UrlParams

func UrlParams(appKey, appSecret string, method string, param api.Data) string

Types

type AccessToken

type AccessToken struct {
	AcsToken    string `json:"access_token"`
	RefToken    string `json:"refresh_token"`
	AcsExpireIn int64  `json:"expires_in,omitempty"`
	RefExpireIn int64  `json:"refresh_expires_in,omitempty"`
	Scope       string `json:"scope,omitempty"`
}

func (AccessToken) GetAccessToken

func (a AccessToken) GetAccessToken() access.Value

func (AccessToken) GetRefAccessToken

func (a AccessToken) GetRefAccessToken() access.Value

type AcsData

type AcsData struct {
	AccessToken
	ShopId   int64  `json:"shop_id,omitempty"`
	ShopName string `json:"shop_name,omitempty"`
}

type Response

type Response struct {
	ErrNo   int32  `json:"err_no,omitempty"`
	Message string `json:"message"`
	Code    int32  `json:"code"`
	Msg     string `json:"msg,omitempty"`
	SubCode string `json:"sub_code,omitempty"`
	SubMsg  string `json:"sub_msg,omitempty"`
	LogId   string `json:"log_id,omitempty"`
}

func (Response) ReturnIf

func (r Response) ReturnIf(api *api.Api) error

Jump to

Keyboard shortcuts

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