Service层修改 单元测试

This commit is contained in:
禾几海
2020-05-25 22:44:18 +08:00
parent d19e5b6286
commit 030aaaca25
10 changed files with 71 additions and 169 deletions

View File

@@ -20,5 +20,5 @@ public class CategoryModel {
private String name;
private List<Article> articles;
private List<ArticleModel> articles;
}

View File

@@ -1,11 +1,9 @@
package cn.celess.blog.entity.model;
import cn.celess.blog.entity.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;
/**
@@ -21,21 +19,6 @@ public class TagModel {
private String name;
private List<Integer> articles;
private List<ArticleModel> articles;
public TagModel(Tag tag) {
this.id = tag.getId();
this.name = tag.getName();
if (tag.getArticles() == null || tag.getArticles().length() == 0) {
articles = null;
} else {
articles = new ArrayList<>();
for (String s : tag.getArticles().split(",")) {
if ("".equals(s)) {
return;
}
articles.add(Integer.parseInt(s));
}
}
}
}

View File

@@ -11,7 +11,7 @@ public class ArticleReq {
private Long id;
private String title;
private String mdContent;
private String tags;
private String[] tags;
private Boolean type;
private String url;
private String category;