2024-05-31 12:36:48 +00:00
|
|
|
package mysqlrefertime
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
2024-07-24 23:45:04 +00:00
|
|
|
"time"
|
|
|
|
|
2024-05-31 12:36:48 +00:00
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/repository/mysql"
|
|
|
|
)
|
|
|
|
|
|
|
|
func scanReferTime(scanner mysql.Scanner) (entity.ReferTime, error) {
|
|
|
|
var referTime entity.ReferTime
|
|
|
|
var (
|
|
|
|
status string
|
|
|
|
createdAt time.Time
|
|
|
|
updatedAt time.Time
|
|
|
|
deletedAt sql.NullTime
|
|
|
|
)
|
|
|
|
err := scanner.Scan(
|
|
|
|
&referTime.ID,
|
|
|
|
&referTime.Duration,
|
|
|
|
&status,
|
|
|
|
&createdAt,
|
|
|
|
&updatedAt,
|
|
|
|
&deletedAt,
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
return entity.ReferTime{}, err
|
|
|
|
}
|
2024-08-01 10:20:18 +00:00
|
|
|
referTime.Status = entity.ReferTimeStatus(status)
|
2024-07-24 23:45:04 +00:00
|
|
|
|
2024-05-31 12:36:48 +00:00
|
|
|
return referTime, nil
|
|
|
|
}
|