diff --git a/src/main/java/com/imyeyu/server/modules/blog/entity/Article.java b/src/main/java/com/imyeyu/server/modules/blog/entity/Article.java index e4a7f31..94c6b90 100644 --- a/src/main/java/com/imyeyu/server/modules/blog/entity/Article.java +++ b/src/main/java/com/imyeyu/server/modules/blog/entity/Article.java @@ -25,9 +25,6 @@ public class Article extends Entity implements CommentSupport, Destroyable { */ public enum Type { - /** 关于 */ - ABOUT, - /** 公版 */ PUBLIC, @@ -44,9 +41,6 @@ public class Article extends Entity implements CommentSupport, Destroyable { /** 类型 */ protected Type type; - /** 分类 ID */ - protected long classId; - /** 摘要 */ protected String digest; @@ -62,7 +56,7 @@ public class Article extends Entity implements CommentSupport, Destroyable { /** 喜欢数量 */ protected int likes; - /** 是否显示评论 */ + /** true 为显示评论 */ protected boolean showComment; /** true 为可评论 */ @@ -71,6 +65,9 @@ public class Article extends Entity implements CommentSupport, Destroyable { /** true 为可排位 */ protected boolean canRanking; + /** true 为可通过列表查询 */ + protected boolean canList; + /** @return true 为可评论 */ @Override public boolean canComment() { diff --git a/src/main/resources/mapper/blog/ArticleMapper.xml b/src/main/resources/mapper/blog/ArticleMapper.xml index 839eb71..a0887a0 100644 --- a/src/main/resources/mapper/blog/ArticleMapper.xml +++ b/src/main/resources/mapper/blog/ArticleMapper.xml @@ -2,27 +2,24 @@ article - - article.id, - article.type, - article.title, - article.digest, - article.likes, - article.reads, - article.created_at, - article.updated_at + `id`, + `type`, + `title`, + `digest`, + `likes`, + `reads`, + `created_at`, + `updated_at` - - - + FROM article WHERE - 1 < article.id - AND article.deleted_at IS NULL + can_list IS TRUE + AND deleted_at IS NULL - - - FROM - article - WHERE - 1 < article.id - AND ( - article.title LIKE CONCAT('%', #{keyword}, '%') - OR article.digest LIKE CONCAT('%', #{keyword}, '%') - ) - AND article.deleted_at IS NULL + + AND ( + `title` LIKE CONCAT('%', #{keyword}, '%') + OR `digest` LIKE CONCAT('%', #{keyword}, '%') + ) - \ No newline at end of file +