UpdateCommentReq update comment request
| 79 | |
| 80 | // UpdateCommentReq update comment request |
| 81 | type UpdateCommentReq struct { |
| 82 | // comment id |
| 83 | CommentID string `validate:"required" json:"comment_id"` |
| 84 | // original comment content |
| 85 | OriginalText string `validate:"required,notblank,gte=2,lte=600" json:"original_text"` |
| 86 | // parsed comment content |
| 87 | ParsedText string `json:"-"` |
| 88 | // user id |
| 89 | UserID string `json:"-"` |
| 90 | IsAdmin bool `json:"-"` |
| 91 | |
| 92 | // whether user can edit it |
| 93 | CanEdit bool `json:"-"` |
| 94 | |
| 95 | // whether user can delete it |
| 96 | CaptchaID string `json:"captcha_id"` // captcha_id |
| 97 | CaptchaCode string `json:"captcha_code"` |
| 98 | } |
| 99 | |
| 100 | func (req *UpdateCommentReq) Check() (errFields []*validator.FormErrorField, err error) { |
| 101 | req.ParsedText = converter.Markdown2HTML(req.OriginalText) |
nothing calls this directly
no outgoing calls
no test coverage detected