MCPcopy
hub / github.com/apache/answer / AddCommentReq

Struct AddCommentReq

internal/schema/comment_schema.go:32–57  ·  view source on GitHub ↗

AddCommentReq add comment request

Source from the content-addressed store, hash-verified

30
31// AddCommentReq add comment request
32type AddCommentReq struct {
33 // object id
34 ObjectID string `validate:"required" json:"object_id"`
35 // reply comment id
36 ReplyCommentID string `validate:"omitempty" json:"reply_comment_id"`
37 // original comment content
38 OriginalText string `validate:"required,notblank,gte=2,lte=600" json:"original_text"`
39 // parsed comment content
40 ParsedText string `json:"-"`
41 // @ user id list
42 MentionUsernameList []string `validate:"omitempty" json:"mention_username_list"`
43 CaptchaID string `json:"captcha_id"`
44 CaptchaCode string `json:"captcha_code"`
45
46 // user id
47 UserID string `json:"-"`
48 // whether user can add it
49 CanAdd bool `json:"-"`
50 // whether user can edit it
51 CanEdit bool `json:"-"`
52 // whether user can delete it
53 CanDelete bool `json:"-"`
54
55 IP string `json:"-"`
56 UserAgent string `json:"-"`
57}
58
59func (req *AddCommentReq) Check() (errFields []*validator.FormErrorField, err error) {
60 req.ParsedText = converter.Markdown2HTML(req.OriginalText)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected