06488f0237
功能: - Go后端 (Gin + GORM + PostgreSQL) - UniApp用户端 (iOS/Android/小程序) - DaisyUI5后台管理 - JWT认证 + 微信登录 - 盲选加权算法 - 会员系统 + 优惠券 - 打分评价 + 偏好学习
33 lines
1.3 KiB
Go
33 lines
1.3 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Merchant struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Name string `gorm:"size:200" json:"name"`
|
|
Avatar string `gorm:"size:255" json:"avatar"`
|
|
CategoryID uint `json:"category_id"`
|
|
CategoryName string `gorm:"column:category_name" json:"category_name"`
|
|
Rating float64 `gorm:"default:0" json:"rating"`
|
|
PriceRange string `gorm:"size:50" json:"price_range"`
|
|
Location string `gorm:"size:100" json:"location"`
|
|
Lat float64 `json:"lat"`
|
|
Lng float64 `json:"lng"`
|
|
Tags string `gorm:"type:text[]" json:"tags"`
|
|
Commission float64 `gorm:"default:0.1" json:"commission"`
|
|
TotalReviews int `gorm:"default:0" json:"total_reviews"`
|
|
TotalScore float64 `gorm:"default:0" json:"total_score"`
|
|
QualityScore float64 `gorm:"default:0.5" json:"quality_score"`
|
|
Status string `gorm:"size:20;default:pending" json:"status"` // pending/approved/rejected/offline
|
|
Description string `gorm:"type:text" json:"description"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|
|
|
|
func (Merchant) TableName() string { return "merchants" }
|