新增匹配次数管理功能,优化用户匹配体验。通过服务端计算用户的匹配配额,更新用户状态以反映剩余匹配次数。同时,调整匹配页面逻辑,确保在匹配次数用尽时提示用户购买更多次数。更新相关API以支持匹配记录的存储与查询,提升系统稳定性。

This commit is contained in:
乘风
2026-02-11 16:53:17 +08:00
parent ecee1bb2bb
commit a1dcf599ee
18 changed files with 422 additions and 229 deletions

View File

@@ -0,0 +1,18 @@
package model
import "time"
// MatchRecord 匹配记录,每次用户成功匹配时写入
type MatchRecord struct {
ID string `gorm:"column:id;primaryKey;size:50" json:"id"`
UserID string `gorm:"column:user_id;index;size:50;not null" json:"userId"`
MatchType string `gorm:"column:match_type;index;size:50" json:"matchType"`
Phone *string `gorm:"column:phone;size:20" json:"phone"`
WechatID *string `gorm:"column:wechat_id;size:100" json:"wechatId"`
MatchedUserID string `gorm:"column:matched_user_id;index;size:50" json:"matchedUserId"`
MatchScore *int `gorm:"column:match_score" json:"matchScore"`
Status *string `gorm:"column:status;size:20" json:"status"`
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
}
func (MatchRecord) TableName() string { return "match_records" }