add list symbols
This commit is contained in:
parent
436996d25d
commit
4e8bc736bf
|
@ -1,11 +1,9 @@
|
|||
package blockchainservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
app_cloudep_blockchain "blockchain/gen_result/pb/code.30cm.net/digimon/app-cloudep-blockchain"
|
||||
"blockchain/internal/svc"
|
||||
|
||||
"context"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
|
@ -29,18 +27,18 @@ func (l *ListSymbolsLogic) ListSymbols(in *app_cloudep_blockchain.ListSymbolsReq
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rpy := make([]*app_cloudep_blockchain.Symbol, 0, len(result))
|
||||
|
||||
for _, item := range result {
|
||||
rpy = append(rpy, &app_cloudep_blockchain.Symbol{
|
||||
Symbol: item.Symbol,
|
||||
Status: item.Status,
|
||||
BaseAsset: item.BaseAsset,
|
||||
BaseAssetPrecision: int32(item.BaseAssetPrecision),
|
||||
QuoteAsset: item.QuoteAsset,
|
||||
QuoteAssetPrecision: int32(item.QuoteAssetPrecision),
|
||||
})
|
||||
if item != nil {
|
||||
rpy = append(rpy, &app_cloudep_blockchain.Symbol{
|
||||
Symbol: item.Symbol,
|
||||
Status: item.Status,
|
||||
BaseAsset: item.BaseAsset,
|
||||
BaseAssetPrecision: int32(item.BaseAssetPrecision),
|
||||
QuoteAsset: item.QuoteAsset,
|
||||
QuoteAssetPrecision: int32(item.QuoteAssetPrecision),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return &app_cloudep_blockchain.ListSymbolsResponse{
|
||||
|
|
|
@ -42,7 +42,7 @@ func (use *BinanceUseCase) GetSymbols(ctx context.Context) ([]*usecase.Symbol, e
|
|||
return nil, e
|
||||
}
|
||||
|
||||
rpy := make([]*usecase.Symbol, len(result))
|
||||
rpy := make([]*usecase.Symbol, 0, len(result))
|
||||
for _, item := range result {
|
||||
rpy = append(rpy, &usecase.Symbol{
|
||||
Symbol: item.Symbol,
|
||||
|
|
Loading…
Reference in New Issue