video_oper.go 614 B

1234567891011121314151617181920212223
  1. package archive
  2. import (
  3. "context"
  4. "go-common/library/database/sql"
  5. "go-common/library/log"
  6. )
  7. const (
  8. _inVideoOperSQL = "INSERT INTO archive_video_oper(aid,uid,vid,status,attribute,last_id) VALUES(?,399,?,?,?,1)"
  9. )
  10. //TranVideoOper insert a record
  11. func (d *Dao) TranVideoOper(c context.Context, tx *sql.Tx, aid, vid int64, status int16, attr int32) (rows int64, err error) {
  12. res, err := tx.Exec(_inVideoOperSQL, aid, vid, status, attr)
  13. if err != nil {
  14. log.Error("tx.Exec(%s, %d, %d, %d, %d) error(%v)", _inVideoOperSQL, aid, vid, status, attr, err)
  15. return
  16. }
  17. rows, err = res.RowsAffected()
  18. return
  19. }