first try

This commit is contained in:
Sotirios Pupakis
2025-09-05 17:44:49 +02:00
parent f0aadeb2c7
commit 72731aeb10
10 changed files with 360 additions and 0 deletions

29
models/addon.go Normal file
View File

@@ -0,0 +1,29 @@
package models
import (
"time"
)
type Addon struct {
ID string `gorm:"primaryKey" json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Summary string `json:"summary"`
Unlisted bool `json:"unlisted"`
Private bool `json:"private"`
Blocked bool `json:"blocked"`
SubscriberCount int `json:"subscriberCount"`
CurrentVersionNumber string `json:"currentVersionNumber"`
CurrentVersionSize int `json:"currentVersionSize"`
CurrentVersionID int `json:"currentVersionId"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ToBeIndexed bool `json:"toBeIndexed" gorm:"default:true"`
IsBeingIndexed bool `json:"isBeingIndexed" gorm:"default:false"`
IndexStartTime time.Time `json:"indexStartTime"`
PriorityIndexing bool `json:"priorityIndexing" gorm:"default:false"`
AddonFiles []AddonFile `json:"addonFiles"`
Previews string `json:"preview"`
Author string `json:"author"`
}

11
models/addonFiles.go Normal file
View File

@@ -0,0 +1,11 @@
package models
import "gorm.io/gorm"
type AddonFile struct {
gorm.Model
Path string `json:"path"`
Hash string `json:"hash"`
AddonID string `json:"-"`
VersionID int `json:"versionId"`
}