netsafe.go 412 B

1234567891011121314151617181920
  1. package archive
  2. import (
  3. "context"
  4. "go-common/library/log"
  5. )
  6. const (
  7. _inNetsafeSQL = "INSERT INTO netsafe (nid,md5) VALUES (?,?)"
  8. )
  9. // AddNetSafeMd5 fn
  10. func (d *Dao) AddNetSafeMd5(c context.Context, nid int64, md5 string) (rows int64, err error) {
  11. res, err := d.db.Exec(c, _inNetsafeSQL, nid, md5)
  12. if err != nil {
  13. log.Error("_inNetsafeSQL.Exec error(%v)", err)
  14. return
  15. }
  16. return res.RowsAffected()
  17. }