mirror of
https://github.com/unti-io/go-utils.git
synced 2026-04-22 15:37:20 +08:00
v1.9.9
This commit is contained in:
+1
-21
@@ -311,24 +311,4 @@ func (this *log) ensureLogger(logger *zap.Logger) *zap.Logger {
|
||||
return zap.NewNop()
|
||||
}
|
||||
return logger
|
||||
}
|
||||
|
||||
// func Info(data map[string]any, msg ...any) {
|
||||
// LogInst.ensureLog()
|
||||
// Log.Info(data, msg...)
|
||||
// }
|
||||
//
|
||||
// func Warn(data map[string]any, msg ...any) {
|
||||
// LogInst.ensureLog()
|
||||
// Log.Warn(data, msg...)
|
||||
// }
|
||||
//
|
||||
// func Error(data map[string]any, msg ...any) {
|
||||
// LogInst.ensureLog()
|
||||
// Log.Error(data, msg...)
|
||||
// }
|
||||
//
|
||||
// func Debug(data map[string]any, msg ...any) {
|
||||
// LogInst.ensureLog()
|
||||
// Log.Debug(data, msg...)
|
||||
// }
|
||||
}
|
||||
@@ -134,6 +134,14 @@ func (this *GenClass) SnowFlakeID(node int64) string {
|
||||
return item.Generate().String()
|
||||
}
|
||||
|
||||
// BatchNo - 批次号
|
||||
func (this *GenClass) BatchNo(prefix string, value any) string {
|
||||
date := time.Now().Format("20060102")
|
||||
if prefix != "" {
|
||||
return fmt.Sprintf("%s-%s-%04d", prefix, date, value)
|
||||
}
|
||||
return fmt.Sprintf("%s-%04d", date, value)
|
||||
}
|
||||
// IP 生成随机公网IP地址
|
||||
// 排除内网、保留地址等非公网IP范围
|
||||
func (this *GenClass) IP() string {
|
||||
|
||||
Reference in New Issue
Block a user