forked from ebhomengo/niki
32 lines
602 B
Go
32 lines
602 B
Go
|
package mysqlrefertime
|
||
|
|
||
|
import (
|
||
|
"database/sql"
|
||
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
||
|
"git.gocasts.ir/ebhomengo/niki/repository/mysql"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
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
|
||
|
}
|
||
|
referTime.Status = entity.MapToReferTimeStatus(status)
|
||
|
return referTime, nil
|
||
|
}
|