Updates of Lego.
This commit is contained in:
parent
5f4d440493
commit
2b2cfdfb32
102 changed files with 8355 additions and 902 deletions
48
vendor/github.com/nrdcg/goinwx/account.go
generated
vendored
Normal file
48
vendor/github.com/nrdcg/goinwx/account.go
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
package goinwx
|
||||
|
||||
const (
|
||||
methodAccountLogin = "account.login"
|
||||
methodAccountLogout = "account.logout"
|
||||
methodAccountLock = "account.lock"
|
||||
methodAccountUnlock = "account.unlock"
|
||||
)
|
||||
|
||||
// AccountService API access to Account.
|
||||
type AccountService service
|
||||
|
||||
// Login Account login.
|
||||
func (s *AccountService) Login() error {
|
||||
req := s.client.NewRequest(methodAccountLogin, map[string]interface{}{
|
||||
"user": s.client.username,
|
||||
"pass": s.client.password,
|
||||
})
|
||||
|
||||
_, err := s.client.Do(*req)
|
||||
return err
|
||||
}
|
||||
|
||||
// Logout Account logout.
|
||||
func (s *AccountService) Logout() error {
|
||||
req := s.client.NewRequest(methodAccountLogout, nil)
|
||||
|
||||
_, err := s.client.Do(*req)
|
||||
return err
|
||||
}
|
||||
|
||||
// Lock Account lock.
|
||||
func (s *AccountService) Lock() error {
|
||||
req := s.client.NewRequest(methodAccountLock, nil)
|
||||
|
||||
_, err := s.client.Do(*req)
|
||||
return err
|
||||
}
|
||||
|
||||
// Unlock Account unlock.
|
||||
func (s *AccountService) Unlock(tan string) error {
|
||||
req := s.client.NewRequest(methodAccountUnlock, map[string]interface{}{
|
||||
"tan": tan,
|
||||
})
|
||||
|
||||
_, err := s.client.Do(*req)
|
||||
return err
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue