mir:fixed new service initial error

pull/196/head
Michael Li 2 years ago
parent 53383b9916
commit 10e5bc470a
No known key found for this signature in database

@ -36,8 +36,6 @@ var (
"public/video": core.AttachmentTypeVideo, "public/video": core.AttachmentTypeVideo,
"attachment": core.AttachmentTypeOther, "attachment": core.AttachmentTypeOther,
} }
_MaxCommentCount = conf.AppSetting.MaxCommentCount
) )
type privSrv struct { type privSrv struct {
@ -517,7 +515,7 @@ func (s *privSrv) CreateComment(req *web.CreateCommentReq) (_ *web.CreateComment
logrus.Errorf("Ds.GetPostByID err:%s", err) logrus.Errorf("Ds.GetPostByID err:%s", err)
return nil, xerror.ServerError return nil, xerror.ServerError
} }
if post.CommentCount >= _MaxCommentCount { if post.CommentCount >= conf.AppSetting.MaxCommentCount {
return nil, _errMaxCommentCount return nil, _errMaxCommentCount
} }
comment := &core.Comment{ comment := &core.Comment{
@ -728,7 +726,7 @@ func (s *privSrv) createPostPreHandler(commentID int64, userID, atUserID int64)
return nil, nil, atUserID, err return nil, nil, atUserID, err
} }
if post.CommentCount >= _MaxCommentCount { if post.CommentCount >= conf.AppSetting.MaxCommentCount {
return nil, nil, atUserID, _errMaxCommentCount return nil, nil, atUserID, _errMaxCommentCount
} }

@ -37,8 +37,6 @@ var (
_ api.Pub = (*pubSrv)(nil) _ api.Pub = (*pubSrv)(nil)
_ api.PubBinding = (*pubBinding)(nil) _ api.PubBinding = (*pubBinding)(nil)
_ api.PubRender = (*pubRender)(nil) _ api.PubRender = (*pubRender)(nil)
_MaxPageSize = conf.AppSetting.MaxPageSize
) )
const ( const (
@ -74,8 +72,8 @@ func (b *pubBinding) BindTweetComments(c *gin.Context) (*web.TweetCommentsReq, m
func (s *pubSrv) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Error) { func (s *pubSrv) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Error) {
// tags, err := broker.GetPostTags(&param) // tags, err := broker.GetPostTags(&param)
num := req.Num num := req.Num
if num > _MaxPageSize { if num > conf.AppSetting.MaxPageSize {
num = _MaxPageSize num = conf.AppSetting.MaxPageSize
} }
conditions := &core.ConditionsT{} conditions := &core.ConditionsT{}

Loading…
Cancel
Save