From f99ece01ecfea7f4be7724899845f4344e4c7f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=8B=A5?= Date: Sun, 8 Mar 2026 16:20:12 +0800 Subject: [PATCH] =?UTF-8?q?sync:=20soul-api=20=E6=8E=A5=E5=8F=A3=E9=80=BB?= =?UTF-8?q?=E8=BE=91=20|=20=E5=8E=9F=E5=9B=A0:=20=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soul-api/internal/handler/ckb.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/soul-api/internal/handler/ckb.go b/soul-api/internal/handler/ckb.go index cf322107..57d1db0e 100644 --- a/soul-api/internal/handler/ckb.go +++ b/soul-api/internal/handler/ckb.go @@ -85,6 +85,24 @@ func CKBJoin(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"success": false, "message": "无效的加入类型"}) 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() params := map[string]interface{}{ "timestamp": ts,