Skip to content

feat(content): add ContentContext with topic and reply APIs#82

Merged
huacnlee merged 4 commits intomainfrom
feat/content-api
Mar 26, 2026
Merged

feat(content): add ContentContext with topic and reply APIs#82
huacnlee merged 4 commits intomainfrom
feat/content-api

Conversation

@huacnlee
Copy link
Copy Markdown
Member

Summary

New content package implementing the Longbridge Content OpenAPI:

  • ContentContext with NewFromCfg constructor
  • TopicDetailGET /v1/content/topics/{id}
  • MyTopicsGET /v1/content/topics/mine (page / size / topic_type filters)
  • CreateTopicPOST /v1/content/topics
  • ListTopicRepliesGET /v1/content/topics/{topic_id}/comments
  • CreateTopicReplyPOST /v1/content/topics/{topic_id}/comments

Uses the dual-type pattern (jsontypes ↔ public types) consistent with existing packages. All numeric fields stored as int64, timestamps as time.Time. Doc comments include permission requirements, tickers abuse warning, and rate-limit details.

Test plan

  • go build ./content/... passes
  • Verify ContentContext can be constructed from env config
  • Smoke test TopicDetail and CreateTopicReply against staging

🤖 Generated with Claude Code

huacnlee and others added 4 commits March 26, 2026 18:08
New content package implementing the Longbridge Content OpenAPI:
- ContentContext with NewFromCfg constructor
- TopicDetail: GET /v1/content/topics/{id}
- MyTopics: GET /v1/content/topics/mine (with page/size/topic_type filters)
- CreateTopic: POST /v1/content/topics
- ListTopicReplies: GET /v1/content/topics/{topic_id}/comments
- CreateTopicReply: POST /v1/content/topics/{topic_id}/comments

Uses dual-type pattern (jsontypes ↔ public) consistent with existing packages.
Doc comments include permission requirements, tickers abuse warning, and rate-limit details.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- jsontypes/types.go: merge legacy TopicItem/NewsItem types from main with new TopicAuthor/OwnedTopic/TopicReply types
- types.go: same merge for public types
- context.go: keep Topics/News/NewFromEnv from main; add TopicDetail/MyTopics/CreateTopic/ListTopicReplies/CreateTopicReply; align import paths to longbridge org

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@huacnlee huacnlee merged commit 3ef49cc into main Mar 26, 2026
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