diff --git a/model/end_user_detail.go b/model/end_user_detail.go index 238f379..49ee837 100644 --- a/model/end_user_detail.go +++ b/model/end_user_detail.go @@ -9,7 +9,7 @@ import ( type EndUserDetail struct { bun.BaseModel `bun:"table:end_user_detail,alias:eud"` - CreatedAndModified `bun:",extend"` + CreatedAndModified `bun:"extend"` ReportId string `bun:",pk,notnull" json:"reportId"` ParkId string `bun:",pk,notnull" json:"parkId"` MeterId string `bun:"meter_04kv_id,pk,notnull" json:"meterId"` diff --git a/model/maintenance_fee.go b/model/maintenance_fee.go index 0ec4d61..89e1850 100644 --- a/model/maintenance_fee.go +++ b/model/maintenance_fee.go @@ -7,8 +7,8 @@ import ( type MaintenanceFee struct { bun.BaseModel `bun:"table:maintenance_fee,alias:m"` - CreatedAndModified `bun:",extend"` - Deleted `bun:",extend"` + CreatedAndModified `bun:"extend"` + Deleted `bun:"extend"` Id string `bun:",pk,notnull" json:"id"` ParkId string `bun:",notnull" json:"parkId"` Name string `bun:",notnull" json:"name"` diff --git a/model/meter_04kv.go b/model/meter_04kv.go index 162c1fc..9ff8fbf 100644 --- a/model/meter_04kv.go +++ b/model/meter_04kv.go @@ -7,7 +7,7 @@ import ( type Meter04KV struct { bun.BaseModel `bun:"table:meter_04kv,alias:mt"` - CreatedAndModified `bun:",extend"` + CreatedAndModified `bun:"extend"` Code string `bun:",pk,notnull" json:"code" excel:"code"` ParkId string `bun:",pk,notnull" json:"parkId"` Address *string `json:"address" excel:"address"` diff --git a/model/park.go b/model/park.go index 3c093df..6b464d0 100644 --- a/model/park.go +++ b/model/park.go @@ -21,8 +21,8 @@ const ( type Park struct { bun.BaseModel `bun:"table:park,alias:p"` - CreatedAndModified `bun:",extend"` - Deleted `bun:",extend"` + CreatedAndModified `bun:"extend"` + Deleted `bun:"extend"` Id string `bun:",pk,notnull" json:"id"` UserId string `bun:",notnull" json:"userId"` Name string `bun:",notnull" json:"name"` diff --git a/model/report.go b/model/report.go index f161a75..07f49eb 100644 --- a/model/report.go +++ b/model/report.go @@ -15,7 +15,7 @@ const ( type Report struct { bun.BaseModel `bun:"table:report,alias:r"` - CreatedAndModified `bun:"extends"` + CreatedAndModified `bun:"extend"` Id string `bun:",pk,notnull" json:"id"` ParkId string `bun:",notnull" json:"parkId"` Period time.Time `bun:"type:date,notnull" json:"period" time_format:"simple_date" time_location:"shanghai"` diff --git a/model/shared.go b/model/shared.go index 5a8a852..4b35935 100644 --- a/model/shared.go +++ b/model/shared.go @@ -7,7 +7,7 @@ type Created struct { } type CreatedWithUser struct { - Created `bun:",extend"` + Created `bun:"extend"` CreatedBy *string `json:"createdBy"` } @@ -16,17 +16,17 @@ type Deleted struct { } type DeletedWithUser struct { - Deleted `bun:",extend"` + Deleted `bun:"extend"` DeletedBy *string `json:"deletedBy"` } type CreatedAndModified struct { - Created `bun:",extend"` + Created `bun:"extend"` LastModifiedAt *time.Time `bun:"type:timestamptz,nullzero,default:current_timestamp" json:"lastModifiedAt" time_format:"simple_datetime" time_location:"shanghai"` } type CreatedAndModifiedWithUser struct { - CreatedAndModified `bun:",extend"` + CreatedAndModified `bun:"extend"` CreatedBy *string `json:"createdBy"` LastModifiedBy *string `json:"lastModifiedBy"` } diff --git a/model/user.go b/model/user.go index 5691749..690866d 100644 --- a/model/user.go +++ b/model/user.go @@ -10,7 +10,7 @@ const ( type User struct { bun.BaseModel `bun:"table:user,alias:u"` - Created `bun:",extend"` + Created `bun:"extend"` Id string `bun:",pk,notnull" json:"id"` Username string `bun:",notnull" json:"username"` Password string `bun:",notnull" json:"-"` @@ -23,7 +23,7 @@ type User struct { type UserWithCredentials struct { bun.BaseModel `bun:"table:user,alias:u"` - Created `bun:",extend"` + Created `bun:"extend"` Id string `bun:",pk,notnull" json:"id"` Username string `bun:",notnull" json:"username"` Password string `bun:",notnull" json:"credential"` diff --git a/model/user_charges.go b/model/user_charges.go index 53f2f6c..86fdef7 100644 --- a/model/user_charges.go +++ b/model/user_charges.go @@ -9,7 +9,7 @@ import ( type UserCharge struct { bun.BaseModel `bun:"table:user_charge,alias:c"` - Created `bun:"extends"` + Created `bun:"extend"` Seq int64 `bun:"type:bigint,pk,notnull,autoincrement" json:"seq"` UserId string `bun:",notnull" json:"userId"` Fee decimal.NullDecimal `json:"fee"` @@ -26,6 +26,6 @@ type UserCharge struct { } type ChargeWithName struct { - UserDetail `bun:"extends"` - UserCharge `bun:"extends"` + UserDetail `bun:"extend"` + UserCharge `bun:"extend"` } diff --git a/model/user_detail.go b/model/user_detail.go index 5a7257e..5c186cf 100644 --- a/model/user_detail.go +++ b/model/user_detail.go @@ -10,8 +10,8 @@ import ( type UserDetail struct { bun.BaseModel `bun:"table:user_detail,alias:d"` - CreatedAndModifiedWithUser `bun:",extend"` - DeletedWithUser `bun:",extend"` + CreatedAndModifiedWithUser `bun:"extend"` + DeletedWithUser `bun:"extend"` Id string `bun:",pk,notnull" json:"-"` Name *string `json:"name"` Abbr *string `json:"abbr"` @@ -24,7 +24,7 @@ type UserDetail struct { } type JoinedUserDetail struct { - UserDetail `bun:"extends"` + UserDetail `bun:"extend"` Id string `json:"id"` Username string `json:"username"` Type int8 `json:"type"` @@ -32,8 +32,8 @@ type JoinedUserDetail struct { } type FullJoinedUserDetail struct { - UserDetail `bun:"extends"` - User `bun:"extends"` + UserDetail `bun:"extend"` + User `bun:"extend"` } type UserDetailSimplified struct { diff --git a/model/will_diluted_fee.go b/model/will_diluted_fee.go index 801e145..e2fe073 100644 --- a/model/will_diluted_fee.go +++ b/model/will_diluted_fee.go @@ -7,7 +7,7 @@ import ( type WillDilutedFee struct { bun.BaseModel `bun:"table:will_diluted_fee,alias:w"` - CreatedAndModified `bun:"extends"` + CreatedAndModified `bun:"extend"` Id string `bun:",pk,notnull" json:"diluteId"` ReportId string `bun:",notnull" json:"reportId"` SourceId *string `json:"sourceId"`