- avoid JdID duplicated when creating cat or sku.

This commit is contained in:
gazebo
2018-09-15 21:55:03 +08:00
parent af5038e8a7
commit 1df63ff45d
2 changed files with 13 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package cms
import (
"crypto/md5"
"fmt"
"time"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler/basesch"
@@ -68,3 +69,8 @@ func GetQiniuUploadToken(suffix string) (upTokenInfo map[string]interface{}, err
func genPicFileName(suffix string) string {
return fmt.Sprintf("%x%s", md5.Sum([]byte(utils.GetUUID()+suffix)), suffix)
}
// 生成一个不重复的临时ID
func genTmpID() int64 {
return time.Now().UnixNano()
}