Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support rich text in comment #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions service/comment/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ type CreateCommentReq struct {
apiReq *core.APIReq
}
type CreateCommentReqBody struct {
Content string `json:"content"`
Content string `json:"content"`
RichText []interface{} `json:"rich_text"`
}

type CreateCommentResp struct {
Expand Down Expand Up @@ -67,6 +68,10 @@ func (builder *CreateCommentReqBuilder) Content(content string) *CreateCommentRe
builder.body.Content = content
return builder
}
func (builder *CreateCommentReqBuilder) RichText(richText []interface{}) *CreateCommentReqBuilder {
builder.body.RichText = richText
return builder
}
func (builder *CreateCommentReqBuilder) Build() *CreateCommentReq {
req := &CreateCommentReq{}
req.apiReq = builder.apiReq
Expand Down Expand Up @@ -171,7 +176,8 @@ type UpdateCommentReq struct {
apiReq *core.APIReq
}
type UpdateCommentReqBody struct {
Content string `json:"content"`
Content string `json:"content"`
RichText []interface{} `json:"rich_text"`
}

type UpdateCommentResp struct {
Expand Down Expand Up @@ -213,6 +219,10 @@ func (builder *UpdateCommentReqBuilder) Content(content string) *UpdateCommentRe
builder.body.Content = content
return builder
}
func (builder *UpdateCommentReqBuilder) RichText(richText []interface{}) *UpdateCommentReqBuilder {
builder.body.RichText = richText
return builder
}
func (builder *UpdateCommentReqBuilder) Build() *UpdateCommentReq {
req := &UpdateCommentReq{}
req.apiReq = builder.apiReq
Expand Down