报错修改

This commit is contained in:
meixiongfeng 2022-06-14 12:54:40 +08:00
parent fd6903dcf1
commit c63c16a2b7
2 changed files with 7 additions and 8 deletions

View File

@ -36,12 +36,12 @@ func (this *MComp_DBComp) Start() (err error) {
return return
} }
func (this *MComp_DBComp) InsertModelLogs(table string, uID string, dbType comm.LogHandleType, where interface{}, target interface{}) (err error) { func (this *MComp_DBComp) InsertModelLogs(table string, uID string, target interface{}) (err error) {
data := &comm.Autogenerated{ data := &comm.Autogenerated{
ID: primitive.NewObjectID().Hex(), ID: primitive.NewObjectID().Hex(),
UID: uID, UID: uID,
Act: string(dbType), Act: string(comm.LogHandleType_Insert),
} }
data.D = append(data.D, table) // D[0] data.D = append(data.D, table) // D[0]
data.D = append(data.D, target) // D[1] data.D = append(data.D, target) // D[1]
@ -53,12 +53,12 @@ func (this *MComp_DBComp) InsertModelLogs(table string, uID string, dbType comm.
return err return err
} }
func (this *MComp_DBComp) DeleteModelLogs(table string, uID string, dbType comm.LogHandleType, where interface{}, target interface{}) (err error) { func (this *MComp_DBComp) DeleteModelLogs(table string, uID string, where interface{}, target interface{}) (err error) {
data := &comm.Autogenerated{ data := &comm.Autogenerated{
ID: primitive.NewObjectID().Hex(), ID: primitive.NewObjectID().Hex(),
UID: uID, UID: uID,
Act: string(dbType), Act: string(comm.LogHandleType_Delete),
} }
data.D = append(data.D, table) // D[0] data.D = append(data.D, table) // D[0]
@ -72,12 +72,12 @@ func (this *MComp_DBComp) DeleteModelLogs(table string, uID string, dbType comm.
return err return err
} }
func (this *MComp_DBComp) UpdateModelLogs(table string, uID string, dbType comm.LogHandleType, where interface{}, target interface{}) (err error) { func (this *MComp_DBComp) UpdateModelLogs(table string, uID string, where interface{}, target interface{}) (err error) {
data := &comm.Autogenerated{ data := &comm.Autogenerated{
ID: primitive.NewObjectID().Hex(), ID: primitive.NewObjectID().Hex(),
UID: uID, UID: uID,
Act: string(dbType), Act: string(comm.LogHandleType_Update),
} }
data.D = append(data.D, table) // D[0] data.D = append(data.D, table) // D[0]
data.D = append(data.D, where) // D[1] data.D = append(data.D, where) // D[1]

View File

@ -1,7 +1,6 @@
package modules package modules
import ( import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"testing" "testing"
@ -23,7 +22,7 @@ func TestCreatemoudles(t *testing.T) {
Check: false, Check: false,
Reward: false, Reward: false,
} }
obj.InsertModelLogs("mail", "uid123", comm.LogHandleType_Insert, _mail) obj.InsertModelLogs("mail", "uid123", _mail)
log.Debugf("insert : %v", _mail) log.Debugf("insert : %v", _mail)
} }