Documentation ¶
Index ¶
- Constants
- Variables
- type ChargeRecords
- type CustomTime
- type Detail
- type DormElectricity
- type ElectricityDetails
- type ZhydUser
- func (u *ZhydUser) GetChargeRecords() (rte []ChargeRecords, err error)
- func (u *ZhydUser) GetDormElectricity() (rte []DormElectricity, err error)
- func (u *ZhydUser) GetElectricityDetails() (rte []ElectricityDetails, err error)
- func (u *ZhydUser) IsLogged() bool
- func (u *ZhydUser) Login() (err error)
- func (u *ZhydUser) PerSetCooikes() *ZhydUser
- func (u *ZhydUser) SetPassword(password string) *ZhydUser
- func (u *ZhydUser) SetUsername(username string) *ZhydUser
Constants ¶
View Source
const ( TimeLayout = "2006/1/2 15:04:05" TwoTimeLayout = `"2006\/1\/2 15:04:05"` )
Variables ¶
View Source
var ( // AuthHostUrl 登陆主页面 AuthHostUrl = "http://ids.lit.edu.cn" // NeedCaptchaUrl 判断是否需要验证码的接口 NeedCaptchaUrl = AuthHostUrl + "/authserver/needCaptcha.html" // CaptchaUrl 获取验证码 CaptchaUrl = AuthHostUrl + "/authserver/captcha.html" // LoginUrl 登陆接口 LoginUrl = AuthHostUrl + "/authserver/login" // ZhydHost ZhydHost = "http://zhyd.sec.lit.edu.cn" // ZhydHostUrl 智慧用电主页 ZhydHostUrl = ZhydHost + "/zhyd" // GetDormElectricityURl 获取宿舍电量主页 GetDormElectricityURl = ZhydHostUrl + "/sydl/index" // GetElectricityDetailsUrl 获取用电明细 GetElectricityDetailsUrl = ZhydHostUrl + "/ydmx/index" // GetConsumptionRecordsUrl 获取消费记录 GetChargeRecordsUrl = ZhydHostUrl + "/zzgd/index" // UA UA = "" /* 131-byte string literal not displayed */ // MainHeaders 主请求头 MainHeaders = map[string]string{ "User-Agent": UA, "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", } )
View Source
var Location = time.FixedZone("GMT", 8*3600)
Functions ¶
This section is empty.
Types ¶
type ChargeRecords ¶
type ChargeRecords struct { Xtbz string `json:"XTBZ"` BuildName string `json:"buildName"` Device string `json:"device"` Mdid string `json:"mdid"` Mx []struct { Accounttime CustomTime `json:"accounttime"` Inmoney string `json:"inmoney"` Paytype string `json:"paytype"` } `json:"mx"` Room string `json:"room"` RoomID string `json:"roomId"` Electricity string `json:"syl"` }
ChargeRecords 充值记录结构
type CustomTime ¶
func (CustomTime) MarshalJSON ¶
func (ct CustomTime) MarshalJSON() ([]byte, error)
func (*CustomTime) UnmarshalJSON ¶
func (ct *CustomTime) UnmarshalJSON(b []byte) error
type DormElectricity ¶
type DormElectricity struct { Name string `json:"name"` BuildName string `json:"build_name"` Room string `json:"room"` Electricity string `json:"electricity"` Balance string `json:"balance"` ElectricitySubsidy string `json:"electricity_subsidy"` BalanceSubsidy string `json:"balance_subsidy"` }
DormElectricity 宿舍用电余额结构
type ElectricityDetails ¶
type ElectricityDetails struct { Name string `json:"name"` BuildName string `json:"build_name"` Room string `json:"room"` Electricity string `json:"electricity"` Details []Detail `json:"details"` }
ElectricityDetails 宿舍用电详情结构
type ZhydUser ¶
ZhydUser 智能控电用户结构体
func (*ZhydUser) GetChargeRecords ¶
func (u *ZhydUser) GetChargeRecords() (rte []ChargeRecords, err error)
GetChargeRecords 获取消费记录
func (*ZhydUser) GetDormElectricity ¶
func (u *ZhydUser) GetDormElectricity() (rte []DormElectricity, err error)
GetDormElectricity 获取寝室用电情况
func (*ZhydUser) GetElectricityDetails ¶
func (u *ZhydUser) GetElectricityDetails() (rte []ElectricityDetails, err error)
GetElectricityDetails 获取寝室用电明细
func (*ZhydUser) PerSetCooikes ¶
PerSetCooikes 预先设置必要Cookies
func (*ZhydUser) SetPassword ¶
SetPassword 设置密码
func (*ZhydUser) SetUsername ¶
SetPassword 设置用户名
Click to show internal directories.
Click to hide internal directories.