1
0
Fork 0

Updates of Lego.

This commit is contained in:
Ludovic Fernandez 2019-02-11 08:52:03 +01:00 committed by Traefiker Bot
parent 5f4d440493
commit 2b2cfdfb32
102 changed files with 8355 additions and 902 deletions

View file

@ -1,54 +0,0 @@
package goinwx
const (
methodAccountLogin = "account.login"
methodAccountLogout = "account.logout"
methodAccountLock = "account.lock"
methodAccountUnlock = "account.unlock"
)
type AccountService interface {
Login() error
Logout() error
Lock() error
Unlock(tan string) error
}
type AccountServiceOp struct {
client *Client
}
var _ AccountService = &AccountServiceOp{}
func (s *AccountServiceOp) 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
}
func (s *AccountServiceOp) Logout() error {
req := s.client.NewRequest(methodAccountLogout, nil)
_, err := s.client.Do(*req)
return err
}
func (s *AccountServiceOp) Lock() error {
req := s.client.NewRequest(methodAccountLock, nil)
_, err := s.client.Do(*req)
return err
}
func (s *AccountServiceOp) Unlock(tan string) error {
req := s.client.NewRequest(methodAccountUnlock, map[string]interface{}{
"tan": tan,
})
_, err := s.client.Do(*req)
return err
}