feat(content): add ContentContext with topic and reply APIs#82
Merged
feat(content): add ContentContext with topic and reply APIs#82
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New
contentpackage implementing the Longbridge Content OpenAPI:ContentContextwithNewFromCfgconstructorTopicDetail—GET /v1/content/topics/{id}MyTopics—GET /v1/content/topics/mine(page / size / topic_type filters)CreateTopic—POST /v1/content/topicsListTopicReplies—GET /v1/content/topics/{topic_id}/commentsCreateTopicReply—POST /v1/content/topics/{topic_id}/commentsUses the dual-type pattern (
jsontypes↔ public types) consistent with existing packages. All numeric fields stored asint64, timestamps astime.Time. Doc comments include permission requirements, tickers abuse warning, and rate-limit details.Test plan
go build ./content/...passesContentContextcan be constructed from env configTopicDetailandCreateTopicReplyagainst staging🤖 Generated with Claude Code