:card_box: Add detailed release model
This commit is contained in:
@ -15,10 +15,11 @@ const (
|
||||
type ProductRelease struct {
|
||||
cruda.BaseModel
|
||||
|
||||
Version string `json:"version"`
|
||||
Type ProductReleaseType `json:"type"`
|
||||
Channel string `json:"channel"`
|
||||
Assets datatypes.JSONType[map[string]any] `json:"assets"`
|
||||
Version string `json:"version"`
|
||||
Type ProductReleaseType `json:"type"`
|
||||
Channel string `json:"channel"`
|
||||
Assets datatypes.JSONType[map[string]ReleaseAsset] `json:"assets"`
|
||||
Installers datatypes.JSONType[map[string]ReleaseInstaller] `json:"installers"`
|
||||
|
||||
ProductID uint `json:"product_id"`
|
||||
Meta ProductReleaseMeta `json:"meta" gorm:"foreignKey:ReleaseID"`
|
||||
@ -33,3 +34,19 @@ type ProductReleaseMeta struct {
|
||||
Attachments datatypes.JSONSlice[string] `json:"attachments"`
|
||||
ReleaseID uint `json:"release_id"`
|
||||
}
|
||||
|
||||
type ReleaseAsset struct {
|
||||
URI string `json:"uri" validate:"required"`
|
||||
ContentType string `json:"content_type" validate:"required"`
|
||||
}
|
||||
|
||||
type ReleaseInstaller struct {
|
||||
Workdir string `json:"workdir"`
|
||||
Script string `json:"script"`
|
||||
Patches []ReleaseInstallerPatch `json:"patches"`
|
||||
}
|
||||
|
||||
type ReleaseInstallerPatch struct {
|
||||
Action string `json:"action" validate:"required"`
|
||||
Glob string `json:"glob" validate:"required"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user