forked from free-lancers/electricity_bill_calc_service
		
	enhance(user):使用Goqu SQL构建库重写查询构成。
This commit is contained in:
		| @@ -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 | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user