代码质量改进:修复架构违规、完善文档注释和清理冗余代码

- 修复 health.go handler 直接操作响应的架构违规问题
- 为 model 字段添加 GORM comment 标签(account_role、base、role_permission)
- 为 handler、service、store 包添加包级文档注释
- 清理 customer service 和 personal_customer handler 中注释掉的代码

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-12 16:28:48 +08:00
parent 590614aecc
commit 4507de577b
17 changed files with 50 additions and 41 deletions

View File

@@ -1,3 +1,5 @@
// Package account 提供账号管理的业务逻辑服务
// 包含账号创建、查询、更新、删除、密码管理等功能
package account
import (

View File

@@ -1,3 +1,5 @@
// Package customer 提供客户管理的业务逻辑服务
// 包含客户信息管理、客户查询等功能
package customer
import (
@@ -47,16 +49,7 @@ func (s *Service) Create(ctx context.Context, req *model.CreatePersonalCustomerR
return nil, err
}
// TODO: 创建 PersonalCustomerPhone 记录
// if req.Phone != "" {
// phoneRecord := &model.PersonalCustomerPhone{
// CustomerID: customer.ID,
// Phone: req.Phone,
// IsPrimary: true,
// Status: constants.StatusEnabled,
// }
// // 需要通过 PersonalCustomerPhoneStore 创建
// }
// TODO: 创建 PersonalCustomerPhone 记录,需要通过 PersonalCustomerPhoneStore 创建手机号关联
return customer, nil
}
@@ -69,11 +62,7 @@ func (s *Service) Update(ctx context.Context, id uint, req *model.UpdatePersonal
return nil, errors.New(errors.CodeCustomerNotFound, "个人客户不存在")
}
// 注意:手机号的更新逻辑需要通过 PersonalCustomerPhone 表处理
// TODO: 实现手机号的更新逻辑
// if req.Phone != nil {
// // 通过 PersonalCustomerPhoneStore 更新或创建手机号记录
// }
// TODO: 手机号的更新逻辑需要通过 PersonalCustomerPhoneStore 更新或创建手机号记录
// 更新字段
if req.Nickname != nil {

View File

@@ -1,3 +1,5 @@
// Package email 提供邮件发送的业务逻辑服务
// 包含邮件发送、邮件模板管理等功能
package email
import (

View File

@@ -1,3 +1,5 @@
// Package enterprise 提供企业管理的业务逻辑服务
// 包含企业创建、查询、更新、删除等功能
package enterprise
import (

View File

@@ -1,3 +1,5 @@
// Package permission 提供权限管理的业务逻辑服务
// 包含权限创建、查询、更新、删除、权限检查等功能
package permission
import (

View File

@@ -1,3 +1,5 @@
// Package personal_customer 提供个人客户管理的业务逻辑服务
// 包含个人客户注册、登录、微信绑定、短信验证等功能
package personal_customer
import (

View File

@@ -1,3 +1,5 @@
// Package role 提供角色管理的业务逻辑服务
// 包含角色创建、查询、更新、删除、角色权限关联等功能
package role
import (

View File

@@ -1,3 +1,5 @@
// Package shop 提供店铺管理的业务逻辑服务
// 包含店铺创建、查询、更新、删除等功能
package shop
import (

View File

@@ -1,3 +1,5 @@
// Package sync 提供数据同步的业务逻辑服务
// 包含批量数据同步、任务调度等功能
package sync
import (

View File

@@ -1,3 +1,5 @@
// Package verification 提供验证码管理的业务逻辑服务
// 包含短信验证码生成、发送、验证等功能
package verification
import (