hiling_go/db/sqlc/models.go
2024-02-06 11:55:25 +07:00

329 lines
10 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.25.0
package db
import (
"database/sql/driver"
"fmt"
"github.com/jackc/pgx/v5/pgtype"
)
type CommentType string
const (
CommentTypeStories CommentType = "stories"
CommentTypeNews CommentType = "news"
CommentTypeReviews CommentType = "reviews"
CommentTypeLocations CommentType = "locations"
)
func (e *CommentType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = CommentType(s)
case string:
*e = CommentType(s)
default:
return fmt.Errorf("unsupported scan type for CommentType: %T", src)
}
return nil
}
type NullCommentType struct {
CommentType CommentType `json:"comment_type"`
Valid bool `json:"valid"` // Valid is true if CommentType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullCommentType) Scan(value interface{}) error {
if value == nil {
ns.CommentType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.CommentType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullCommentType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.CommentType), nil
}
type LocationType string
const (
LocationTypeBeach LocationType = "beach"
LocationTypeAmusementpark LocationType = "amusement park"
LocationTypeCulinary LocationType = "culinary"
LocationTypeHikingCamping LocationType = "hiking / camping"
LocationTypeOther LocationType = "other"
)
func (e *LocationType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = LocationType(s)
case string:
*e = LocationType(s)
default:
return fmt.Errorf("unsupported scan type for LocationType: %T", src)
}
return nil
}
type NullLocationType struct {
LocationType LocationType `json:"location_type"`
Valid bool `json:"valid"` // Valid is true if LocationType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullLocationType) Scan(value interface{}) error {
if value == nil {
ns.LocationType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.LocationType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullLocationType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.LocationType), nil
}
type UserReportsType string
const (
UserReportsTypeComments UserReportsType = "comments"
UserReportsTypeReviews UserReportsType = "reviews"
UserReportsTypeLocations UserReportsType = "locations"
UserReportsTypeUsers UserReportsType = "users"
UserReportsTypeStories UserReportsType = "stories"
)
func (e *UserReportsType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = UserReportsType(s)
case string:
*e = UserReportsType(s)
default:
return fmt.Errorf("unsupported scan type for UserReportsType: %T", src)
}
return nil
}
type NullUserReportsType struct {
UserReportsType UserReportsType `json:"user_reports_type"`
Valid bool `json:"valid"` // Valid is true if UserReportsType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullUserReportsType) Scan(value interface{}) error {
if value == nil {
ns.UserReportsType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.UserReportsType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullUserReportsType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.UserReportsType), nil
}
type ClientIp struct {
ID int32 `json:"id"`
Ipv4 string `json:"ipv4"`
Ipv6 pgtype.Text `json:"ipv6"`
BannedAt pgtype.Timestamp `json:"banned_at"`
BannedUntil pgtype.Timestamp `json:"banned_until"`
Reason pgtype.Text `json:"reason"`
IsPermaban pgtype.Bool `json:"is_permaban"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type Comment struct {
ID int32 `json:"id"`
SubmittedBy int32 `json:"submitted_by"`
CommentOn int32 `json:"comment_on"`
CommentType CommentType `json:"comment_type"`
ReplyTo pgtype.Int4 `json:"reply_to"`
IsHide pgtype.Bool `json:"is_hide"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type Image struct {
ID int32 `json:"id"`
ImageUrl string `json:"image_url"`
UploadedBy int32 `json:"uploaded_by"`
ImageType string `json:"image_type"`
ImageOf int32 `json:"image_of"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type Location struct {
ID int32 `json:"id"`
Address string `json:"address"`
Name string `json:"name"`
GoogleMapsLink pgtype.Text `json:"google_maps_link"`
LocationType LocationType `json:"location_type"`
SubmittedBy int32 `json:"submitted_by"`
TotalVisited pgtype.Int4 `json:"total_visited"`
Thumbnail pgtype.Text `json:"thumbnail"`
RegencyID int16 `json:"regency_id"`
IsDeleted bool `json:"is_deleted"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
ApprovedBy pgtype.Int4 `json:"approved_by"`
ApprovedAt pgtype.Timestamp `json:"approved_at"`
}
type LocationImage struct {
ID int32 `json:"id"`
Url string `json:"url"`
LocationID int32 `json:"location_id"`
UploadedBy pgtype.Int4 `json:"uploaded_by"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type NewsEvent struct {
ID int32 `json:"id"`
Title string `json:"title"`
Url string `json:"url"`
Source string `json:"source"`
Thumbnail pgtype.Text `json:"thumbnail"`
Description pgtype.Text `json:"description"`
IsDeleted bool `json:"is_deleted"`
SubmittedBy int32 `json:"submitted_by"`
ApprovedBy pgtype.Int4 `json:"approved_by"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type Province struct {
ID int32 `json:"id"`
ProvinceName string `json:"province_name"`
RegionID int16 `json:"region_id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type Regency struct {
ID int32 `json:"id"`
RegencyName string `json:"regency_name"`
ProvinceID int16 `json:"province_id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type Region struct {
ID int32 `json:"id"`
RegionName string `json:"region_name"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type Review struct {
ID int32 `json:"id"`
SubmittedBy int32 `json:"submitted_by"`
Comments string `json:"comments"`
Score int16 `json:"score"`
IsFromCritic bool `json:"is_from_critic"`
CostApprox pgtype.Int4 `json:"cost_approx"`
IsHided bool `json:"is_hided"`
LocationID int32 `json:"location_id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type Tag struct {
ID int32 `json:"id"`
Name string `json:"name"`
SubmittedBy int32 `json:"submitted_by"`
TargetID int32 `json:"target_id"`
TagsType string `json:"tags_type"`
ApprovedBy pgtype.Int4 `json:"approved_by"`
}
type User struct {
ID int32 `json:"id"`
Email pgtype.Text `json:"email"`
Username string `json:"username"`
Password string `json:"password"`
AvatarPicture pgtype.Text `json:"avatar_picture"`
GoogleSignInPayload pgtype.Text `json:"google_sign_in_payload"`
BannedAt pgtype.Timestamp `json:"banned_at"`
BannedUntil pgtype.Timestamp `json:"banned_until"`
BanReason pgtype.Text `json:"ban_reason"`
IsPermaban pgtype.Bool `json:"is_permaban"`
IsAdmin pgtype.Bool `json:"is_admin"`
IsCritics pgtype.Bool `json:"is_critics"`
IsVerified pgtype.Bool `json:"is_verified"`
IsActive pgtype.Bool `json:"is_active"`
SocialMedia []byte `json:"social_media"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
About pgtype.Text `json:"about"`
Website pgtype.Text `json:"website"`
}
type UserActivity struct {
ID int32 `json:"id"`
TargetID int32 `json:"target_id"`
Target string `json:"target"`
Action string `json:"action"`
Link pgtype.Text `json:"link"`
Comment pgtype.Text `json:"comment"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type UserFollow struct {
ID int32 `json:"id"`
FollowerID int32 `json:"follower_id"`
FolloweeID int32 `json:"followee_id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type UserReport struct {
ID int32 `json:"id"`
Message string `json:"message"`
Date pgtype.Timestamp `json:"date"`
ReportTarget int32 `json:"report_target"`
ReportType UserReportsType `json:"report_type"`
SubmittedBy int32 `json:"submitted_by"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type UserSession struct {
ID int32 `json:"id"`
IndexID int64 `json:"index_id"`
Username string `json:"username"`
RefreshToken string `json:"refresh_token"`
UserAgent string `json:"user_agent"`
ClientIp string `json:"client_ip"`
IsBlocked bool `json:"is_blocked"`
ExpiresAt pgtype.Timestamp `json:"expires_at"`
CreatedAt pgtype.Timestamp `json:"created_at"`
}