18 lines
350 B
Go
18 lines
350 B
Go
package impl
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/infraboard/mcube/v2/ioc/config/datasource"
|
|
"gitlab.com/go-course-project/go17/vblog/apps/blog"
|
|
)
|
|
|
|
func (b *BlogServiceImpl) update(ctx context.Context, ins *blog.Blog) error {
|
|
err := datasource.DBFromCtx(ctx).Where("id = ?", ins.Id).Updates(ins).Error
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|