dependencies added
Some checks failed
Cross Compile Go / build (push) Has been cancelled

This commit is contained in:
ilbinek
2026-07-09 14:41:50 +02:00
parent 0b3464c563
commit 0d07148db6
7 changed files with 241 additions and 36 deletions

14
models/addonDependency.go Normal file
View File

@@ -0,0 +1,14 @@
package models
import "time"
// AddonDependency is a directed edge: AddonID depends on DependencyID.
// No soft delete - edges are replaced wholesale on every report.
type AddonDependency struct {
AddonID string `gorm:"primaryKey;size:64" json:"addonId"`
DependencyID string `gorm:"primaryKey;size:64;index:idx_addon_dependencies_dependency_id" json:"dependencyId"`
Version string `json:"version"`
DependencyName string `json:"dependencyName"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}

View File

@@ -53,6 +53,33 @@ type AddonSearchResult struct {
Author string `json:"author"`
}
// DependencyReportItem is one dependency entry reported by the scraper
type DependencyReportItem struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
}
// DependencyReport is the scraper payload that replaces all edges for an addon
type DependencyReport struct {
AddonID string `json:"addonId"`
Dependencies []DependencyReportItem `json:"dependencies"`
}
// DependentsResponse lists the addons that depend on a given addon
type DependentsResponse struct {
AddonID string `json:"addonId"`
Dependents []AddonSearchResult `json:"dependents"`
Total int `json:"total"`
}
// DependenciesResponse lists the addons a given addon depends on
type DependenciesResponse struct {
AddonID string `json:"addonId"`
Dependencies []AddonSearchResult `json:"dependencies"`
Total int `json:"total"`
}
// SearchResponse contains the search results
type SearchResponse struct {
Query string `json:"query"`