62 lines
2.3 KiB
Go
62 lines
2.3 KiB
Go
package models
|
|
|
|
// SimplifiedAddon contains only essential addon information for API responses
|
|
type SimplifiedAddon struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
Summary string `json:"summary"`
|
|
SubscriberCount int `json:"subscriberCount"`
|
|
CurrentVersionNumber string `json:"currentVersionNumber"`
|
|
Preview string `json:"preview"`
|
|
Author string `json:"author"`
|
|
AddonFiles []SimplifiedAddonFile `json:"addonFiles"`
|
|
}
|
|
|
|
// SimplifiedAddonFile contains only essential addon file information for API responses
|
|
type SimplifiedAddonFile struct {
|
|
Path string `json:"path"`
|
|
Hash string `json:"hash"`
|
|
Version string `json:"version"`
|
|
AddonID string `json:"addonId"`
|
|
}
|
|
|
|
// DuplicateFileInfo holds information about a duplicate file
|
|
type DuplicateFileInfo struct {
|
|
Path string `json:"path"`
|
|
Hash string `json:"hash"`
|
|
Version string `json:"version"`
|
|
AddonID string `json:"addonId"`
|
|
}
|
|
|
|
// AddonWithDuplicates holds addon information and its duplicate files
|
|
type AddonWithDuplicates struct {
|
|
Addon SimplifiedAddon `json:"addon"`
|
|
Duplicates []DuplicateFileInfo `json:"duplicates"`
|
|
}
|
|
|
|
// DuplicatesResponse is the main response structure
|
|
type DuplicatesResponse struct {
|
|
SourceAddon SimplifiedAddon `json:"sourceAddon"`
|
|
DuplicateAddons map[string]AddonWithDuplicates `json:"duplicateAddons"`
|
|
}
|
|
|
|
// AddonSearchResult contains minimal addon information for search results
|
|
type AddonSearchResult struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
Summary string `json:"summary"`
|
|
Preview string `json:"preview"`
|
|
SubscriberCount int `json:"subscriberCount"`
|
|
CurrentVersionNumber string `json:"currentVersionNumber"`
|
|
Author string `json:"author"`
|
|
}
|
|
|
|
// SearchResponse contains the search results
|
|
type SearchResponse struct {
|
|
Query string `json:"query"`
|
|
Results []AddonSearchResult `json:"results"`
|
|
Total int `json:"total"`
|
|
}
|