From 919883f5217bb629c3002c1c2f7841f353feb1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Fri, 2 Jun 2023 10:18:16 +0800 Subject: [PATCH] =?UTF-8?q?enhance(user):=E4=B8=BA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=A2=9E=E5=8A=A0Json=E9=94=AE=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/user.go | 106 +++++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/model/user.go b/model/user.go index b0d836d..d79edd2 100644 --- a/model/user.go +++ b/model/user.go @@ -13,14 +13,14 @@ const ( ) type ManagementAccountCreationForm struct { - Id *string - Username string - Name string - Contact *string - Phone *string - Type int16 `json:"type"` - Enabled bool - Expires Date + Id *string `json:"id"` + Username string `json:"username"` + Name string `json:"name"` + Contact *string `json:"contact"` + Phone *string `json:"phone"` + Type int16 `json:"type"` + Enabled bool `json:"enabled"` + Expires Date `json:"expires"` } func (m ManagementAccountCreationForm) IntoUser() *User { @@ -56,58 +56,58 @@ func (m ManagementAccountCreationForm) IntoUserDetail() *UserDetail { } type UserModificationForm struct { - Name string - Region *string - Address *string - Contact *string - Phone *string - UnitServiceFee *decimal.Decimal + Name string `json:"name"` + Region *string `json:"region"` + Address *string `json:"address"` + Contact *string `json:"contact"` + Phone *string `json:"phone"` + UnitServiceFee *decimal.Decimal `json:"unitServiceFee"` } type User struct { - Id string - Username string - Password string - ResetNeeded bool - UserType int16 `db:"type"` - Enabled bool - CreatedAt *time.Time + Id string `json:"id"` + Username string `json:"username"` + Password string `json:"password"` + ResetNeeded bool `json:"resetNeeded"` + UserType int16 `db:"type"` + Enabled bool `json:"enabled"` + CreatedAt *time.Time `json:"createdAt"` } type UserDetail struct { - Id string - Name *string - Abbr *string - Region *string - Address *string - Contact *string - Phone *string - UnitServiceFee decimal.Decimal `db:"unit_service_fee"` - ServiceExpiration Date - CreatedAt time.Time - CreatedBy *string - LastModifiedAt time.Time - LastModifiedBy *string - DeletedAt *time.Time - DeletedBy *string + Id string `json:"id"` + Name *string `json:"name"` + Abbr *string `json:"abbr"` + Region *string `json:"region"` + Address *string `json:"address"` + Contact *string `json:"contact"` + Phone *string `json:"phone"` + UnitServiceFee decimal.Decimal `db:"unit_service_fee" json:"unitServiceFee"` + ServiceExpiration Date `json:"serviceExpiration"` + CreatedAt time.Time `json:"createdAt"` + CreatedBy *string `json:"createdBy"` + LastModifiedAt time.Time `json:"lastModifiedAt"` + LastModifiedBy *string `json:"lastModifiedBy"` + DeletedAt *time.Time `json:"deletedAt"` + DeletedBy *string `json:"deletedBy"` } type UserWithDetail struct { - Id string - Username string - ResetNeeded bool - UserType int16 `db:"type"` - Enabled bool - Name *string - Abbr *string - Region *string - Address *string - Contact *string - Phone *string - UnitServiceFee decimal.Decimal `db:"unit_service_fee"` - ServiceExpiration Date - CreatedAt time.Time - CreatedBy *string - LastModifiedAt time.Time - LastModifiedBy *string + Id string `json:"id"` + Username string `json:"username"` + ResetNeeded bool `json:"resetNeeded"` + UserType int16 `db:"type" json:"type"` + Enabled bool `json:"enabled"` + Name *string `json:"name"` + Abbr *string `json:"abbr"` + Region *string `json:"region"` + Address *string `json:"address"` + Contact *string `json:"contact"` + Phone *string `json:"phone"` + UnitServiceFee decimal.Decimal `db:"unit_service_fee" json:"unitServiceFee"` + ServiceExpiration Date `json:"serviceExpiration"` + CreatedAt time.Time `json:"createdAt"` + CreatedBy *string `json:"createdBy"` + LastModifiedAt time.Time `json:"lastModifiedAt"` + LastModifiedBy *string `json:"lastModifiedBy"` }