From 8849dda9c4fd92467e2c05c15ea483abae6af8e5 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期三, 12 八月 2020 11:25:39 +0800 Subject: [PATCH] add testPush --- service/userService.go | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/service/userService.go b/service/userService.go index 0bd2356..8f66c41 100644 --- a/service/userService.go +++ b/service/userService.go @@ -57,6 +57,16 @@ //瀹㈡埛绔痗id缁戝畾鍒悕 if cid != "" { go func() { + var uc models.UserClient + if !uc.ExistByCid(phoneNum, cid) { + new := models.UserClient{ + Id:uuid.NewV4().String(), + PhoneNum: phoneNum, + ClientId: cid, + BindTime: time.Now().Format("2006-01-02 15:04:05"), + } + new.Insert() + } bindR, bindE := BindAlias(cid, phoneNum) fmt.Println("bind cid:",cid, "phoneNum:",phoneNum,"result:", bindR, "err:", bindE) }() @@ -86,6 +96,16 @@ //瀹㈡埛绔痗id缁戝畾鍒悕 if cid != "" { go func() { + var uc models.UserClient + if !uc.ExistByCid(phoneNum, cid) { + new := models.UserClient{ + Id:uuid.NewV4().String(), + PhoneNum: phoneNum, + ClientId: cid, + BindTime: time.Now().Format("2006-01-02 15:04:05"), + } + new.Insert() + } bindR, bindE := BindAlias(cid, phoneNum) fmt.Println("bind cid:",cid, "phoneNum:",phoneNum,"result:", bindR, "err:", bindE) }() -- Gitblit v1.8.0