Skip to content

feat(fundamental): macroeconomic v2 API + keyword/sort support#100

Merged
hogan-yuan merged 26 commits into
mainfrom
feat/macroeconomic-v2
Jun 13, 2026
Merged

feat(fundamental): macroeconomic v2 API + keyword/sort support#100
hogan-yuan merged 26 commits into
mainfrom
feat/macroeconomic-v2

Conversation

@hogan-yuan

@hogan-yuan hogan-yuan commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

Switches macroeconomic APIs to v2 endpoints and simplifies types.

Changes

New / updated methods

  • MacroeconomicIndicators(ctx, country, keyword, offset, limit)GET /v2/quote/macrodata
    • Added keyword for fuzzy name filtering (case-insensitive)
    • Now returns Periodicity, Describe, Importance from v2 API
  • Macroeconomic(ctx, indicatorCode, startDate, endDate, offset, limit)GET /v2/quote/macrodata/{id}
    • Defaults to sort=desc (newest first)
    • Returns Unit string from v2 API

Type simplifications

  • MacroeconomicIndicator.Name / .Describe: MultiLanguageTextstring
  • Macroeconomic.Unit / .UnitPrefix: MultiLanguageTextstring

Cleanup

  • Removed unused helpers: convertMacroeconomicIndicator, convertMultiLanguageText, convertMacroeconomic, macroeconomicCountryToAPIValue
  • Internal _v2 method variants hidden from public API

Version

v0.25.1

Related

hogan-yuan and others added 20 commits June 10, 2026 17:50
- MacrodataIndicators: add country parameter (MacrodataCountry enum)
- MacrodataIndicators: return MacrodataIndicatorListResponse with count
- Macrodata: add offset parameter for pagination
- Macrodata: response includes count field
- Add MacrodataImportance enum (1=Low, 2=Medium, 3=High)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
SDK accepts HK/CN/US/EU/JP/SG; converts to
'Hong Kong SAR China'/'China (Mainland)'/etc. when sending to API.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…APIValue

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- macroeconomic_indicators / MacroeconomicIndicatorsV2: GET /v2/quote/macrodata
  - market defaults to 'ALL' when country is nil
  - new keyword param for fuzzy name filter
  - maps V2MacroIndicator to existing MacroeconomicIndicator type
- macroeconomic / MacroeconomicV2: GET /v2/quote/macrodata/{id}
  - new sort param (asc/desc)
  - maps V2MacroIndicatorDetail to existing MacroeconomicResponse type
- original method signatures unchanged; _v2 variants add new params

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ndicator_data_list

GetMacroIndicatorHistoryResp returns:
  indicator: MacroIndicatorDetail  (single object)
  total: int32

Also confirm list endpoint has offset/limit/total.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… published_time RFC3339 parsing

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ator list mapping

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
MacroIndicatorItem.frequence maps to MacroeconomicIndicator.Periodicity

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ageText to string

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… to string

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Remove: convertMultiLanguageText, convertMacroeconomicIndicator,
convertMacroeconomic, macroeconomicCountryToAPIValue

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hogan-yuan hogan-yuan marked this pull request as ready for review June 12, 2026 11:04
hogan-yuan and others added 4 commits June 12, 2026 19:05
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- CHANGELOG v0.25.1
- v2 API wire types and routing for macroeconomic interfaces
- string types for Name/Describe/Unit/UnitPrefix

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hogan-yuan hogan-yuan changed the title feat(fundamental): add MacroeconomicIndicatorsV2 and MacroeconomicV2 methods (v2 endpoints) feat(fundamental): macroeconomic v2 API + keyword/sort support Jun 12, 2026
- MacroeconomicIndicators: GET /v1 → /v2/quote/macrodata, adds keyword param, uses market code directly
- Macroeconomic: GET /v1 → /v2/quote/macrodata/{id}, defaults sort=desc
- Add convertV2MacroeconomicIndicator/Detail/Macroeconomic converters
- Remove unused v1 converters: convertMacroeconomicIndicator, convertMacroeconomic, macroeconomicCountryToAPIValue, convertMultiLanguageText

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ust SDK

- start_time/end_time (RFC3339) → start_date/end_date (YYYY-MM-DD) per proto spec
- Add count fallback: if total==0 use len(data), matching Rust behavior

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hogan-yuan hogan-yuan merged commit 7bd65ea into main Jun 13, 2026
@hogan-yuan hogan-yuan deleted the feat/macroeconomic-v2 branch June 13, 2026 02:37
hogan-yuan added a commit to longbridge/developers that referenced this pull request Jun 26, 2026
…1085)

## Summary

新增宏观经济数据相关文档,三语言(en / zh-CN / zh-HK)同步。

### SDK docs(`docs/{lang}/docs/fundamental/fundamental/`)
- 新增 `macroeconomic-indicators.md` — `macroeconomic_indicators`
方法(参数:country、keyword、offset、limit)
- 新增 `macroeconomic.md` — `macroeconomic` 方法
- Schema 字段类型修正:`name`、`describe`、`unit`、`unit_prefix` 已改为 `string`(v2
breaking change)
- MacroeconomicCountry value 改为缩写:HK / CN / US / EU / JP / SG
- JSON 示例仅保留 v2 实际返回字段

### CLI docs(`docs/{lang}/docs/cli/fundamentals/`)
- 新增 `macrodata.md` — `longbridge macrodata` 命令
-
选项:`--country`、`--keyword`、`--lang`、`--start`/`--end`、`--limit`、`--page`、`--format`
  - JSON 响应结构说明(含 `page`、`limit`、`has_more`)

### MCP docs
- `mcp.md` 三语言 capabilities 表格追加宏观经济指标、补充实时行情链接

### Changelog & Release Notes
- `changelog.md` 追加 2026-06-25 条目(SDK v4.3.3 + CLI v0.23.4)
- `cli/release-notes.md` 追加 v0.23.4 条目

## Related PRs

- CLI: longbridge/longbridge-terminal#239
- SDK: longbridge/openapi#540 (merged), #543 (merged, v2 endpoints)
- MCP: longbridge/longbridge-mcp#79
- Go SDK: longbridge/openapi-go#100 (merged)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant