api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute[T any](method, path string, headers H, body any) (T, bool)

Types

type CommonResp

type CommonResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func (CommonResp) GetCode

func (v CommonResp) GetCode() int

func (CommonResp) GetMessage

func (v CommonResp) GetMessage() string

type EquipmentInfo

type EquipmentInfo struct {
	Id               string  `json:"id"`
	EquipmentType    int     `json:"equipmentType"`
	HouseCode        string  `json:"houseCode"`
	MeterOnOff       int     `json:"meterOnOff"`
	NoPowerOff       int     `json:"noPowerOff"`
	MeterAddr        string  `json:"meterAddr"`
	MeterInstallAddr string  `json:"meterInstallAddr"`
	Surplus          string  `json:"surplus"`      // 余量
	SurplusAmount    string  `json:"surplusAmout"` // 余额
	UnitPrice        float64 `json:"unitPrice"`    // 单价
	OperateTime      string  `json:"operateTime"`
	LastReadTime     string  `json:"lastReadTime"` // 上次读表时间
}

type GetLatestAPKResp

type GetLatestAPKResp struct {
	CommonResp
	Content struct {
		Source        int    `json:"source"`
		IsToUpdate    int    `json:"isToUpdate"`
		VersionNumber int    `json:"versionNumber"`
		ApkAddress    string `json:"apkAdress"`
		CreateTime    string `json:"createTime"`
	} `json:"content"`
}

func GetLatestAPK

func GetLatestAPK(apples ...bool) *GetLatestAPKResp

type H

type H map[string]string

func HAuth

func HAuth(accessToken string) H

type HouseInfoContent

type HouseInfoContent struct {
	Id                    string           `json:"id"`
	OrderContractId       string           `json:"orderContractId"`
	OrderContractDetailId string           `json:"orderContractDetailId"`
	HouseName             string           `json:"houseName"`
	HouseCode             string           `json:"houseCode"`
	CustomerInfoId        string           `json:"customerInfoId"`
	CustomerName          string           `json:"customerName"`
	CustomerPhone         string           `json:"customerPhone"`
	List                  []*EquipmentInfo `json:"list"`
}

type HouseInfoResp

type HouseInfoResp struct {
	CommonResp
	Content []*HouseInfoContent `json:"content"`
}

func GetHouseInfo

func GetHouseInfo(accessToken string) *HouseInfoResp

type LoginReq

type LoginReq struct {
	Code            string `json:"code" validate:"required,min=1"`
	Username        string `json:"username" validate:"required,min=1"`
	Password        string `json:"password" validate:"required,min=1"`
	RegistrationIds string `json:"registrationIds"`
}

type LoginResp

type LoginResp struct {
	CommonResp
	Content struct {
		Id           string `json:"id"`
		Type         int    `json:"type"`
		IsRepairman  int    `json:"isRepairman"`
		UserName     string `json:"userName"`
		AccessToken  string `json:"access_token"`
		TokenType    string `json:"token_type"`
		ExpiresIn    int    `json:"expires_in"`
		RefreshToken string `json:"refresh_token"`
		Scope        string `json:"scope"`
	} `json:"content"`
}

func Login

func Login(req LoginReq) *LoginResp

type LogoutReq

type LogoutReq struct {
	AccessToken string `json:"access_token"`
}

type LogoutResp

type LogoutResp struct {
	CommonResp
	Content string `json:"content"`
}

func Logout

func Logout(accessToken string) *LogoutResp

type SendCodeReq

type SendCodeReq struct {
	Type     int    `json:"type"`
	Username string `json:"username" validate:"required,min=1"`
}

type SendCodeResp

type SendCodeResp struct {
	CommonResp
	Content string `json:"content"`
}

func SendCode

func SendCode(req SendCodeReq) *SendCodeResp

type SimpleEquipmentInfo added in v0.0.2

type SimpleEquipmentInfo struct {
	Surplus       float64              `json:"surplus"`              // 余量
	SurplusAmount float64              `json:"surplusAmount"`        // 余额
	UnitPrice     float64              `json:"unitPrice"`            // 单价
	LastReadTime  time.Time            `json:"lastReadTime"`         // 上次读表时间
	LastRecord    *SimpleEquipmentInfo `json:"lastRecord,omitempty"` // 上次记录
}

Jump to

Keyboard shortcuts

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