silvermobi/handler/account.go

21 lines
548 B
Go
Raw Normal View History

2023-12-08 06:35:04 +00:00
package handler
import (
"context"
2024-10-31 19:32:54 +00:00
2023-12-08 06:35:04 +00:00
"git.coopgo.io/coopgo-apps/silvermobi/models"
"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
)
2024-10-31 19:32:54 +00:00
func (h *SilverMobiHandler) GetAccountInfos(ctx context.Context, id string) (account *models.Account, err error) {
var resp *grpcapi.GetAccountResponse
if resp, err = h.Services.MobilityAccounts.Client.GetAccount(ctx, &grpcapi.GetAccountRequest{Id: id}); err != nil {
2023-12-08 06:35:04 +00:00
return nil, err
}
2024-10-31 19:32:54 +00:00
2023-12-08 06:35:04 +00:00
account = h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
2024-10-31 19:32:54 +00:00
2023-12-08 06:35:04 +00:00
return account, nil
}