作者 yangfu

fix: 文章详情修改

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