AddComment add comment
(ctx context.Context, comment *entity.Comment)
| 59 | |
| 60 | // AddComment add comment |
| 61 | func (cr *commentRepo) AddComment(ctx context.Context, comment *entity.Comment) (err error) { |
| 62 | comment.ID, err = cr.uniqueIDRepo.GenUniqueIDStr(ctx, comment.TableName()) |
| 63 | if err != nil { |
| 64 | return err |
| 65 | } |
| 66 | _, err = cr.data.DB.Context(ctx).Insert(comment) |
| 67 | if err != nil { |
| 68 | err = errors.InternalServer(reason.DatabaseError).WithError(err).WithStack() |
| 69 | } |
| 70 | return |
| 71 | } |
| 72 | |
| 73 | // RemoveComment delete comment |
| 74 | func (cr *commentRepo) RemoveComment(ctx context.Context, commentID string) (err error) { |
nothing calls this directly
no test coverage detected