拆分支付配置 Repository 文件职责

This commit is contained in:
yml2213
2026-06-10 14:31:05 +08:00
parent 60ff513463
commit 78cb681bec
8 changed files with 881 additions and 792 deletions
@@ -0,0 +1,27 @@
package paymentconfig
import (
"encoding/json"
"hfb_sys/backend/internal/model"
"gorm.io/gorm"
)
func appendAuditLog(tx *gorm.DB, actorID uint64, action string, bizID uint64, meta AuditMeta, detail map[string]any) error {
detailJSON, err := json.Marshal(detail)
if err != nil {
return err
}
log := model.AuditLog{
ActorType: "admin",
ActorID: actorID,
Action: action,
BizType: "payment_config",
BizID: &bizID,
IP: meta.IP,
UserAgent: meta.UserAgent,
Detail: detailJSON,
}
return tx.Create(&log).Error
}