This commit is contained in:
2026-04-24 00:41:00 +08:00
parent 5693472f64
commit 2bfce239fb
+4
View File
@@ -7,6 +7,8 @@ import (
"strconv" "strconv"
"time" "time"
"gorm.io/gorm"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@@ -18,6 +20,7 @@ type TabWarehouseContainer struct {
Remark string `gorm:"type:text;comment:描述" json:"Remark"` Remark string `gorm:"type:text;comment:描述" json:"Remark"`
CreatedAt *time.Time `gorm:"type:datetime;autoCreateTime" json:"CreatedAt"` CreatedAt *time.Time `gorm:"type:datetime;autoCreateTime" json:"CreatedAt"`
UpdatedAt *time.Time `gorm:"type:datetime;autoUpdateTime" json:"UpdatedAt"` UpdatedAt *time.Time `gorm:"type:datetime;autoUpdateTime" json:"UpdatedAt"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
CreatorID uint `gorm:"not null;index;comment:创建者id" json:"CreatorID"` CreatorID uint `gorm:"not null;index;comment:创建者id" json:"CreatorID"`
ParentID *uint `gorm:"index;comment:父容器idnil=顶级" json:"ParentID"` ParentID *uint `gorm:"index;comment:父容器idnil=顶级" json:"ParentID"`
ItemCount int `gorm:"default:0;comment:直接子物品数量" json:"ItemCount"` ItemCount int `gorm:"default:0;comment:直接子物品数量" json:"ItemCount"`
@@ -32,6 +35,7 @@ type TabWarehouseItem struct {
Quantity int `gorm:"default:1;comment:数量" json:"Quantity"` Quantity int `gorm:"default:1;comment:数量" json:"Quantity"`
CreatedAt *time.Time `gorm:"type:datetime;autoCreateTime" json:"CreatedAt"` CreatedAt *time.Time `gorm:"type:datetime;autoCreateTime" json:"CreatedAt"`
UpdatedAt *time.Time `gorm:"type:datetime;autoUpdateTime" json:"UpdatedAt"` UpdatedAt *time.Time `gorm:"type:datetime;autoUpdateTime" json:"UpdatedAt"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
CreatorID uint `gorm:"not null;index;comment:创建者id" json:"CreatorID"` CreatorID uint `gorm:"not null;index;comment:创建者id" json:"CreatorID"`
ContainerID *uint `gorm:"index;comment:所属容器idnil=未入库" json:"ContainerID"` ContainerID *uint `gorm:"index;comment:所属容器idnil=未入库" json:"ContainerID"`
} }