enhance(user):使用Goqu SQL构建库重写查询构成。

This commit is contained in:
徐涛
2023-05-31 14:47:50 +08:00
parent 31ec847ab2
commit 28609df9ec
4 changed files with 213 additions and 1 deletions

View File

@@ -1,7 +1,72 @@
package model
import (
"time"
"github.com/shopspring/decimal"
)
const (
USER_TYPE_ENT int8 = iota
USER_TYPE_ENT int16 = iota
USER_TYPE_SUP
USER_TYPE_OPS
)
type ManagementAccountCreationForm struct {
Id *string
Username string
Name string
Contact *string
Phone *string
Type int16 `json:"type"`
Enabled bool
Expires Date
}
type User struct {
Id string
Username string
Password string
ResetNeeded bool
UserType int16 `db:"type"`
Enabled bool
CreatedAt *time.Time
}
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
}
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
}