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

Method Create

api/model/like.go:50–66  ·  view source on GitHub ↗

Create 创建点赞记录

()

Source from the content-addressed store, hash-verified

48
49// Create 创建点赞记录
50func (l *Like) Create() error {
51 if err := l.Validate(); err != nil {
52 return err
53 }
54
55 // 检查是否已存在点赞记录
56 exist, err := l.Exists()
57 if err != nil {
58 return err
59 }
60 if exist {
61 return errors.New("已存在点赞记录")
62 }
63
64 l.Status = LikeStatusActive // 默认激活状态
65 return DB.Create(l).Error
66}
67
68// UpdateStatus 更新点赞状态
69func (l *Like) UpdateStatus(newStatus int8) error {

Callers 15

ToggleLikeMethod · 0.95
createTingwuPipelineFunction · 0.45
createM4aStrategyFunction · 0.45
importSkillAtomicMethod · 0.45
ForceImportSkillMethod · 0.45
appendAgentRunEventInTxFunction · 0.45
submitSkillImportJobMethod · 0.45
ensureInstallationUserFunction · 0.45
MergeChunksMethod · 0.45
CreateApprovalMethod · 0.45

Calls 3

ValidateMethod · 0.95
ExistsMethod · 0.95
NewMethod · 0.45

Tested by

no test coverage detected