Skip to content

feat: include admin username in user quota modification log#2937

Open
feitianbubu wants to merge 1 commit intoQuantumNous:mainfrom
feitianbubu:pr/f944dd3beed1a58c41f10155f65988da904efc0a
Open

feat: include admin username in user quota modification log#2937
feitianbubu wants to merge 1 commit intoQuantumNous:mainfrom
feitianbubu:pr/f944dd3beed1a58c41f10155f65988da904efc0a

Conversation

@feitianbubu
Copy link
Contributor

@feitianbubu feitianbubu commented Feb 13, 2026

修改用户余额记录增加管理员用户名

Summary by CodeRabbit

  • Bug Fixes
    • Improved admin audit logging to display the admin username when user quotas are modified, providing better tracking and transparency of administrative actions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

The admin action log message in the UpdateUser function is enhanced to include the admin's username when quota modifications occur. The log format changes from omitting to including the admin's identifier in the message string.

Changes

Cohort / File(s) Summary
Admin Action Logging
controller/user.go
Updated quota modification audit log to include admin username in the message format, changing from "管理员将用户额度从 %s修改为 %s" to "管理员(%s)将用户额度从 %s修改为 %s" by adding c.GetString("username") parameter.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A whisker of audit, so clear and so bright,
Admin names logged with each quota update done right,
No logic was bent, just a log message refined,
Accountability trails, neatly signed and aligned! 📝

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding admin username to user quota modification logs, which is exactly what the code change implements.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Comments