up
This commit is contained in:
@@ -7,33 +7,37 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ---------- 数据表结构 ----------
|
// ---------- 数据表结构 ----------
|
||||||
|
|
||||||
type TabWarehouseContainer struct {
|
type TabWarehouseContainer struct {
|
||||||
ID uint `gorm:"primaryKey" json:"ID"`
|
ID uint `gorm:"primaryKey" json:"ID"`
|
||||||
Title string `gorm:"size:255;not null;comment:容器名" json:"Title"`
|
Title string `gorm:"size:255;not null;comment:容器名" json:"Title"`
|
||||||
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"`
|
||||||
CreatorID uint `gorm:"not null;index;comment:创建者id" json:"CreatorID"`
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||||
ParentID *uint `gorm:"index;comment:父容器id,nil=顶级" json:"ParentID"`
|
CreatorID uint `gorm:"not null;index;comment:创建者id" json:"CreatorID"`
|
||||||
ItemCount int `gorm:"default:0;comment:直接子物品数量" json:"ItemCount"`
|
ParentID *uint `gorm:"index;comment:父容器id,nil=顶级" json:"ParentID"`
|
||||||
ChildCount int `gorm:"default:0;comment:子容器数量" json:"ChildCount"`
|
ItemCount int `gorm:"default:0;comment:直接子物品数量" json:"ItemCount"`
|
||||||
|
ChildCount int `gorm:"default:0;comment:子容器数量" json:"ChildCount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TabWarehouseItem struct {
|
type TabWarehouseItem struct {
|
||||||
ID uint `gorm:"primaryKey" json:"ID"`
|
ID uint `gorm:"primaryKey" json:"ID"`
|
||||||
Name string `gorm:"size:255;not null;comment:物品名" json:"Name"`
|
Name string `gorm:"size:255;not null;comment:物品名" json:"Name"`
|
||||||
SerialNumber string `gorm:"size:255;comment:序列号" json:"SerialNumber"`
|
SerialNumber string `gorm:"size:255;comment:序列号" json:"SerialNumber"`
|
||||||
Remark string `gorm:"type:text;comment:描述" json:"Remark"`
|
Remark string `gorm:"type:text;comment:描述" json:"Remark"`
|
||||||
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"`
|
||||||
CreatorID uint `gorm:"not null;index;comment:创建者id" json:"CreatorID"`
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||||
ContainerID *uint `gorm:"index;comment:所属容器id,nil=未入库" json:"ContainerID"`
|
CreatorID uint `gorm:"not null;index;comment:创建者id" json:"CreatorID"`
|
||||||
|
ContainerID *uint `gorm:"index;comment:所属容器id,nil=未入库" json:"ContainerID"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TabWarehouseContainerFileBind struct {
|
type TabWarehouseContainerFileBind struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user