silvermobi/handler/account.go

17 lines
507 B
Go

package handler
import (
"context"
"git.coopgo.io/coopgo-apps/silvermobi/models"
"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
)
func (h *SilvermobiHandler) GetAccountInfos(ctx context.Context, id string) (account *models.Account, err error) {
resp, err := h.Services.MobilityAccounts.Client.GetAccount(ctx, &grpcapi.GetAccountRequest{Id: id})
if err != nil {
return nil, err
}
account = h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
return account, nil
}