MallLog

package
v5.1.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//OpenSub 是否启动订阅
	OpenSub = false
)

Functions

func AppendLog

func AppendLog(userID int64, ip string, orgID int64, productID int64, action int)

AppendLog 添加一个记录

func AppendLogByC

func AppendLogByC(c *gin.Context, productID int64, action int)

AppendLogByC 使用顶层路由记录访问记录

func Init

func Init()

Init 初始化

Types

type DataNearNextProductID

type DataNearNextProductID struct {
	//商品ID
	ProductID int64 `json:"productID"`
	//得分
	// 根据action打分:
	// action: 0 浏览行为 +1分; 1 评论行为 +2分; 2 购物车行为 +3分; 3 购买行为 +4分
	Score int `json:"score"`
}

DataNearNextProductID 反馈数据排名结构体

func NearNextProductID

func NearNextProductID(productID int64, limit int) (scoreList []DataNearNextProductID)

NearNextProductID 追溯某个商品的下一个商品分布前N名 可直接用于简单的推荐算法模型,获取某个商品出现的分布情况做排名,排名靠前的会列入推荐算法列队 设计思路:https://blog.csdn.net/qq_39564555/article/details/105881352 按照相似度顺序,反馈一组符合条件的商品ID

type FieldsLog

type FieldsLog struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//组织ID
	// 留空则表明为平台的用户留下的内容
	OrgID int64 `db:"org_id" json:"orgID"`
	//用户ID
	UserID int64 `db:"user_id" json:"userID"`
	//IP
	IP string `db:"ip" json:"ip"`
	//商品ID
	ProductID int64 `db:"product_id" json:"productID"`
	//行为
	// 0 浏览行为; 1 评论行为; 2 购物车行为; 3 购买行为
	Action int `db:"action" json:"action"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL