From 668ae9fbd22cf54d9f4a3643e3145696ae8c38f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Thu, 11 Aug 2022 08:24:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(model):=E5=A2=9E=E5=8A=A0=E5=AF=B9=E4=BA=8E?= =?UTF-8?q?=E5=8F=AF=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=93=E6=9E=84=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/maintenance_fee.go | 2 +- model/meter_04kv.go | 8 ++++---- model/park.go | 10 +++++----- model/report.go | 2 +- model/shared.go | 8 ++++---- model/user_detail.go | 12 ++++++------ model/will_diluted_fee.go | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/model/maintenance_fee.go b/model/maintenance_fee.go index dcf774a..5649a48 100644 --- a/model/maintenance_fee.go +++ b/model/maintenance_fee.go @@ -10,7 +10,7 @@ type MaintenanceFee struct { ParkId string `xorm:"varchar(120) notnull" json:"parkId"` Name string `xorm:"varchar(50) notnull" json:"name"` Fee decimal.Decimal `xorm:"numeric(8,2) notnull" json:"fee"` - Memo string `xorm:"text" json:"memo"` + Memo *string `xorm:"text" json:"memo"` Enabled bool `xorm:"bool notnull" json:"enabled"` } diff --git a/model/meter_04kv.go b/model/meter_04kv.go index 4227a97..00387a7 100644 --- a/model/meter_04kv.go +++ b/model/meter_04kv.go @@ -8,10 +8,10 @@ type Meter04KV struct { CreatedAndModified `xorm:"extends"` Code string `xorm:"varchar(120) pk notnull" json:"code"` ParkId string `xorm:"varchar(120) notnull" json:"parkId"` - Address string `xorm:"varchar(100)" json:"address"` - CustomerName string `xorm:"varchar(100)" json:"customerName"` - ContactName string `xorm:"varchar(70)" json:"contactName"` - ContactPhone string `xorm:"varchar(50)" json:"contactPhone"` + Address *string `xorm:"varchar(100)" json:"address"` + CustomerName *string `xorm:"varchar(100)" json:"customerName"` + ContactName *string `xorm:"varchar(70)" json:"contactName"` + ContactPhone *string `xorm:"varchar(50)" json:"contactPhone"` Ratio decimal.Decimal `xorm:"numeric(8,4) notnull default(1)" json:"ratio"` IsPublicMeter bool `xorm:"'public_meter' bool notnull default(false)" json:"isPublicMeter"` WillDilute bool `xorm:"'dilute' bool notnull default(false)" json:"willDilute"` diff --git a/model/park.go b/model/park.go index 90b28dc..3ca3013 100644 --- a/model/park.go +++ b/model/park.go @@ -9,15 +9,15 @@ type Park struct { Id string `xorm:"varchar(120) pk notnull" json:"id"` UserId string `xorm:"varchar(120) notnull" json:"userId"` Name string `xorm:"vachar(70) notnull" json:"name"` - Abbr string `xorm:"varchar(50)" json:"abbr"` + Abbr *string `xorm:"varchar(50)" json:"abbr"` Area decimal.NullDecimal `xorm:"numeric(14,2)" json:"area"` TenementQuantity decimal.NullDecimal `xorm:"numeric(8,0)" json:"tenementQuantity"` Capacity decimal.NullDecimal `xorm:"numeric(16,2)" json:"capacity"` Category int8 `xorm:"smallint notnull" json:"category"` - Region string `xorm:"varchar(10)" json:"region"` - Address string `xorm:"varchar(120)" json:"address"` - Contact string `xorm:"varchar(100)" json:"contact"` - Phone string `xorm:"varchar(50)" json:"phone"` + Region *string `xorm:"varchar(10)" json:"region"` + Address *string `xorm:"varchar(120)" json:"address"` + Contact *string `xorm:"varchar(100)" json:"contact"` + Phone *string `xorm:"varchar(50)" json:"phone"` Enabled bool `xorm:"bool notnull" json:"enabled"` } diff --git a/model/report.go b/model/report.go index 956bc15..8898e1a 100644 --- a/model/report.go +++ b/model/report.go @@ -8,7 +8,7 @@ type Report struct { ParkId string `xorm:"varchar(120) notnull" json:"parkId"` Period time.Time `xorm:"date notnull" json:"period"` Published bool `xorm:"bool notnull default(false)" json:"published"` - PublishedAt time.Time `xorm:"timestampz" json:"publishedAt"` + PublishedAt *time.Time `xorm:"timestampz" json:"publishedAt"` Withdraw byte `xorm:"smallint notnull default(0)" json:"withdraw"` LastWithdrawAppliedAt *time.Time `xorm:"timestampz" json:"lastWithdrawAppliedAt"` LastWithdrawAuditAt *time.Time `xorm:"timestampz" json:"lastWithdrawAuditAt"` diff --git a/model/shared.go b/model/shared.go index 36a4c49..b272bea 100644 --- a/model/shared.go +++ b/model/shared.go @@ -3,12 +3,12 @@ package model import "time" type Created struct { - CreatedAt time.Time `xorm:"timestampz notnull created" json:"createdAt"` + CreatedAt time.Time `xorm:"timestampz notnull created" json:"createdAt"` } type CreatedWithUser struct { Created `xorm:"extends"` - CreatedBy string `xorm:"varchar(100)" json:"createdBy"` + CreatedBy *string `xorm:"varchar(100)" json:"createdBy"` } type CreatedAndModified struct { @@ -18,6 +18,6 @@ type CreatedAndModified struct { type CreatedAndModifiedWithUser struct { CreatedAndModified `xorm:"extends"` - CreatedBy string `xorm:"varchar(100)" json:"createdBy"` - LastModifiedBy string `xorm:"varchar(100)" json:"lastModifiedBy"` + CreatedBy *string `xorm:"varchar(100)" json:"createdBy"` + LastModifiedBy *string `xorm:"varchar(100)" json:"lastModifiedBy"` } diff --git a/model/user_detail.go b/model/user_detail.go index 8396e30..4a1e2e1 100644 --- a/model/user_detail.go +++ b/model/user_detail.go @@ -9,12 +9,12 @@ import ( type UserDetail struct { CreatedAndModifiedWithUser `xorm:"extends"` Id string `xorm:"varchar(120) pk notnull" json:"id"` - Name string `xorm:"varchar(100)" json:"name"` - Abbr string `xorm:"varchar(50)" json:"abbr"` - Region string `xorm:"varchar(10)" json:"region"` - Address string `xorm:"varchar(120)" json:"address"` - Contact string `xorm:"varchar(100)" json:"contact"` - Phone string `xorm:"varchar(50)" json:"phone"` + Name *string `xorm:"varchar(100)" json:"name"` + Abbr *string `xorm:"varchar(50)" json:"abbr"` + Region *string `xorm:"varchar(10)" json:"region"` + Address *string `xorm:"varchar(120)" json:"address"` + Contact *string `xorm:"varchar(100)" json:"contact"` + Phone *string `xorm:"varchar(50)" json:"phone"` UnitServiceFee decimal.Decimal `xorm:"numeric(8,2) notnull" json:"unitServiceFee"` ServiceExpiration time.Time `xorm:"date notnull" json:"serviceExpiration"` } diff --git a/model/will_diluted_fee.go b/model/will_diluted_fee.go index ae06248..dcefd86 100644 --- a/model/will_diluted_fee.go +++ b/model/will_diluted_fee.go @@ -8,7 +8,7 @@ type WillDilutedFee struct { ReportId string `xorm:"varchar(120) notnull" json:"reportId"` Name string `xorm:"varchar(50) notnull" json:"name"` Fee decimal.Decimal `xorm:"numeric(8,2) notnull" json:"fee"` - Memo string `xorm:"text" json:"memo"` + Memo *string `xorm:"text" json:"memo"` } func (WillDilutedFee) TableName() string {