拆分支付配置 Repository 文件职责
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user