Initial commit

This commit is contained in:
2026-01-19 12:12:29 +07:00
commit 2072052437
42 changed files with 5450 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package model
import (
"time"
)
const TableNamePayment = "payment"
// Payment mapped from table <payment>
type Payment struct {
ID string `gorm:"column:id;primaryKey;default:gen_random_uuid()" json:"id"`
UserID string `gorm:"column:user_id;not null" json:"user_id"`
PlanID string `gorm:"column:plan_id" json:"plan_id"`
Amount float64 `gorm:"column:amount;not null" json:"amount"`
Currency string `gorm:"column:currency;not null;default:USD" json:"currency"`
Status string `gorm:"column:status;not null;default:PENDING" json:"status"`
Provider string `gorm:"column:provider;not null;default:STRIPE" json:"provider"`
TransactionID string `gorm:"column:transaction_id" json:"transaction_id"`
CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}
// TableName Payment's table name
func (*Payment) TableName() string {
return TableNamePayment
}

View File

@@ -0,0 +1,27 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package model
const TableNamePlan = "plan"
// Plan mapped from table <plan>
type Plan struct {
ID string `gorm:"column:id;primaryKey;default:gen_random_uuid()" json:"id"`
Name string `gorm:"column:name;not null" json:"name"`
Description string `gorm:"column:description" json:"description"`
Price float64 `gorm:"column:price;not null" json:"price"`
Cycle string `gorm:"column:cycle;not null" json:"cycle"`
StorageLimit int64 `gorm:"column:storage_limit;not null" json:"storage_limit"`
UploadLimit int32 `gorm:"column:upload_limit;not null" json:"upload_limit"`
DurationLimit int32 `gorm:"column:duration_limit;not null" json:"duration_limit"`
QualityLimit string `gorm:"column:quality_limit;not null" json:"quality_limit"`
Features string `gorm:"column:features" json:"features"`
IsActive bool `gorm:"column:is_active;not null;default:true" json:"is_active"`
}
// TableName Plan's table name
func (*Plan) TableName() string {
return TableNamePlan
}

View File

@@ -0,0 +1,31 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package model
import (
"time"
)
const TableNameUser = "user"
// User mapped from table <user>
type User struct {
ID string `gorm:"column:id;primaryKey;default:gen_random_uuid()" json:"id"`
Email string `gorm:"column:email;not null" json:"email"`
Password string `gorm:"column:password" json:"-"`
Username string `gorm:"column:username" json:"username"`
Avatar string `gorm:"column:avatar" json:"avatar"`
Role string `gorm:"column:role;not null;default:USER" json:"role"`
GoogleID string `gorm:"column:google_id" json:"google_id"`
StorageUsed int64 `gorm:"column:storage_used;not null" json:"storage_used"`
PlanID string `gorm:"column:plan_id" json:"plan_id"`
CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}
// TableName User's table name
func (*User) TableName() string {
return TableNameUser
}

View File

@@ -0,0 +1,38 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package model
import (
"time"
)
const TableNameVideo = "video"
// Video mapped from table <video>
type Video struct {
ID string `gorm:"column:id;primaryKey;default:gen_random_uuid()" json:"id"`
Name string `gorm:"column:name;not null" json:"name"`
Title string `gorm:"column:title;not null" json:"title"`
Description string `gorm:"column:description" json:"description"`
URL string `gorm:"column:url;not null" json:"url"`
Thumbnail string `gorm:"column:thumbnail" json:"thumbnail"`
HlsToken string `gorm:"column:hls_token" json:"hls_token"`
HlsPath string `gorm:"column:hls_path" json:"hls_path"`
Duration int32 `gorm:"column:duration;not null" json:"duration"`
Size int64 `gorm:"column:size;not null" json:"size"`
StorageType string `gorm:"column:storage_type;not null;default:tiktok_avatar" json:"storage_type"`
Format string `gorm:"column:format;not null" json:"format"`
Status string `gorm:"column:status;not null;default:PUBLIC" json:"status"`
ProcessingStatus string `gorm:"column:processing_status;not null;default:PENDING" json:"processing_status"`
Views int32 `gorm:"column:views;not null" json:"views"`
UserID string `gorm:"column:user_id;not null" json:"user_id"`
CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}
// TableName Video's table name
func (*Video) TableName() string {
return TableNameVideo
}