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