123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package ticket
- import (
- "github.com/ClickHouse/clickhouse-go/v2/lib/driver"
- "google.golang.org/protobuf/types/known/timestamppb"
- "time"
- )
- func (x *Ticket) Scan(row driver.Rows) error {
- var (
- from map[string]string
- createdAt time.Time
- updatedAt time.Time
- err error
- )
- if err = row.Scan(
- &x.TicketId,
- &x.ThreadId,
- &x.To,
- &from,
- &x.Flags,
- &x.Meta,
- &x.Tags,
- &createdAt,
- &updatedAt,
- &x.MessageIds,
- &x.Subjects,
- ); err != nil {
- return err
- }
- x.From = &EmailAddress{
- Address: from["address"],
- Name: from["name"],
- }
- x.CreatedAt = timestamppb.New(createdAt)
- x.UpdatedAt = timestamppb.New(updatedAt)
- return nil
- }
|