refactor: log params and channel params - #1339
Conversation
WalkthroughThis update introduces a strongly typed struct Changes
Sequence Diagram(s)sequenceDiagram
participant Controller
participant Model
participant DTO
participant GinContext
participant Middleware
Controller->Model: AddChannel/UpdateChannel(channel)
Model->DTO: ValidateSettings()
DTO-->>Model: ChannelSettings struct
Model->GinContext: SetContextKey(ChannelSetting, ChannelSettings)
Middleware->GinContext: SetContextKey(constant.ChannelSetting, ChannelSettings)
Controller->Model: RecordConsumeLog(userId, RecordConsumeLogParams)
Model->Model: LogQuotaData(params)
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (19)
🧰 Additional context used🧠 Learnings (7)relay/channel/openai/adaptor.go (1)relay/relay-text.go (1)common/gin.go (2)middleware/distributor.go (2)relay/relay_task.go (1)service/quota.go (1)relay/relay-mj.go (1)🧬 Code Graph Analysis (14)relay/channel/vertex/service_account.go (1)
relay/channel/api_request.go (1)
relay/relay-text.go (1)
common/gin.go (1)
relay/channel/coze/relay-coze.go (1)
middleware/distributor.go (2)
dto/channel_settings.go (1)
main.go (1)
relay/relay_task.go (1)
relay/common/relay_info.go (3)
controller/channel-test.go (1)
relay/channel/openai/relay-openai.go (1)
service/quota.go (1)
model/log.go (5)
🔇 Additional comments (32)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit
New Features
Refactor
Bug Fixes