go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/projects/chirp/pkg/model/chirp_stats.go (about)

     1  /*
     2  
     3  Copyright (c) 2023 - Present. Will Charczuk. All rights reserved.
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file at the root of the repository.
     5  
     6  */
     7  
     8  package model
     9  
    10  import "go.charczuk.com/sdk/uuid"
    11  
    12  // ChirpStats are stats about chrips e.g. likes and rechirps.
    13  type ChirpStats struct {
    14  	ChirpID  uuid.UUID `db:"chirp_id,pk"`
    15  	UserID   uuid.UUID `db:"user_id"`
    16  	Replies  uint64    `db:"replies"`
    17  	Likes    uint64    `db:"likes"`
    18  	Rechirps uint64    `db:"rechirps"`
    19  }
    20  
    21  // TableName is the mapped table name.
    22  func (c ChirpStats) TableName() string { return "chirp_stats" }