Browse Source

完善文章

hfxc226 2 years ago
parent
commit
a81cd6b01b

+ 33 - 32
platform-dao/src/main/java/com/platform/dao/dto/operate/ArticleDTO.java

@@ -4,6 +4,7 @@ import com.platform.common.bean.BaseDTO;
 import com.platform.common.validation.group.UpdateGroup;
 import lombok.Data;
 import lombok.experimental.Accessors;
+
 import javax.validation.constraints.*;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -20,8 +21,8 @@ import java.util.List;
 public class ArticleDTO extends BaseDTO implements Serializable {
 
     /**
-   * ID
-   */
+     * ID
+     */
     @NotNull(groups = {UpdateGroup.class}, message = "ID不能为空")
     private String id;
     /**
@@ -29,8 +30,8 @@ public class ArticleDTO extends BaseDTO implements Serializable {
      */
     private String parentId;
     /**
-   * 类别
-   */
+     * 类别
+     */
     private Integer type;
 
     /**
@@ -39,43 +40,43 @@ public class ArticleDTO extends BaseDTO implements Serializable {
     private List<Integer> types;
 
     /**
-   * 标题
-   */
+     * 标题
+     */
     private String title;
 
     /**
-   * 状态
-   */
+     * 状态
+     */
     private Integer status;
 
     /**
-   * 排序
-   */
+     * 排序
+     */
     private Integer sort;
 
     /**
-   * 是否置顶
-   */
+     * 是否置顶
+     */
     private Integer topFlag;
 
     /**
-   * 简介
-   */
+     * 简介
+     */
     private String introduction;
 
     /**
-   * 内容
-   */
+     * 内容
+     */
     private String content;
 
     /**
-   * 图片
-   */
+     * 图片
+     */
     private String picture;
 
     /**
-   * 点击量
-   */
+     * 点击量
+     */
     private Integer clicks;
 
     /**
@@ -84,33 +85,33 @@ public class ArticleDTO extends BaseDTO implements Serializable {
     private String url;
 
     /**
-   * 创建时间
-   */
+     * 创建时间
+     */
     private LocalDateTime createdTime;
 
     /**
-   * 创建人ID
-   */
+     * 创建人ID
+     */
     private String createdUserId;
 
     /**
-   * 创建人
-   */
+     * 创建人
+     */
     private String createdUserName;
 
     /**
-   * 更新时间
-   */
+     * 更新时间
+     */
     private LocalDateTime updateTime;
 
     /**
-   * 更新人ID
-   */
+     * 更新人ID
+     */
     private String updateUserId;
 
     /**
-   * 更新人
-   */
+     * 更新人
+     */
     private String updateUserName;
 
 

+ 2 - 2
platform-dao/src/main/resources/mapper/operate/ArticleMapper.xml

@@ -6,9 +6,9 @@
         select * from(
             <foreach collection="types" item="item" index="index" separator="union all">
                 (select
-                id, type, parent_id, title, introduction, picture, created_Time, update_time
+                id, type, status, parent_id, title, introduction, picture, created_Time, update_time
                 from
-                t_article where type = ${item} order by update_time DESC limit 0,10)
+                t_article where type = ${item} and status = 1 order by update_time DESC limit 0,10)
             </foreach>
         )as A
         where 1=1