正在显示
3 个修改的文件
包含
7 行增加
和
3 行删除
| @@ -292,6 +292,9 @@ func (l *SystemCreateArticleLogic) getSections(req *types.SystemArticleCreateReq | @@ -292,6 +292,9 @@ func (l *SystemCreateArticleLogic) getSections(req *types.SystemArticleCreateReq | ||
| 292 | sortBy := 1 | 292 | sortBy := 1 |
| 293 | sections := strings.Split(req.Content, "\n") | 293 | sections := strings.Split(req.Content, "\n") |
| 294 | lo.ForEach(sections, func(item string, index int) { | 294 | lo.ForEach(sections, func(item string, index int) { |
| 295 | + //去除空 | ||
| 296 | + item = strings.TrimSpace(item) | ||
| 297 | + if item != "" { | ||
| 295 | section := domain.ArticleSection{ | 298 | section := domain.ArticleSection{ |
| 296 | CompanyId: article.CompanyId, | 299 | CompanyId: article.CompanyId, |
| 297 | Version: article.Version, | 300 | Version: article.Version, |
| @@ -301,6 +304,7 @@ func (l *SystemCreateArticleLogic) getSections(req *types.SystemArticleCreateReq | @@ -301,6 +304,7 @@ func (l *SystemCreateArticleLogic) getSections(req *types.SystemArticleCreateReq | ||
| 301 | } | 304 | } |
| 302 | articleSections = append(articleSections, §ion) | 305 | articleSections = append(articleSections, §ion) |
| 303 | sortBy++ | 306 | sortBy++ |
| 307 | + } | ||
| 304 | }) | 308 | }) |
| 305 | return articleSections | 309 | return articleSections |
| 306 | } | 310 | } |
| @@ -80,7 +80,7 @@ func (l *SystemDeleteArticleLogic) SystemDeleteArticle(req *types.SystemArticleD | @@ -80,7 +80,7 @@ func (l *SystemDeleteArticleLogic) SystemDeleteArticle(req *types.SystemArticleD | ||
| 80 | //消息通知 | 80 | //消息通知 |
| 81 | messageLogic := message.NewMiniSystemLogic(l.ctx, l.svcCtx) | 81 | messageLogic := message.NewMiniSystemLogic(l.ctx, l.svcCtx) |
| 82 | mTime := time.Unix(article.CreatedAt, 0).Format("2006-01-02 15:04") | 82 | mTime := time.Unix(article.CreatedAt, 0).Format("2006-01-02 15:04") |
| 83 | - err = messageLogic.ArticleDeleted(conn, article.CompanyId, article.AuthorId, mTime) | 83 | + err = messageLogic.ArticleDeleted(conn, article.CompanyId, article.AuthorId, mTime, article.Title) |
| 84 | if err != nil { | 84 | if err != nil { |
| 85 | return xerr.NewErrMsgErr("删除失败", err) | 85 | return xerr.NewErrMsgErr("删除失败", err) |
| 86 | } | 86 | } |
| @@ -58,8 +58,8 @@ func (l *MiniSystemLogic) ArticleDefined(conn transaction.Conn, companyId, at in | @@ -58,8 +58,8 @@ func (l *MiniSystemLogic) ArticleDefined(conn transaction.Conn, companyId, at in | ||
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | // ArticleDeleted 帖子删除 | 60 | // ArticleDeleted 帖子删除 |
| 61 | -func (l *MiniSystemLogic) ArticleDeleted(conn transaction.Conn, companyId, at int64, item string) (err error) { | ||
| 62 | - return l.createMessage(conn, companyId, at, domain.MsgTypeNormal, "帖子已删除", fmt.Sprintf("你于%v发布的帖子已被删除,如有疑问,请联系运营管理员了解详情。", item)) | 61 | +func (l *MiniSystemLogic) ArticleDeleted(conn transaction.Conn, companyId, at int64, createdTime, title string) (err error) { |
| 62 | + return l.createMessage(conn, companyId, at, domain.MsgTypeNormal, "帖子已删除", fmt.Sprintf("你于%v发布的帖子[%v]已被删除,如有疑问,请联系运营管理员了解详情。", createdTime, title)) | ||
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | //// ArticleAuth 文章权限变更 | 65 | //// ArticleAuth 文章权限变更 |
-
请 注册 或 登录 后发表评论