Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleAddComment ¶
func HandleAddComment(w http.ResponseWriter, r *http.Request)
HandleAddComment 添加评论Handler 请求地址: domain:port/addComment body: 先将key和value进行URL编码 js调用encodeURIComponent()函数 然后再将 key和value 以 key1=value1&key2=value2 的形式编码发送
参数 含义 domain 博客的域名
email 评论者的email displayname 评论者显示的名字(昵称),可选 site 评论者的主页,可选
articlekey 评论文章的特征码(可以使用文章的URL地址) content 评论内容 replyid 如果评论是回复某条评论,则在这里填写回复评论的评论ID,如果不是回复,不要设置这个字段
lastcommentid 客户端最新一条评论的评论id,若不传这个值,服务器会返回刚刚插入的评论,否则返回lastcommentid以后的评论。若找不到lastcommentid所对应的评论。则返回错误。
func HandleCommentList ¶
func HandleCommentList(w http.ResponseWriter, r *http.Request)
HandleCommentList 获取评论列表Handler 请求地址: domain:port/commentList body: 先将key和value进行URL编码 js调用encodeURIComponent()函数 然后再将 key和value 以 key1=value1&key2=value2 的形式编码发送
参数 含义 domain 博客的域名 articlekey 评论文章的特征码(可以使用文章的URL地址) lastcommentid 客户端最新一条评论的评论id,若不传这个值,服务器会返回articlekey下的所有评论,否则返回lastcommentid以后的评论。若找不到lastcommentid所对应的评论。则返回错误。
Types ¶
type CommentResult ¶
type CommentResult struct { //key:userid value:user User map[string]OutUser Comment []OutComment }
CommentResult 服务器返回给客户端的结果数据