sync: soul-api 接口逻辑 | 原因: 后端接口逻辑修改
This commit is contained in:
@@ -85,6 +85,24 @@ func CKBJoin(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"success": false, "message": "无效的加入类型"})
|
c.JSON(http.StatusBadRequest, gin.H{"success": false, "message": "无效的加入类型"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 先写入 match_records(无论 CKB 是否成功,用户确实提交了表单)
|
||||||
|
if body.UserID != "" {
|
||||||
|
rec := model.MatchRecord{
|
||||||
|
ID: fmt.Sprintf("mr_ckb_%d", time.Now().UnixNano()),
|
||||||
|
UserID: body.UserID,
|
||||||
|
MatchType: body.Type,
|
||||||
|
}
|
||||||
|
if body.Phone != "" {
|
||||||
|
rec.Phone = &body.Phone
|
||||||
|
}
|
||||||
|
if body.Wechat != "" {
|
||||||
|
rec.WechatID = &body.Wechat
|
||||||
|
}
|
||||||
|
if err := database.DB().Create(&rec).Error; err != nil {
|
||||||
|
fmt.Printf("[CKBJoin] 写入 match_records 失败: %v\n", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ts := time.Now().Unix()
|
ts := time.Now().Unix()
|
||||||
params := map[string]interface{}{
|
params := map[string]interface{}{
|
||||||
"timestamp": ts,
|
"timestamp": ts,
|
||||||
|
|||||||
Reference in New Issue
Block a user