作者 庄敏学

合并分支 'dev' 到 'test'

Dev



查看合并请求 !11
... ... @@ -292,15 +292,19 @@ func (l *SystemCreateArticleLogic) getSections(req *types.SystemArticleCreateReq
sortBy := 1
sections := strings.Split(req.Content, "\n")
lo.ForEach(sections, func(item string, index int) {
section := domain.ArticleSection{
CompanyId: article.CompanyId,
Version: article.Version,
ArticleId: article.Id,
Content: item,
SortBy: sortBy,
//去除空
item = strings.TrimSpace(item)
if item != "" {
section := domain.ArticleSection{
CompanyId: article.CompanyId,
Version: article.Version,
ArticleId: article.Id,
Content: item,
SortBy: sortBy,
}
articleSections = append(articleSections, &section)
sortBy++
}
articleSections = append(articleSections, &section)
sortBy++
})
return articleSections
}
... ...
... ... @@ -80,7 +80,7 @@ func (l *SystemDeleteArticleLogic) SystemDeleteArticle(req *types.SystemArticleD
//消息通知
messageLogic := message.NewMiniSystemLogic(l.ctx, l.svcCtx)
mTime := time.Unix(article.CreatedAt, 0).Format("2006-01-02 15:04")
err = messageLogic.ArticleDeleted(conn, article.CompanyId, article.AuthorId, mTime)
err = messageLogic.ArticleDeleted(conn, article.CompanyId, article.AuthorId, mTime, article.Title)
if err != nil {
return xerr.NewErrMsgErr("删除失败", err)
}
... ...
... ... @@ -58,8 +58,8 @@ func (l *MiniSystemLogic) ArticleDefined(conn transaction.Conn, companyId, at in
}
// ArticleDeleted 帖子删除
func (l *MiniSystemLogic) ArticleDeleted(conn transaction.Conn, companyId, at int64, item string) (err error) {
return l.createMessage(conn, companyId, at, domain.MsgTypeNormal, "帖子已删除", fmt.Sprintf("你于%v发布的帖子已被删除,如有疑问,请联系运营管理员了解详情。", item))
func (l *MiniSystemLogic) ArticleDeleted(conn transaction.Conn, companyId, at int64, createdTime, title string) (err error) {
return l.createMessage(conn, companyId, at, domain.MsgTypeNormal, "帖子已删除", fmt.Sprintf("你于%v发布的帖子[%v]已被删除,如有疑问,请联系运营管理员了解详情。", createdTime, title))
}
//// ArticleAuth 文章权限变更
... ...