1.迁移表时添加字段注释

2.修复游客状态评论接口报空指针的问题
This commit is contained in:
wanghaima
2022-10-28 12:33:36 +08:00
parent 4c6ef05fbd
commit d3993a2f08
14 changed files with 123 additions and 120 deletions

View File

@@ -22,8 +22,8 @@ func (c *CommentController) Lists() {
page := pagination.PageUtil(int(count), pageIndex, conf.PageSize, comments)
var data struct {
DocId int `json:"doc_id"`
Page pagination.Page `json:"page"`
DocId int `json:"doc_id"`
Page pagination.Page `json:"page"`
}
data.DocId = docid
data.Page = page
@@ -43,6 +43,9 @@ func (c *CommentController) Create() {
m := models.NewComment()
m.DocumentId = id
if c.Member == nil {
c.JsonResult(1, "请先登录,再评论")
}
if len(c.Member.RealName) != 0 {
m.Author = c.Member.RealName
} else {
@@ -56,7 +59,7 @@ func (c *CommentController) Create() {
m.Insert()
var data struct {
DocId int `json:"doc_id"`
DocId int `json:"doc_id"`
}
data.DocId = id