refactor(time):彻底重构time类型。

This commit is contained in:
徐涛
2023-06-05 22:09:42 +08:00
parent 1fd5e7b9aa
commit 8aa3a054b0
10 changed files with 79 additions and 73 deletions

View File

@@ -47,9 +47,9 @@ func (m ManagementAccountCreationForm) IntoUserDetail() *UserDetail {
Phone: m.Phone,
UnitServiceFee: decimal.Zero,
ServiceExpiration: m.Expires,
CreatedAt: time.Now(),
CreatedAt: types.Now(),
CreatedBy: nil,
LastModifiedAt: time.Now(),
LastModifiedAt: types.Now(),
LastModifiedBy: nil,
DeletedAt: nil,
DeletedBy: nil,
@@ -85,11 +85,11 @@ type UserDetail struct {
Phone *string `json:"phone"`
UnitServiceFee decimal.Decimal `db:"unit_service_fee" json:"unitServiceFee"`
ServiceExpiration types.Date `json:"serviceExpiration"`
CreatedAt time.Time `json:"createdAt"`
CreatedAt types.DateTime `json:"createdAt"`
CreatedBy *string `json:"createdBy"`
LastModifiedAt time.Time `json:"lastModifiedAt"`
LastModifiedAt types.DateTime `json:"lastModifiedAt"`
LastModifiedBy *string `json:"lastModifiedBy"`
DeletedAt *time.Time `json:"deletedAt"`
DeletedAt *types.DateTime `json:"deletedAt"`
DeletedBy *string `json:"deletedBy"`
}
@@ -107,8 +107,8 @@ type UserWithDetail struct {
Phone *string `json:"phone"`
UnitServiceFee decimal.Decimal `db:"unit_service_fee" json:"unitServiceFee"`
ServiceExpiration types.Date `json:"serviceExpiration"`
CreatedAt time.Time `json:"createdAt"`
CreatedAt types.DateTime `json:"createdAt"`
CreatedBy *string `json:"createdBy"`
LastModifiedAt time.Time `json:"lastModifiedAt"`
LastModifiedAt types.DateTime `json:"lastModifiedAt"`
LastModifiedBy *string `json:"lastModifiedBy"`
}