working commit

This commit is contained in:
2026-06-06 17:49:33 +02:00
parent c96602e933
commit 0e303ef96a
12 changed files with 89 additions and 21 deletions
+30 -1
View File
@@ -13,11 +13,40 @@ func (util *Util) CreateAccount(cmd *cobra.Command, args []string) {
printResponse(res, err)
}
type createAccountParams struct{}
type createAccountParams struct{
Username string
Password string
}
type createAccountResult struct{}
func (util *Util) createAccount(params createAccountParams) (createAccountResult, error) {
var err error
res := createAccountResult{}
/*
operParams := &mbctl.CreateAccountParams{
Username: params.Username,
Password: params.Password,
}
res, err = util.lg.CreateAccount(ctx, operID, params)
if err != nil {
return res, err
}
*/
return res, err
}
/*
func (util *Util) CreateAccount(ctx context.Context, operID string) (*mbctl.CreateAccountResult, error) {
var err error
res := &mbctl.CreateAccountResult{}
params := &mbctl.CreateAccountParams{
Username: util.username,
Password: util.password,
}
res, err = util.lg.CreateAccount(ctx, operID, params)
if err != nil {
return res, err
}
return res, err
}
*/
+7 -3
View File
@@ -4,10 +4,13 @@
package account
import (
"mbase/app/operator"
"github.com/spf13/cobra"
)
type Util struct {
oper *operator.Logic
rootCmd *cobra.Command
createAccountParams createAccountParams
listAccountsParams listAccountsParams
@@ -15,8 +18,10 @@ type Util struct {
deleteAccountParams deleteAccountParams
}
func NewUtil() *Util {
return &Util{}
func NewUtil(oper *operator.Logic) *Util {
return &Util{
oper: oper,
}
}
func (util *Util) GetRooCmd() *cobra.Command {
@@ -65,4 +70,3 @@ func (util *Util) BuildCmds() *cobra.Command {
util.rootCmd = rootCmd
return util.rootCmd
}