alittle splitted mstorectl code; etc
This commit is contained in:
+17
-17
@@ -14,8 +14,8 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"mstore/app/accoper"
|
||||
"mstore/app/handler"
|
||||
"mstore/app/operator"
|
||||
"mstore/pkg/descr"
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@ func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, passwor
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
operParams := operator.CreateAccountParams{
|
||||
operParams := accoper.CreateAccountParams{
|
||||
Username: username,
|
||||
Password: password,
|
||||
}
|
||||
@@ -40,7 +40,7 @@ func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, passwor
|
||||
return res, err
|
||||
}
|
||||
|
||||
operRes := handler.NewResponse[operator.CreateAccountResult]()
|
||||
operRes := handler.NewResponse[accoper.CreateAccountResult]()
|
||||
err = json.Unmarshal(respBytes, operRes)
|
||||
if err != nil {
|
||||
return res, err
|
||||
@@ -62,7 +62,7 @@ func (cli *Client) GetAccountByID(ctx context.Context, hosturi, accountID string
|
||||
return res, err
|
||||
}
|
||||
|
||||
operParams := operator.GetAccountParams{
|
||||
operParams := accoper.GetAccountParams{
|
||||
AccountID: accountID,
|
||||
}
|
||||
paramsJson, err := json.Marshal(operParams)
|
||||
@@ -74,7 +74,7 @@ func (cli *Client) GetAccountByID(ctx context.Context, hosturi, accountID string
|
||||
return res, err
|
||||
}
|
||||
|
||||
operRes := handler.NewResponse[operator.GetAccountResult]()
|
||||
operRes := handler.NewResponse[accoper.GetAccountResult]()
|
||||
err = json.Unmarshal(respBytes, operRes)
|
||||
if err != nil {
|
||||
return res, err
|
||||
@@ -95,7 +95,7 @@ func (cli *Client) GetAccountByName(ctx context.Context, hosturi, username strin
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
operParams := operator.GetAccountParams{
|
||||
operParams := accoper.GetAccountParams{
|
||||
Username: username,
|
||||
}
|
||||
paramsJson, err := json.Marshal(operParams)
|
||||
@@ -107,7 +107,7 @@ func (cli *Client) GetAccountByName(ctx context.Context, hosturi, username strin
|
||||
return res, err
|
||||
}
|
||||
|
||||
operRes := handler.NewResponse[operator.GetAccountResult]()
|
||||
operRes := handler.NewResponse[accoper.GetAccountResult]()
|
||||
err = json.Unmarshal(respBytes, operRes)
|
||||
if err != nil {
|
||||
return res, err
|
||||
@@ -127,7 +127,7 @@ func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi string, accoun
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
operParams := operator.UpdateAccountParams{
|
||||
operParams := accoper.UpdateAccountParams{
|
||||
AccountID: accountID,
|
||||
NewUsername: newUsername,
|
||||
NewPassword: newPassword,
|
||||
@@ -140,7 +140,7 @@ func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi string, accoun
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
operRes := handler.NewResponse[operator.UpdateAccountResult]()
|
||||
operRes := handler.NewResponse[accoper.UpdateAccountResult]()
|
||||
err = json.Unmarshal(respBytes, operRes)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -158,7 +158,7 @@ func (cli *Client) UpdateAccountByName(ctx context.Context, hosturi, username, n
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
operParams := operator.UpdateAccountParams{
|
||||
operParams := accoper.UpdateAccountParams{
|
||||
Username: username,
|
||||
NewUsername: newUsername,
|
||||
NewPassword: newPassword,
|
||||
@@ -171,7 +171,7 @@ func (cli *Client) UpdateAccountByName(ctx context.Context, hosturi, username, n
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
operRes := handler.NewResponse[operator.UpdateAccountResult]()
|
||||
operRes := handler.NewResponse[accoper.UpdateAccountResult]()
|
||||
err = json.Unmarshal(respBytes, operRes)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -190,7 +190,7 @@ func (cli *Client) DeleteAccountByName(ctx context.Context, hosturi, username st
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
operParams := operator.DeleteAccountParams{
|
||||
operParams := accoper.DeleteAccountParams{
|
||||
Username: username,
|
||||
}
|
||||
paramsJson, err := json.Marshal(operParams)
|
||||
@@ -202,7 +202,7 @@ func (cli *Client) DeleteAccountByName(ctx context.Context, hosturi, username st
|
||||
return err
|
||||
}
|
||||
|
||||
operRes := handler.NewResponse[operator.DeleteAccountResult]()
|
||||
operRes := handler.NewResponse[accoper.DeleteAccountResult]()
|
||||
err = json.Unmarshal(respBytes, operRes)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -221,7 +221,7 @@ func (cli *Client) DeleteAccountByID(ctx context.Context, hosturi, accountID str
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
operParams := operator.DeleteAccountParams{
|
||||
operParams := accoper.DeleteAccountParams{
|
||||
AccountID: accountID,
|
||||
}
|
||||
paramsJson, err := json.Marshal(operParams)
|
||||
@@ -233,7 +233,7 @@ func (cli *Client) DeleteAccountByID(ctx context.Context, hosturi, accountID str
|
||||
return err
|
||||
}
|
||||
|
||||
operRes := handler.NewResponse[operator.DeleteAccountResult]()
|
||||
operRes := handler.NewResponse[accoper.DeleteAccountResult]()
|
||||
err = json.Unmarshal(respBytes, operRes)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -253,7 +253,7 @@ func (cli *Client) ListAccounts(ctx context.Context, hosturi string) ([]descr.Ac
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
operParams := operator.ListAccountsParams{}
|
||||
operParams := accoper.ListAccountsParams{}
|
||||
paramsJson, err := json.Marshal(operParams)
|
||||
if err != nil {
|
||||
return res, err
|
||||
@@ -263,7 +263,7 @@ func (cli *Client) ListAccounts(ctx context.Context, hosturi string) ([]descr.Ac
|
||||
return res, err
|
||||
}
|
||||
|
||||
operRes := handler.NewResponse[operator.ListAccountsResult]()
|
||||
operRes := handler.NewResponse[accoper.ListAccountsResult]()
|
||||
err = json.Unmarshal(respBytes, operRes)
|
||||
if err != nil {
|
||||
return res, err
|
||||
|
||||
Reference in New Issue
Block a user