🎉 Initial Commit
This commit is contained in:
36
pkg/internal/models/release.go
Normal file
36
pkg/internal/models/release.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
|
||||
"gorm.io/datatypes"
|
||||
)
|
||||
|
||||
type ProductReleaseType int
|
||||
|
||||
const (
|
||||
ReleaseTypeMinor = ProductReleaseType(iota)
|
||||
ReleaseTypeRegular
|
||||
ReleaseTypeMajor
|
||||
)
|
||||
|
||||
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"`
|
||||
|
||||
ProductID uint `json:"product_id"`
|
||||
Meta ProductReleaseMeta `json:"meta" gorm:"foreignKey:ReleaseID"`
|
||||
}
|
||||
|
||||
type ProductReleaseMeta struct {
|
||||
cruda.BaseModel
|
||||
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Content string `json:"content"`
|
||||
Attachments datatypes.JSONSlice[string] `json:"attachments"`
|
||||
ReleaseID uint `json:"release_id"`
|
||||
}
|
Reference in New Issue
Block a user