06488f0237
功能: - Go后端 (Gin + GORM + PostgreSQL) - UniApp用户端 (iOS/Android/小程序) - DaisyUI5后台管理 - JWT认证 + 微信登录 - 盲选加权算法 - 会员系统 + 优惠券 - 打分评价 + 偏好学习
38 lines
1.2 KiB
Go
38 lines
1.2 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Member struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
UserID uint `gorm:"uniqueIndex:idx_user_level" json:"user_id"`
|
|
Level int `gorm:"default:0" json:"level"`
|
|
StartDate time.Time `json:"start_date"`
|
|
EndDate time.Time `json:"end_date"`
|
|
PaymentMethod string `gorm:"size:50" json:"payment_method"`
|
|
Amount float64 `json:"amount"`
|
|
OrderNo string `gorm:"size:100;uniqueIndex" json:"order_no"`
|
|
Status string `gorm:"size:20;default:active" json:"status"` // active/expired/cancelled
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|
|
|
|
func (Member) TableName() string { return "members" }
|
|
|
|
type Activity struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Name string `gorm:"size:200" json:"name"`
|
|
Type string `gorm:"size:50" json:"type"`
|
|
Start time.Time `json:"start"`
|
|
End time.Time `json:"end"`
|
|
ConfigJSON string `gorm:"type:text" json:"config"`
|
|
Status string `gorm:"size:20;default:active" json:"status"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
func (Activity) TableName() string { return "activities" }
|