23 lines
421 B
Go
23 lines
421 B
Go
package dao
|
|
|
|
import (
|
|
"context"
|
|
|
|
"model-asynch/consts/public"
|
|
"model-asynch/model/entity"
|
|
|
|
"gitea.com/red-future/common/db/gfdb"
|
|
)
|
|
|
|
type opLogDao struct{}
|
|
|
|
var OpLog = &opLogDao{}
|
|
|
|
func (d *opLogDao) Insert(ctx context.Context, log *entity.AsynchOpLog) (id int64, err error) {
|
|
r, err := gfdb.DB(ctx).Model(ctx, public.TableNameOpLog).Data(log).Insert()
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
return r.LastInsertId()
|
|
}
|