diff --git a/module-article/src/main/java/ink/wgink/module/article/controller/api/content/ContentController.java b/module-article/src/main/java/ink/wgink/module/article/controller/api/content/ContentController.java index 7e786af8..11b5544f 100644 --- a/module-article/src/main/java/ink/wgink/module/article/controller/api/content/ContentController.java +++ b/module-article/src/main/java/ink/wgink/module/article/controller/api/content/ContentController.java @@ -102,7 +102,7 @@ public class ContentController extends DefaultBaseController { @ApiOperation(value = "文章内容列表", notes = "文章内容列表接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiImplicitParams({ - @ApiImplicitParam(name = "articleCategoryId", value = "文章目录", paramType = "query", dataType = "String") + @ApiImplicitParam(name = "categoryId", value = "文章目录", paramType = "query", dataType = "String") }) @GetMapping("list") public List list() { @@ -117,7 +117,7 @@ public class ContentController extends DefaultBaseController { @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"), - @ApiImplicitParam(name = "articleCategoryId", value = "文章目录", paramType = "query", dataType = "String") + @ApiImplicitParam(name = "categoryId", value = "文章目录", paramType = "query", dataType = "String") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpage") @@ -129,7 +129,7 @@ public class ContentController extends DefaultBaseController { @ApiOperation(value = "统计文章数量", notes = "统计文章数量接口") @ApiImplicitParams({ - @ApiImplicitParam(name = "articleCategoryId", value = "文章目录", paramType = "query", dataType = "String") + @ApiImplicitParam(name = "categoryId", value = "文章目录", paramType = "query", dataType = "String") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("count") diff --git a/module-article/src/main/java/ink/wgink/module/article/controller/route/content/ContentRouteController.java b/module-article/src/main/java/ink/wgink/module/article/controller/route/content/ContentRouteController.java index da626b25..3b70005e 100644 --- a/module-article/src/main/java/ink/wgink/module/article/controller/route/content/ContentRouteController.java +++ b/module-article/src/main/java/ink/wgink/module/article/controller/route/content/ContentRouteController.java @@ -29,6 +29,11 @@ public class ContentRouteController { @Autowired private ICategoryService categoryService; + @GetMapping("get") + public ModelAndView get() { + return new ModelAndView("content/get"); + } + @GetMapping("list") public ModelAndView list() { return new ModelAndView("content/list"); diff --git a/module-article/src/main/java/ink/wgink/module/article/pojo/dtos/content/ContentDTO.java b/module-article/src/main/java/ink/wgink/module/article/pojo/dtos/content/ContentDTO.java index a7eb6927..1bedf3ba 100644 --- a/module-article/src/main/java/ink/wgink/module/article/pojo/dtos/content/ContentDTO.java +++ b/module-article/src/main/java/ink/wgink/module/article/pojo/dtos/content/ContentDTO.java @@ -43,6 +43,8 @@ public class ContentDTO { private String categorySummary; @ApiModelProperty(name = "gmtCreate", value = "创建时间") private String gmtCreate; + @ApiModelProperty(name = "coverPhotos", value = "封面图") + private String coverPhotos; public String getContentId() { return contentId == null ? "" : contentId; @@ -163,4 +165,12 @@ public class ContentDTO { public void setGmtCreate(String gmtCreate) { this.gmtCreate = gmtCreate; } + + public String getCoverPhotos() { + return coverPhotos == null ? "" : coverPhotos; + } + + public void setCoverPhotos(String coverPhotos) { + this.coverPhotos = coverPhotos; + } } diff --git a/module-article/src/main/java/ink/wgink/module/article/pojo/vos/content/ContentVO.java b/module-article/src/main/java/ink/wgink/module/article/pojo/vos/content/ContentVO.java index 9ece5659..120d815f 100644 --- a/module-article/src/main/java/ink/wgink/module/article/pojo/vos/content/ContentVO.java +++ b/module-article/src/main/java/ink/wgink/module/article/pojo/vos/content/ContentVO.java @@ -40,6 +40,8 @@ public class ContentVO { private String sort; @ApiModelProperty(name = "categoryId", value = "文章类别") private String categoryId; + @ApiModelProperty(name = "coverPhotos", value = "封面图") + private String coverPhotos; public String getTitle() { return title == null ? "" : title; @@ -129,4 +131,11 @@ public class ContentVO { this.categoryId = categoryId; } + public String getCoverPhotos() { + return coverPhotos == null ? "" : coverPhotos; + } + + public void setCoverPhotos(String coverPhotos) { + this.coverPhotos = coverPhotos; + } } diff --git a/module-article/src/main/resources/mybatis/mapper/content/content-mapper.xml b/module-article/src/main/resources/mybatis/mapper/content/content-mapper.xml index 6b845518..6478cfe0 100644 --- a/module-article/src/main/resources/mybatis/mapper/content/content-mapper.xml +++ b/module-article/src/main/resources/mybatis/mapper/content/content-mapper.xml @@ -20,6 +20,7 @@ + @@ -35,6 +36,7 @@ `author` varchar(255) DEFAULT NULL COMMENT '作者', `publish_date` varchar(40) DEFAULT NULL COMMENT '发布时间', `is_publish` int(11) DEFAULT NULL COMMENT '是否发布', + `cover_photos` varchar(255) DEFAULT NULL COMMENT '封面图片', `content` longtext COMMENT '正文', `category_id` char(36) DEFAULT NULL COMMENT '文章类别', `sort` varchar(255) DEFAULT NULL COMMENT '文章排序', @@ -60,6 +62,7 @@ author, publish_date, is_publish, + cover_photos, content, sort, category_id, @@ -78,6 +81,7 @@ #{author}, #{publishDate}, #{isPublish}, + #{coverPhotos}, #{content}, #{sort}, #{categoryId}, @@ -133,6 +137,9 @@ is_publish = #{isPublish}, + + cover_photos = #{coverPhotos}, + content = #{content}, @@ -156,6 +163,7 @@ t1.author, t1.publish_date, t1.is_publish, + t1.cover_photos, t1.content, t1.category_id, t1.sort, @@ -180,6 +188,7 @@ t1.author, t1.publish_date, t1.is_publish, + t1.cover_photos, t1.content, t1.category_id, jt1.title category_title, diff --git a/module-article/src/main/resources/templates/content/get.html b/module-article/src/main/resources/templates/content/get.html new file mode 100644 index 00000000..1b523cc6 --- /dev/null +++ b/module-article/src/main/resources/templates/content/get.html @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + +
+
+
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/module-article/src/main/resources/templates/content/list-category.html b/module-article/src/main/resources/templates/content/list-category.html index ff3204bf..3e96ad09 100644 --- a/module-article/src/main/resources/templates/content/list-category.html +++ b/module-article/src/main/resources/templates/content/list-category.html @@ -134,6 +134,11 @@ return ''; } }, + {field: 'view', width: 80, title: '操作', align:'center', fixed: 'right', + templet: function(row) { + return ''; + } + }, ] ], page: true, @@ -278,6 +283,14 @@ updatePublishStatus(data.contentId, 1); } else if(layEvent === 'unPublishEvent') { updatePublishStatus(data.contentId, 0); + } else if(layEvent === 'viewEvent') { + top.dialog.open({ + url: top.restAjax.path('route/content/get?contentId={contentId}', [data.contentId]), + title: '文章预览', + width: '600px', + height: '80%', + onClose: function() {} + }); } }); }); diff --git a/module-article/src/main/resources/templates/content/list.html b/module-article/src/main/resources/templates/content/list.html index 28c543ab..9205fdb0 100644 --- a/module-article/src/main/resources/templates/content/list.html +++ b/module-article/src/main/resources/templates/content/list.html @@ -161,6 +161,11 @@ return ''; } }, + {field: 'view', width: 80, title: '操作', align:'center', fixed: 'right', + templet: function(row) { + return ''; + } + }, ] ], page: true, @@ -306,6 +311,14 @@ updatePublishStatus(data.contentId, 1); } else if(layEvent === 'unPublishEvent') { updatePublishStatus(data.contentId, 0); + } else if(layEvent === 'viewEvent') { + top.dialog.open({ + url: top.restAjax.path('route/content/get?contentId={contentId}', [data.contentId]), + title: '文章预览', + width: '600px', + height: '80%', + onClose: function() {} + }); } }); }); diff --git a/module-article/src/main/resources/templates/content/save-category.html b/module-article/src/main/resources/templates/content/save-category.html index 1c8f15c7..9f69acd5 100644 --- a/module-article/src/main/resources/templates/content/save-category.html +++ b/module-article/src/main/resources/templates/content/save-category.html @@ -9,6 +9,7 @@ +
@@ -25,16 +26,22 @@
-
- -
- +
+
+
+ +
+ +
+
-
-
- -
- +
+
+ +
+ +
+
@@ -84,6 +91,36 @@
+
+ +
+ +
+ +
+
@@ -103,6 +140,7 @@
+
-
- -
- +
+
+
+ +
+ +
+
-
-
- -
- +
+
+ +
+ +
+
@@ -92,6 +99,36 @@
+
+ +
+ +
+ +
+
@@ -111,6 +148,7 @@
+ +
+
@@ -103,6 +140,7 @@
+
-
- -
- +
+
+
+ +
+ +
+
-
-
- -
- +
+
+ +
+ +
+
@@ -92,6 +99,36 @@
+
+ +
+ +
+ +
+
@@ -111,6 +148,7 @@
+