Compare commits
2 Commits
7ec18926e3
...
196d2069ac
| Author | SHA1 | Date | |
|---|---|---|---|
| 196d2069ac | |||
| 7596cbde09 |
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user