Documentation ¶
Index ¶
- Constants
- func GetAccessToken(tk token.Token, data token.Data) (access.Token, error)
- func Hmac(s string, appSecret string) string
- func NewToken(app app.App) token.Token
- func RefreshToken(tk token.Token, data token.Data) (access.Token, error)
- func Sign(appKey, appSecret, method string, timestamp string, paramJson string) string
- func UrlParams(appKey, appSecret string, method string, param api.Data) string
- type AccessToken
- type AcsData
- type Response
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 ¶
GetAccessToken https://openapi-fxg.jinritemai.com/token/create?app_key=your_app_key&method=token.create¶m_json={"code":"your_code","grant_type":"authorization_code"}×tamp=2021-06-07 17:34:46&v=2&sign=your_sign_here
func RefreshToken ¶
RefreshToken https://openapi-fxg.jinritemai.com/token/refresh?app_key=your_app_key&method=token.refresh¶m_json={"grant_type":"refresh_token","refresh_token":"your_refresh_token"}×tamp=2021-06-07 17:36:56&v=2&sign=your_sign
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"` }
Click to show internal directories.
Click to hide internal directories.