uuid used
This commit is contained in:
@@ -16,12 +16,13 @@ import (
|
||||
|
||||
"mstore/app/handler"
|
||||
"mstore/app/operator"
|
||||
"mstore/pkg/auxuuid"
|
||||
"mstore/pkg/descr"
|
||||
)
|
||||
|
||||
func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, password string) (string, error) {
|
||||
func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, password string) (auxuuid.UUID, error) {
|
||||
var err error
|
||||
var res string
|
||||
var res auxuuid.UUID
|
||||
|
||||
apiuri, err := setApiPath(hosturi, "/v3/api/account/create")
|
||||
if err != nil {
|
||||
@@ -53,7 +54,7 @@ func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, passwor
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (cli *Client) GetAccountByID(ctx context.Context, hosturi, id string) (*descr.AccountShort, error) {
|
||||
func (cli *Client) GetAccountByID(ctx context.Context, hosturi string, id auxuuid.UUID) (*descr.AccountShort, error) {
|
||||
var err error
|
||||
res := &descr.AccountShort{}
|
||||
|
||||
@@ -120,7 +121,7 @@ func (cli *Client) GetAccountByName(ctx context.Context, hosturi, username strin
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi, id, newUsername, newPassword string) error {
|
||||
func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi string, id auxuuid.UUID, newUsername, newPassword string) error {
|
||||
var err error
|
||||
|
||||
apipath, err := setApiPath(hosturi, "/v3/api/account/update")
|
||||
@@ -128,7 +129,6 @@ func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi, id, newUserna
|
||||
return err
|
||||
}
|
||||
operParams := operator.UpdateAccountParams{
|
||||
//Username: username,
|
||||
AccountID: id,
|
||||
NewUsername: newUsername,
|
||||
NewPassword: newPassword,
|
||||
@@ -215,7 +215,7 @@ func (cli *Client) DeleteAccountByName(ctx context.Context, hosturi, username st
|
||||
return err
|
||||
}
|
||||
|
||||
func (cli *Client) DeleteAccountByID(ctx context.Context, hosturi, id string) error {
|
||||
func (cli *Client) DeleteAccountByID(ctx context.Context, hosturi string, id auxuuid.UUID) error {
|
||||
var err error
|
||||
|
||||
apipath, err := setApiPath(hosturi, "/v3/api/account/delete")
|
||||
|
||||
Reference in New Issue
Block a user