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

Method UpdateStatus

api/model/like.go:69–78  ·  view source on GitHub ↗

UpdateStatus 更新点赞状态

(newStatus int8)

Source from the content-addressed store, hash-verified

67
68// UpdateStatus 更新点赞状态
69func (l *Like) UpdateStatus(newStatus int8) error {
70 if newStatus != LikeStatusActive && newStatus != LikeStatusCancel {
71 return errors.New("无效的状态值")
72 }
73
74 l.Status = newStatus
75 return DB.Model(l).Updates(map[string]interface{}{
76 "status": l.Status,
77 }).Error
78}
79
80// Delete 软删除(更新状态为取消)
81func (l *Like) Delete() error {

Callers 2

DeleteMethod · 0.95
ToggleLikeMethod · 0.45

Calls 1

NewMethod · 0.45

Tested by

no test coverage detected