Files
platforms/backend/api/internal/models/ec_favorite.go
czl231 3ef33b531d 已完成用户APP首期功能开发
交付用户端首期页面、配套接口、后台资源及测试文档。用户APP构建、静态分析和三个管理后台构建通过;完整测试仍有2项失败,后端模型注释检查未通过,详见交付记录。
2026-09-13 00:57:32 +08:00

18 lines
1.0 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 功能描述电商商品收藏关系与并发版本版本1.0.0。
package models
import "git.apinb.com/bsm-sdk/core/database"
// EcFavorite 保存每个账户对商品的唯一收藏关系;取消收藏归档,商品下架保留关系。
type EcFavorite struct {
Entity // 公开标识、创建更新时间及归档状态。
UserAccountID uint64 `gorm:"column:user_account_id;not null;uniqueIndex:ux_ec_favorite_owner_product" json:"user_account_id"` // 收藏账户内部关联键。
EcProductID uint64 `gorm:"column:ec_product_id;not null;uniqueIndex:ux_ec_favorite_owner_product" json:"ec_product_id"` // 收藏商品内部关联键。
Revision uint64 `gorm:"column:revision;not null;default:1" json:"revision"` // 每次状态变化递增,用于拒绝旧请求覆盖。
}
func init() { database.AppendMigrate(&EcFavorite{}) }
// TableName 返回收藏关系的唯一表名。
func (*EcFavorite) TableName() string { return "ec_favorite" }