playerCheck.go 909 B

12345678910111213141516171819202122232425262728
  1. package dao
  2. import (
  3. "context"
  4. "time"
  5. "go-common/library/log"
  6. xtime "go-common/library/time"
  7. )
  8. const (
  9. _inPlayCheckSQL = `INSERT INTO campus_network_check_record (platform,check_time,isp,region,school,mid,ip,ip_change_times,cdn,connect_speed,io_speed,aid,ctime,mtime) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)`
  10. )
  11. // InPlayCheck insert player check info into db
  12. func (d *Dao) InPlayCheck(c context.Context, platform, isp, ipChangeTimes int, mid, checkTime, aid, connectSpeed, ioSpeed int64, region, school, ip, cdn string) (rows int64, err error) {
  13. var (
  14. now = time.Now()
  15. checkTime2 = xtime.Time(checkTime).Time()
  16. )
  17. res, err := d.dbMs.Exec(c, _inPlayCheckSQL, platform, checkTime2, isp, region, school, mid, ip, ipChangeTimes, cdn, connectSpeed, ioSpeed, aid, now, now)
  18. if err != nil {
  19. log.Error("d.InPlayCheck.Exec() error(%v)", err)
  20. return
  21. }
  22. rows, err = res.RowsAffected()
  23. return
  24. }