正在显示
2 个修改的文件
包含
7 行增加
和
1 行删除
@@ -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 | +) |
-
请 注册 或 登录 后发表评论