MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / CreateComment

Method CreateComment

internal/repository/dao/comment.go:59–66  ·  view source on GitHub ↗

CreateComment 创建评论

(ctx context.Context, comment Comment)

Source from the content-addressed store, hash-verified

57
58// CreateComment 创建评论
59func (c *commentDAO) CreateComment(ctx context.Context, comment Comment) (int64, error) {
60
61 if err := c.db.WithContext(ctx).Create(&comment).Error; err != nil {
62 c.l.Error("创建评论失败", zap.Error(err))
63 return 0, err
64 }
65 return comment.Id, nil
66}
67
68// FindCommentByCommentId 根据commentId查找评论
69func (c *commentDAO) FindCommentByCommentId(ctx context.Context, commentId int64) (Comment, error) {

Callers

nothing calls this directly

Calls 1

CreateMethod · 0.65

Tested by

no test coverage detected