Versions in this module Expand all Collapse all v0 v0.0.2 Mar 6, 2025 Changes in this version + func IsDuplicate[T any, V comparable](list []T, f func(T) V) bool + func SliceMap[T, U any](slice []T, fn func(T) U) []U v0.0.1 Jan 15, 2025 Changes in this version + var DefalutErrorCode int = -1 + var DefaultPageSize int = 10 + var DefaultSuccessCode int = 0 + var DefaultSuccessMessage string = "success" + var ErrPriceScan = errors.New("价格类型解析失败") + var TimeDefaultLayout string = "2006-01-02 15:04:05" + func Error(ctx *gin.Context, err error) *gin.Context + func Failure(ctx *gin.Context, code int, message string) *gin.Context + func Success(ctx *gin.Context, data any) *gin.Context + func ToMap[K comparable, V any](rows []V, f func(V) (K, V)) map[K]V + type Pagination struct + Keyword string + Page int + Size int + func (p Pagination) GetPage() int + func (p Pagination) GetSize() int + func (p Pagination) Offset() int + type Price float64 + func (p *Price) Scan(value interface{}) error + func (p Price) Value() (driver.Value, error) + type Time time.Time + func Now() Time + func (mt *Time) MarshalJSON() ([]byte, error) + func (mt *Time) UnmarshalJSON(data []byte) error + func (mt Time) Value() (driver.Value, error) + type YesOrNo int + const No + const Yes + func (w YesOrNo) String() string + func (w YesOrNo) StringDIY(y, n string) string