- 添加个人客户微信登录和手机验证码登录接口 - 实现个人客户设备、ICCID、手机号关联管理 - 添加短信发送服务(HTTP 客户端) - 添加微信认证服务(含 mock 实现) - 添加 JWT Token 生成和验证工具 - 创建数据库迁移脚本(personal_customer 关联表) - 修复测试文件中的路由注册参数错误 - 重构 scripts 目录结构(分离独立脚本到子目录) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
24 lines
913 B
Go
24 lines
913 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// PersonalCustomerPhone 个人客户手机号绑定表
|
|
// 说明:一个微信用户可以绑定多个手机号
|
|
type PersonalCustomerPhone struct {
|
|
gorm.Model
|
|
CustomerID uint `gorm:"column:customer_id;type:bigint;not null;comment:关联个人客户ID" json:"customer_id"`
|
|
Phone string `gorm:"column:phone;type:varchar(20);not null;comment:手机号" json:"phone"`
|
|
IsPrimary bool `gorm:"column:is_primary;type:boolean;not null;default:false;comment:是否主手机号" json:"is_primary"`
|
|
VerifiedAt time.Time `gorm:"column:verified_at;type:timestamp;comment:验证通过时间" json:"verified_at"`
|
|
Status int `gorm:"column:status;type:int;not null;default:1;comment:状态 0=禁用 1=启用" json:"status"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (PersonalCustomerPhone) TableName() string {
|
|
return "tb_personal_customer_phone"
|
|
}
|