|
|
@@ -48,6 +48,7 @@ func CallbackChuanshanjia(c *gin.Context) { |
|
|
|
sign := c.Query("sign") |
|
|
|
extra := c.Query("extra") |
|
|
|
id := gjson.Get(extra, "id").String() |
|
|
|
uniqId := gjson.Get(extra, "uniqId").String() |
|
|
|
phonePlatform := strings.ToLower(gjson.Get(extra, "platform").String()) |
|
|
|
platform := "chuanshanjia" |
|
|
|
isEnd, spaceKey := comm(c, id, primeRit, platform, phonePlatform) |
|
|
@@ -65,7 +66,7 @@ func CallbackChuanshanjia(c *gin.Context) { |
|
|
|
c.String(200, "{\"is_verify\":true,\"reason\":50002}") |
|
|
|
return |
|
|
|
} |
|
|
|
isEnds := commDoing(c, platform, transId, userId, extra, primeRit) |
|
|
|
isEnds := commDoing(c, platform, transId, userId, extra, primeRit, uniqId) |
|
|
|
if isEnds == 1 { |
|
|
|
c.String(200, "{\"is_verify\":true,\"reason\":20000}") |
|
|
|
return |
|
|
@@ -81,6 +82,7 @@ func CallbackYoulianghui(c *gin.Context) { |
|
|
|
sign := c.Query("sig") |
|
|
|
extra := c.Query("extrainfo") |
|
|
|
id := gjson.Get(extra, "id").String() |
|
|
|
uniqId := gjson.Get(extra, "uniqId").String() |
|
|
|
phonePlatform := strings.ToLower(gjson.Get(extra, "platform").String()) |
|
|
|
platform := "youlianghui" |
|
|
|
isEnd, spaceKey := comm(c, id, primeRit, platform, phonePlatform) |
|
|
@@ -98,7 +100,7 @@ func CallbackYoulianghui(c *gin.Context) { |
|
|
|
c.String(200, "success") |
|
|
|
return |
|
|
|
} |
|
|
|
isEnds := commDoing(c, platform, transId, userId, extra, primeRit) |
|
|
|
isEnds := commDoing(c, platform, transId, userId, extra, primeRit, uniqId) |
|
|
|
if isEnds == 1 { |
|
|
|
c.String(200, "success") |
|
|
|
return |
|
|
@@ -108,7 +110,7 @@ func CallbackYoulianghui(c *gin.Context) { |
|
|
|
} |
|
|
|
|
|
|
|
// 公共处理 |
|
|
|
func commDoing(c *gin.Context, platform, transId, userId, extra, primeRit string) int { |
|
|
|
func commDoing(c *gin.Context, platform, transId, userId, extra, primeRit, uniqId string) int { |
|
|
|
types := gjson.Get(extra, "type").String() |
|
|
|
exist, _ := db.Db.Where("platform=? and oid=?", platform, transId).Exist(&model.AdvertisingCallback{}) |
|
|
|
if exist { |
|
|
@@ -121,6 +123,7 @@ func commDoing(c *gin.Context, platform, transId, userId, extra, primeRit string |
|
|
|
Uid: utils.StrToInt(userId), |
|
|
|
Extra: extra, |
|
|
|
SpaceId: primeRit, |
|
|
|
UniqId: uniqId, |
|
|
|
CreateAt: time.Now(), |
|
|
|
} |
|
|
|
db.Db.Insert(&tmp) |
|
|
|