working commit
This commit is contained in:
@@ -17,12 +17,11 @@ import (
|
||||
"mstore/app/handler"
|
||||
"mstore/app/operator"
|
||||
"mstore/pkg/descr"
|
||||
"mstore/pkg/auxid"
|
||||
)
|
||||
|
||||
func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, password string) (uint64, error) {
|
||||
func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, password string) (string, error) {
|
||||
var err error
|
||||
var res uint64
|
||||
var res string
|
||||
|
||||
apiuri, err := setApiPath(hosturi, "/v3/api/account/create")
|
||||
if err != nil {
|
||||
@@ -54,7 +53,7 @@ func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, passwor
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (cli *Client) GetAccountByID(ctx context.Context, hosturi string, id uint64) (*descr.AccountShort, error) {
|
||||
func (cli *Client) GetAccountByID(ctx context.Context, hosturi, accountID string) (*descr.AccountShort, error) {
|
||||
var err error
|
||||
res := &descr.AccountShort{}
|
||||
|
||||
@@ -64,7 +63,7 @@ func (cli *Client) GetAccountByID(ctx context.Context, hosturi string, id uint64
|
||||
}
|
||||
|
||||
operParams := operator.GetAccountParams{
|
||||
AccountID: id,
|
||||
AccountID: accountID,
|
||||
}
|
||||
paramsJson, err := json.Marshal(operParams)
|
||||
if err != nil {
|
||||
@@ -121,7 +120,7 @@ func (cli *Client) GetAccountByName(ctx context.Context, hosturi, username strin
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi string, id uint64, newUsername, newPassword string) error {
|
||||
func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi string, accountID, newUsername, newPassword string) error {
|
||||
var err error
|
||||
|
||||
apipath, err := setApiPath(hosturi, "/v3/api/account/update")
|
||||
@@ -129,7 +128,7 @@ func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi string, id uin
|
||||
return err
|
||||
}
|
||||
operParams := operator.UpdateAccountParams{
|
||||
AccountID: id,
|
||||
AccountID: accountID,
|
||||
NewUsername: newUsername,
|
||||
NewPassword: newPassword,
|
||||
}
|
||||
@@ -215,7 +214,7 @@ func (cli *Client) DeleteAccountByName(ctx context.Context, hosturi, username st
|
||||
return err
|
||||
}
|
||||
|
||||
func (cli *Client) DeleteAccountByID(ctx context.Context, hosturi string, id uint64) error {
|
||||
func (cli *Client) DeleteAccountByID(ctx context.Context, hosturi, accountID string) error {
|
||||
var err error
|
||||
|
||||
apipath, err := setApiPath(hosturi, "/v3/api/account/delete")
|
||||
@@ -223,7 +222,7 @@ func (cli *Client) DeleteAccountByID(ctx context.Context, hosturi string, id uin
|
||||
return err
|
||||
}
|
||||
operParams := operator.DeleteAccountParams{
|
||||
AccountID: id,
|
||||
AccountID: accountID,
|
||||
}
|
||||
paramsJson, err := json.Marshal(operParams)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user