- refactor.

This commit is contained in:
gazebo
2018-06-13 11:41:48 +08:00
parent 0fc65c457a
commit 892c814b0e
4 changed files with 27 additions and 19 deletions

View File

@@ -6,6 +6,10 @@ import (
"fmt"
"reflect"
"strconv"
"strings"
"time"
"github.com/satori/go.uuid"
)
func GetConcretValue(value reflect.Value) reflect.Value {
@@ -120,3 +124,20 @@ func Int64ToStr(value int64) string {
func Int2Str(value int) string {
return strconv.Itoa(value)
}
// 去除-号全部大写比如929ADB626EB911E893E452540009DAB3
func GetUUID() string {
return strings.ToUpper(strings.Replace(uuid.Must(uuid.NewV1()).String(), "-", "", -1))
}
func GetCurTimeStr() string {
return time.Now().Format("2006-01-02 15:04:05")
}
func GetCurTimestamp() int64 {
return time.Now().Unix()
}
func GetAPIOperator() string {
return time.Now().Format("2006-01-02_15:04:05")
}