yigaosu

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 13 Imported by: 1

README

yigaosu

ctx := context.Background()
client, err := yigaosu.Login(ctx, "12345678901", "encrypted-password")
cards, err := client.GetETCCards(ctx)
bills, err := client.GetETCCardBillsPage(ctx, cards[0], 1, 1)

You can use Mitmproxy to obtain the encrypted password when using the Yigaosu (e高速) app.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	AccessToken string
}

func Login added in v1.1.0

func Login(ctx context.Context, phone, encryptedPassword string) (*Client, error)

func (Client) GetETCCardBillsPage

func (c Client) GetETCCardBillsPage(ctx context.Context, card ETCCard, limit, page int) ([]ETCCardBill, error)

Get bills of ETC card. Limit should be a number from 1 to 200.

func (Client) GetETCCards

func (c Client) GetETCCards(ctx context.Context) ([]ETCCard, error)

Get list of ETC cards of current user.

type ETCCard

type ETCCard struct {
	CardCode string `json:"cardCode"` // 1
	CardNo   string `json:"cardNo"`   // XXXXXXXXXXXXXXXXXXXX
	CardType string `json:"cardType"` // 记账卡
	PlateNo  string `json:"plateNo"`  // 粤XX
}

type ETCCardBill

type ETCCardBill struct {
	Amount           string `json:"amount"`           // 19.0
	Bank             string `json:"bank"`             // XX银行(XX)
	BillId           string `json:"billid"`           // T20230901XXXXXXXXXXXXXXXXXXXX
	BillName         string `json:"billName"`         // ETC通行费
	BillTitle        string `json:"billTitle"`        // XX站驶入-XX站驶出
	BillType         string `json:"billType"`         // etc
	CardType         string `json:"cardType"`         // 记账卡
	EndStation       string `json:"endStation"`       // XX站驶出
	EndTime          int64  `json:"endTime"`          // 1693480225000
	PayTime          int64  `json:"payTime"`          // 1693480225000
	PlateNo          string `json:"plateNo"`          // 粤XX
	RefundFailReason string `json:"refundFailReason"` // 已受理,支付中
	RefundState      int    `json:"refundState"`      // 3
	StartStation     string `json:"startStation"`     // XX站驶入
	StartTime        int64  `json:"startTime"`        // 1693479229000
	TotalAmount      string `json:"totalAmount"`      // 19
	WasteId          string `json:"wasteId"`          // G00944400XXXXXXXXXXXXXXXXXXXXXXXXXXXX
	WasteType        int    `json:"wasteType"`        // 1
}

Directories

Path Synopsis
yigaosusync module

Jump to

Keyboard shortcuts

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