Documentation
¶
Index ¶
Constants ¶
View Source
const ( CNYFen Price = 1 CNYJiao = 10 * CNYFen CNYYuan = 10 * CNYJiao )
View Source
const ( TimeCompactLayout = "20060102150405" TimeDotLayout = "2006.01.02 15:04:05" DateDotLayout = "2006.01.02" DateCompactLayout = "20060102" ChineseDateLayout = "2006年01月02日" MonthLayout = "2006-01" )
View Source
const CstHour int64 = 8 * 3600
CstHour 东八区
View Source
const PriceColor = `#08AF5D`
PriceColor 价格颜色
Variables ¶
This section is empty.
Functions ¶
func Pagination ¶
Pagination 分页排序
Types ¶
type Array ¶
type Array[T comparable] []T
type BinaryStatus ¶
type BinaryStatus uint8
BinaryStatus 二元状态 0-否 1-是
const ( BinaryStatusYes BinaryStatus = 1 BinaryStatusNo BinaryStatus = 0 )
func BinaryStatusByBool ¶
func BinaryStatusByBool(status bool) BinaryStatus
func BinaryStatusByUint ¶
func BinaryStatusByUint(status uint8) BinaryStatus
func (BinaryStatus) Bool ¶
func (s BinaryStatus) Bool() bool
func (BinaryStatus) Uint ¶
func (s BinaryStatus) Uint() uint8
type JSONDate ¶
JSONDate format json date field by myself
func (JSONDate) MarshalJSON ¶
func (*JSONDate) UnmarshalJSON ¶
type JSONTime ¶
JSONTime format json time field by myself
func (JSONTime) MarshalJSON ¶
MarshalJSON on JSONTime format Time field with %Y-%m-%d %H:%M:%S
func (*JSONTime) UnmarshalJSON ¶
type Percent ¶
type Percent uint
Percent 百分比字段
func (Percent) FormatDecimal ¶
FormatDecimal 格式化百分比小数 例如 10%==>0.1
func (Percent) FormatNumeric ¶
FormatNumeric 格式化百分比 例如 10%==>10
type Price ¶
type Price int64
Price 金额字段
func CalculatePricePercent ¶
CalculatePricePercent 计算金额的%
func (Price) FormatColor ¶
FormatColor 带颜色标签的格式化 @param format string 格式 @param color string 颜色值 @param isThousand bool 按千分位格式化
type PrimaryKeyID ¶
type PrimaryKeyID struct {
ID uint64 `gorm:"primary_key;autoIncrement" json:"id"`
}
PrimaryKeyID 自增主键ID
type SoftDelete ¶
type SoftDelete struct { IsDelete uint8 `gorm:"not null;default:0;comment:删除标识 0-未删除 1-已删除" json:"is_delete"` DeleteTime JSONTime `gorm:"type:datetime(0);index;not null" json:"delete_time"` }
SoftDelete 软删除
type Time ¶
type Time struct { CreatedAt JSONTime `gorm:"type:datetime(0);index;not null" json:"created_at,omitempty"` UpdatedAt JSONTime `gorm:"type:datetime(0);not null" json:"updated_at,omitempty"` }
Time 添加时间,修改时间
Click to show internal directories.
Click to hide internal directories.