From 68e2a214029c7c76311435fda7e6530d4fb142f3 Mon Sep 17 00:00:00 2001 From: timerzz Date: Tue, 27 Aug 2024 14:19:31 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=88=A0=E9=99=A4deleteAt=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- structs/v2/article.go | 9 +++------ structs/v2/calculate-process.go | 9 +++------ structs/v2/provider.go | 9 +++------ structs/v2/seller.go | 9 +++------ 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/structs/v2/article.go b/structs/v2/article.go index 0f482f3..6e36986 100644 --- a/structs/v2/article.go +++ b/structs/v2/article.go @@ -2,8 +2,6 @@ package v2 import ( "time" - - "gorm.io/gorm" ) type Brand string @@ -14,10 +12,9 @@ const ( // Article 商品 type Article struct { - ID uint `gorm:"primary_key" json:"id"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - DeletedAt gorm.DeletedAt `gorm:"index"` + ID uint `gorm:"primary_key" json:"id"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` Name string `gorm:"index" json:"name"` diff --git a/structs/v2/calculate-process.go b/structs/v2/calculate-process.go index 82820aa..43708cf 100644 --- a/structs/v2/calculate-process.go +++ b/structs/v2/calculate-process.go @@ -2,15 +2,12 @@ package v2 import ( "time" - - "gorm.io/gorm" ) type CalculateProcess struct { - ID uint `gorm:"primary_key" json:"id"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - DeletedAt gorm.DeletedAt `gorm:"index"` + ID uint `gorm:"primary_key" json:"id"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` //所有人ID OwnerID uint `gorm:"index" json:"ownerID"` // 所有者类型,是provider还是providerArticle还是Seller还是sellerArticle diff --git a/structs/v2/provider.go b/structs/v2/provider.go index 49e07ab..6a6066e 100644 --- a/structs/v2/provider.go +++ b/structs/v2/provider.go @@ -2,17 +2,14 @@ package v2 import ( "time" - - "gorm.io/gorm" ) type ProviderId string type Provider struct { - ID uint `gorm:"primary_key" json:"id"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - DeletedAt gorm.DeletedAt `gorm:"index"` + ID uint `gorm:"primary_key" json:"id"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` ProviderId ProviderId `gorm:"unique" json:"providerId"` // 供应商的名称 diff --git a/structs/v2/seller.go b/structs/v2/seller.go index f0eeeca..6009555 100644 --- a/structs/v2/seller.go +++ b/structs/v2/seller.go @@ -2,18 +2,15 @@ package v2 import ( "time" - - "gorm.io/gorm" ) type SellerId string // Seller 出货商 type Seller struct { - ID uint `gorm:"primary_key" json:"id"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - DeletedAt gorm.DeletedAt `gorm:"index"` + ID uint `gorm:"primary_key" json:"id"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` SellerId SellerId `gorm:"unique" json:"sellerId"` // 出货商的名称