:card_box: Add more fields into product

This commit is contained in:
2025-01-08 22:55:45 +08:00
parent 9c3eb0a3f4
commit 2de4f3a606
2 changed files with 7 additions and 1 deletions

View File

@@ -8,9 +8,11 @@ import (
type Product struct {
cruda.BaseModel
Icon string `json:"icon"` // random id of atttachment
Name string `json:"name"`
Alias string `json:"alias" gorm:"uniqueIndex"`
Description string `json:"description"`
Previews datatypes.JSONSlice[string] `json:"previews"` // random id of attachments
Tags datatypes.JSONSlice[string] `json:"tags"`
Meta ProductMeta `json:"meta" gorm:"foreignKey:ProductID"`
@@ -22,7 +24,7 @@ type ProductMeta struct {
cruda.BaseModel
Introduction string `json:"introduction"`
Attachments datatypes.JSONSlice[string] `json:"attachments"`
Attachments datatypes.JSONSlice[string] `json:"attachments"` // random id of attachments
ProductID uint `json:"product_id"`
}