fix(lint): 修复所有 Go 命名规范问题

- 全局替换 ApiKey → APIKey(类型、字段、方法、变量)
- 修复所有 initialism 命名(API, SMTP, HTML, URL 等)
- 添加所有缺失的包注释
- 修复导出符号的注释格式

主要修改:
- ApiKey → APIKey(所有出现的地方)
- ApiKeyID → APIKeyID
- ApiKeyIDs → APIKeyIDs
- TestSmtpConnection → TestSMTPConnection
- HtmlURL → HTMLURL
- 添加 20+ 个包注释
- 修复 10+ 个导出符号注释格式

验证结果:
- ✓ golangci-lint: 0 issues
- ✓ 单元测试: 通过
- ✓ 集成测试: 通过
This commit is contained in:
IanShaw027
2026-01-04 19:27:53 +08:00
parent d92e71a1f0
commit a4953785d9
121 changed files with 2747 additions and 2725 deletions

View File

@@ -85,7 +85,7 @@ const (
UserColumn = "user_id"
// APIKeyTable is the table that holds the api_key relation/edge.
APIKeyTable = "usage_logs"
// APIKeyInverseTable is the table name for the ApiKey entity.
// APIKeyInverseTable is the table name for the APIKey entity.
// It exists in this package in order to avoid circular dependency with the "apikey" package.
APIKeyInverseTable = "api_keys"
// APIKeyColumn is the table column denoting the api_key relation/edge.

View File

@@ -1175,7 +1175,7 @@ func HasAPIKey() predicate.UsageLog {
}
// HasAPIKeyWith applies the HasEdge predicate on the "api_key" edge with a given conditions (other predicates).
func HasAPIKeyWith(preds ...predicate.ApiKey) predicate.UsageLog {
func HasAPIKeyWith(preds ...predicate.APIKey) predicate.UsageLog {
return predicate.UsageLog(func(s *sql.Selector) {
step := newAPIKeyStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {