mirror of
https://github.com/Alexander-D-Karpov/webring.git
synced 2026-03-16 22:07:41 +03:00
* fix: Make data API route paths consistent * feat: Implement redirect for current website * feat: Implement slugs and id reordering * feat: Implement slug validation * fix: Add constant zero ID to public site data for compatibility * fix: Make slug length limited when validating * docs: Update routes in README.md * feat: Implement gapless reordering * fix: Add IDs back to public data * feat: Implement ID/slug collision checks
26 lines
577 B
Go
26 lines
577 B
Go
package models
|
|
|
|
type Site struct {
|
|
ID int `json:"id"`
|
|
Slug string `json:"slug"`
|
|
Name string `json:"name"`
|
|
URL string `json:"url"`
|
|
IsUp bool `json:"is_up"`
|
|
LastCheck float64 `json:"last_check"`
|
|
Favicon *string `json:"favicon"`
|
|
}
|
|
|
|
type PublicSite struct {
|
|
ID int `json:"id"`
|
|
Slug string `json:"slug"`
|
|
Name string `json:"name"`
|
|
URL string `json:"url"`
|
|
Favicon *string `json:"favicon"`
|
|
}
|
|
|
|
type SiteData struct {
|
|
Prev PublicSite `json:"prev"`
|
|
Curr PublicSite `json:"curr"`
|
|
Next PublicSite `json:"next"`
|
|
}
|