作者 yangfu

fix: 文章详情修改

@@ -327,7 +327,7 @@ func (l *SystemUpdateArticleLogic) getSections(req *types.SystemArticleUpdateReq @@ -327,7 +327,7 @@ func (l *SystemUpdateArticleLogic) getSections(req *types.SystemArticleUpdateReq
327 lo.ForEach(req.Section, func(item types.ArticleSection, index int) { 327 lo.ForEach(req.Section, func(item types.ArticleSection, index int) {
328 strList := strings.Split(item.Content, "\n") 328 strList := strings.Split(item.Content, "\n")
329 for key, value := range strList { 329 for key, value := range strList {
330 - if value == "" && item.ParagraphType != 2 { 330 + if value == "" && item.ParagraphType == domain.ParagraphTypeNone {
331 continue 331 continue
332 } 332 }
333 section := domain.ArticleSection{ 333 section := domain.ArticleSection{
@@ -40,3 +40,9 @@ type SortArticleSection []*ArticleSection @@ -40,3 +40,9 @@ type SortArticleSection []*ArticleSection
40 func (a SortArticleSection) Len() int { return len(a) } 40 func (a SortArticleSection) Len() int { return len(a) }
41 func (a SortArticleSection) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 41 func (a SortArticleSection) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
42 func (a SortArticleSection) Less(i, j int) bool { return a[i].SortBy < a[j].SortBy } 42 func (a SortArticleSection) Less(i, j int) bool { return a[i].SortBy < a[j].SortBy }
  43 +
  44 +const (
  45 + ParagraphTypeNone = 0
  46 + ParagraphTypeText = 1
  47 + ParagraphTypeImages = 2
  48 +)