Files
opsx-licence/backend/internal/model/customer.go
T
Logan.LiandCursor bac72e6945 fix: 按评审报告止血支付漏洞并加固授权链路
废除浏览器回跳自助结算,通用 webhook 强制密钥鉴权,Waffo 支持验签与未知事件忽略;重构订单状态机/激活占座/SQLite WAL,并补备份、readyz、限流与前端导出/登录页安全修复。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-12 21:26:58 +08:00

29 lines
961 B
Go

package model
import (
"time"
"gorm.io/gorm"
)
// Customer 客户模型 // Logan.Li
type Customer struct {
ID uint `json:"id" gorm:"primaryKey"`
Name string `json:"name" gorm:"size:100;not null"`
Company string `json:"company" gorm:"size:200"`
Email string `json:"email" gorm:"size:100;uniqueIndex"`
Phone string `json:"phone" gorm:"size:20"`
Address string `json:"address" gorm:"size:500"`
Notes string `json:"notes" gorm:"type:text"`
Status int `json:"status" gorm:"default:1"` // 1: 启用, 0: 禁用
Licenses []License `json:"licenses,omitempty" gorm:"foreignKey:CustomerID"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"deleted_at,omitempty" gorm:"index"`
}
// TableName 指定表名 // Logan.Li
func (Customer) TableName() string {
return "customers"
}