feat: update

This commit is contained in:
Rogee
2025-05-28 19:40:50 +08:00
parent fa87d18276
commit 1a9dd1d30d
5 changed files with 21 additions and 15 deletions

View File

@@ -1,12 +1,14 @@
// Code generated by the atomctl ; DO NOT EDIT.
// Code generated by the atomctl ; DO NOT EDIT.
// Code generated by the atomctl ; DO NOT EDIT.
package model
import (
"context"
"time"
. "github.com/go-jet/jet/v2/postgres"
"github.com/samber/lo"
log "github.com/sirupsen/logrus"
"time"
)
// conds
@@ -49,7 +51,6 @@ func (m *Medias) BatchCreate(ctx context.Context, models []*Medias) error {
m.log().WithField("func", "BatchCreate").Infof("Medias items created successfully")
return nil
}
func (m *Medias) Delete(ctx context.Context) error {
stmt := tblMedias.DELETE().WHERE(tblMedias.ID.EQ(Int(m.ID)))
m.log().WithField("func", "Delete").Info(stmt.DebugSql())
@@ -82,6 +83,7 @@ func (m *Medias) BatchDelete(ctx context.Context, ids []int64) error {
}
func (m *Medias) Update(ctx context.Context) error {
stmt := tblMedias.UPDATE(tblMediasUpdateMutableColumns).MODEL(m).WHERE(tblMedias.ID.EQ(Int(m.ID))).RETURNING(tblMedias.AllColumns)
m.log().WithField("func", "Update").Info(stmt.DebugSql())