Documentation ¶
Index ¶
- Variables
- func CmpAge(birthday time.Time) int
- func GetCompanyId(c *gin.Context) string
- func GetMonthFirstDayLocal(t time.Time) time.Time
- func GetMonthFirstDayLocation(t time.Time, location *time.Location) time.Time
- func GetMonthLen(t time.Time) int
- func GetSub(c *gin.Context) int
- func GetUserId(c *gin.Context) string
- func GetWeekFirstDayLocal(t time.Time) time.Time
- func GetWeekFirstDayLocation(t time.Time, location *time.Location) time.Time
- func GetZoreTimeLocal(t time.Time) time.Time
- func GetZoreTimeLocation(t time.Time, location *time.Location) time.Time
- func MoneyFmt(m float64) string
- type CustomClaims
- type LocalTime
- type StringBuilder
Constants ¶
This section is empty.
Variables ¶
View Source
var MonthDay = []int{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
Functions ¶
func GetMonthLen ¶
func GetWeekFirstDayLocation ¶
Types ¶
type CustomClaims ¶
type CustomClaims struct { UserId int `json:"uid,omitempty"` RoleId int `json:"rid,omitempty"` Phone string `json:"mob,omitempty"` Nickname string `json:"nick,omitempty"` JwtData map[string]any jwt.RegisteredClaims // 内嵌标准的声明 }
AdminCustomClaims 自定义格式内容
func NewClaims ¶
func NewClaims(userId int, expiresAt time.Time, issuer, subject string) CustomClaims
NewAdminCustomClaims 初始化AdminCustomClaims
func (*CustomClaims) AddData ¶
func (c *CustomClaims) AddData(key string, val any) *CustomClaims
func (*CustomClaims) ExpiresAt ¶
func (c *CustomClaims) ExpiresAt(expiresAt time.Time) *CustomClaims
func (*CustomClaims) GetInt ¶
func (c *CustomClaims) GetInt(key string) int
func (*CustomClaims) GetString ¶
func (c *CustomClaims) GetString(key string) string
type StringBuilder ¶
type StringBuilder struct {
// contains filtered or unexported fields
}
func NewSB ¶
func NewSB() *StringBuilder
func (*StringBuilder) Append ¶
func (s *StringBuilder) Append(str string) *StringBuilder
func (*StringBuilder) AppendByte ¶
func (s *StringBuilder) AppendByte(b byte) *StringBuilder
func (*StringBuilder) AppendBytes ¶
func (s *StringBuilder) AppendBytes(bs []byte) *StringBuilder
func (*StringBuilder) String ¶
func (s *StringBuilder) String() string
Click to show internal directories.
Click to hide internal directories.