12345678910111213141516171819202122232425262728 |
- package service
-
- import (
- "fmt"
- "time"
-
- "XT_New/models"
- "XT_New/utils"
- )
-
- func CreateDBErrorRecord(orgID int64, decsFormat string, v ...interface{}) {
- if orgID < 0 {
- orgID = 0
- }
- now := time.Now()
- record := models.DBErrorRecord{
- OrgID: orgID,
- ErrDesc: fmt.Sprintf(decsFormat, v...),
- Status: 1,
- CreateTime: now.Unix(),
- ModifyTime: now.Unix(),
- }
- insertErr := writeDb.Save(&record).Error
- if insertErr != nil {
- utils.ErrorLog("插入数据库执行错误记录失败:%v", insertErr)
- }
- }
|