MCPcopy Create free account
hub / github.com/53AI/53AIHub / Exists

Method Exists

api/model/like.go:91–97  ·  view source on GitHub ↗

Exists 检查点赞记录是否存在

()

Source from the content-addressed store, hash-verified

89
90// Exists 检查点赞记录是否存在
91func (l *Like) Exists() (bool, error) {
92 var count int64
93 err := DB.Model(&Like{}).
94 Where("user_id = ? AND type = ? AND object_id = ?", l.UserID, l.Type, l.ObjectID).
95 Count(&count).Error
96 return count > 0, err
97}
98
99// GetLikeByID 根据ID获取点赞记录
100func GetLikeByID(likeID int64) (*Like, error) {

Callers 2

CreateMethod · 0.95
ToggleLikeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected