services

package
v0.0.0-...-c3a65a0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoginUserId string

Functions

func Create

func Create(userid string) string

func CreateUnifiedOrder

func CreateUnifiedOrder(payinfo PayInfo) (wxpay.Params, error)

func FilterFunc

func FilterFunc(ctx *context.Context)

func GenerateDataSign

func GenerateDataSign(requestdata string) string

func GenerateRequestData

func GenerateRequestData(shippercode, logisticcode, ordercode string) string

func GetUserID

func GetUserID(tokenstr string) string

func Parse

func Parse(tokenstr string) *jwt.Token

func Verify

func Verify(tokenstr string) bool

Types

type CustomClaims

type CustomClaims struct {
	UserID string `json:"userid"`
	jwt.StandardClaims
}

type ExpressFromData

type ExpressFromData struct {
	RequestData string
	EBusinessId string
	RequestType string
	DataSign    string
	DataType    string
}

func GenerateFromData

func GenerateFromData(shippercode, logisticcode, ordercode string) ExpressFromData

type ExpressRequestData

type ExpressRequestData struct {
	OrderCode    string
	ShipperCode  string
	LogisticCode string
}

type ExpressResult

type ExpressResult struct {
	Success bool     `json:"success"`
	State   int      `json:"state"`
	Traces  []Traces `json:"traces"`
}

type ExpressRtnInfo

type ExpressRtnInfo struct {
	Success      bool     `json:"success"`
	ShipperCode  string   `json:"shipper_code"`
	ShipperName  string   `json:"shipper_name"`
	LogisticCode string   `json:"logistic_code"`
	IsFinish     int      `json:"is_finish"`
	Traces       []Traces `json:"traces"`
	RequestTime  int64    `json:"request_time"`
}

func QueryExpress

func QueryExpress(shippercode, logisticcode string, ordercode string) ExpressRtnInfo

type PayInfo

type PayInfo struct {
	OpenId         string
	Body           string
	OutTradeNo     string
	TotalFee       int64
	SpbillCreateIp string
}

type ResUserInfo

type ResUserInfo struct {
	UserInfo      WXUserInfo `json:"userInfo"`
	RawData       string     `json:"rawData"`
	Signature     string     `json:"signature"`
	EncryptedData string     `json:"encryptedData"`
	IV            string     `json:"iv"`
}

type Traces

type Traces struct {
	AcceptTime    string `json:"accept_time"`
	AcceptStation string `json:"accept_station"`
	Remark        string `json:"remark"`
}

type WXLoginResponse

type WXLoginResponse struct {
	OpenID     string `json:"openid"`
	SessionKey string `json:"session_key"`
	UnionID    string `json:"unionid"`
	ErrCode    int    `json:"errcode"`
	ErrMsg     string `json:"errmsg"`
}

type WXUserInfo

type WXUserInfo struct {
	OpenID    string    `json:"openId,omitempty"`
	NickName  string    `json:"nickName"`
	AvatarUrl string    `json:"avatarUrl"`
	Gender    int       `json:"gender"`
	Country   string    `json:"country"`
	Province  string    `json:"province"`
	City      string    `json:"city"`
	UnionID   string    `json:"unionId,omitempty"`
	Language  string    `json:"language"`
	Watermark Watermark `json:"watermark,omitempty"`
}

func DecryptUserInfoData

func DecryptUserInfoData(sessionKey string, encryptedData string, iv string) *WXUserInfo

func Login

func Login(code string, fullUserInfo ResUserInfo) *WXUserInfo

type Watermark

type Watermark struct {
	AppID     string `json:"appid"`
	TimeStamp int64  `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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