first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:35:24 +03:00
commit bbbf76b184
592 changed files with 246870 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package models
import (
"time"
"github.com/google/uuid"
)
// PostCategoryView tracks visits to post categories.
type PostCategoryView struct {
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey" json:"id"`
CategoryID uuid.UUID `gorm:"not null;index:idx_post_category_views,priority:1" json:"category_id"`
Category PostCategory `gorm:"foreignKey:CategoryID" json:"category"`
IPAddress string `gorm:"type:varchar(64);not null;index:idx_post_category_views,priority:2" json:"ip_address"`
UserAgent string `gorm:"type:text" json:"user_agent,omitempty"`
CreatedAt time.Time `gorm:"index:idx_post_category_views,priority:3" json:"created_at"`
}
// TableName overrides the table name used by PostCategoryView.
func (PostCategoryView) TableName() string {
return "post_category_views"
}