diff --git a/dao/task_dao.go b/dao/task_dao.go index 9adb27a..818e9f9 100644 --- a/dao/task_dao.go +++ b/dao/task_dao.go @@ -30,6 +30,19 @@ func (d *taskDao) Insert(ctx context.Context, req *entity.AsynchTask) (id int64, return r.LastInsertId() } +// Update 更新 +func (d *taskDao) Update(ctx context.Context, req *entity.AsynchTask) (rows int64, err error) { + r, err := gfdb.DB(ctx, public.DbNameModelGateway).Model(ctx, public.TableNameTask). + OmitEmpty(). + Data(&req). + Where(entity.AsynchTaskCol.Id, req.Id). + Update() + if err != nil { + return + } + return r.RowsAffected() +} + // Get 获取 func (d *taskDao) Get(ctx context.Context, req *entity.AsynchTask, fields ...string) (m *entity.AsynchTask, err error) { r, err := gfdb.DB(ctx, public.DbNameModelGateway).Model(ctx, public.TableNameTask).