Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

liweifan 3 vuotta sitten
vanhempi
commit
c6997d8a53

+ 1 - 1
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/controller/BbsAuthRecordController.java

@@ -25,7 +25,7 @@ public class BbsAuthRecordController extends BaseController {
     private BbsAuthRecordService bbsAuthRecordService;
 
     @PostMapping("/page")
-    @ApiOperation(value = "查询分页")
+    @ApiOperation(value = "查询文章审核列表")
     public HttpResponseResult<PageInfo<BbsAuthRecordVo>> page(@RequestBody BbsAuthRecordSearch query) {
         IPage<BbsAuthRecordVo> pages = bbsAuthRecordService.selectPage(PageUtil.getPage(query), query);
         return succeed(PageUtil.pageInfo(pages));

+ 1 - 1
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dao/BbsAuthRecordDao.java

@@ -11,7 +11,7 @@ import java.util.List;
 
 public interface BbsAuthRecordDao extends BaseMapper<BbsAuthRecord> {
     /**
-     * 查询审核列表
+     * 查询文章审核列表
      * @param page
      * @param bbsArticle
      * @return

+ 12 - 11
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsAuthRecordSearch.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.bbs.dto.search;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yonge.cooleshow.bbs.enums.ArticleEnum;
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -17,7 +18,7 @@ public class BbsAuthRecordSearch extends QueryInfo {
     private Long labelId;
 
     @ApiModelProperty(value = "审核中:DOING,通过:PASS,驳回:REJECT")
-    private String auditState;
+    private ArticleEnum auditState;
 
     @ApiModelProperty(value = "开始时间")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -29,14 +30,6 @@ public class BbsAuthRecordSearch extends QueryInfo {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTime;
 
-    public Long getLabelId() {
-        return labelId;
-    }
-
-    public void setLabelId(Long labelId) {
-        this.labelId = labelId;
-    }
-
     @Override
     public String getSearch() {
         return search;
@@ -47,11 +40,19 @@ public class BbsAuthRecordSearch extends QueryInfo {
         this.search = search;
     }
 
-    public String getAuditState() {
+    public Long getLabelId() {
+        return labelId;
+    }
+
+    public void setLabelId(Long labelId) {
+        this.labelId = labelId;
+    }
+
+    public ArticleEnum getAuditState() {
         return auditState;
     }
 
-    public void setAuditState(String auditState) {
+    public void setAuditState(ArticleEnum auditState) {
         this.auditState = auditState;
     }
 

+ 1 - 1
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/BbsAuthRecordService.java

@@ -8,7 +8,7 @@ import com.yonge.cooleshow.bbs.vo.BbsAuthRecordVo;
 
 public interface BbsAuthRecordService extends IService<BbsAuthRecord> {
     /**
-     * 分页查询
+     * 查询文章审核列表
      *
      * @param page
      * @param query

+ 56 - 24
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/vo/BbsAuthRecordVo.java

@@ -1,43 +1,59 @@
 package com.yonge.cooleshow.bbs.vo;
 
+import com.yonge.cooleshow.bbs.enums.ArticleEnum;
+import com.yonge.cooleshow.bbs.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 import java.util.Date;
 
 @ApiModel
 public class BbsAuthRecordVo implements Serializable {
+    @ApiModelProperty("文章id")
     private Long articleId;
+
+    @ApiModelProperty("文章标题")
     private String title;
+
+    @ApiModelProperty("发布者id")
     private Long userId;
+
+    @ApiModelProperty("发布者昵称")
     private String userName;
+
+    @ApiModelProperty("发布者真实姓名")
     private String realName;
+
+    @ApiModelProperty("发布者手机号")
     private String phone;
+
+    @ApiModelProperty("标签id")
     private Long labelId;
+
+    @ApiModelProperty("标签名")
     private String labelName;
-    private String status;
-    private Integer replyFlag;
+
+    @ApiModelProperty("文章当前状态 审核中:DOING,通过:PASS,驳回:REJECT")
+    private ArticleEnum status;
+
+    @ApiModelProperty("是否可评论 0:不可评论 1:可评论")
+    private YesOrNoEnum replyFlag;
+
+    @ApiModelProperty("文章发布时间")
     private Date articleCreatedTime;
-    private String auditState;
-    private String reason;
-    private Date createdTime;
-    private Date updatedTime;
 
-    public Date getCreatedTime() {
-        return createdTime;
-    }
+    @ApiModelProperty("审核状态 审核中:DOING,通过:PASS,驳回:REJECT")
+    private ArticleEnum auditState;
 
-    public void setCreatedTime(Date createdTime) {
-        this.createdTime = createdTime;
-    }
+    @ApiModelProperty("审核理由")
+    private String reason;
 
-    public Date getUpdatedTime() {
-        return updatedTime;
-    }
+    @ApiModelProperty("审核时间")
+    private Date createdTime;
 
-    public void setUpdatedTime(Date updatedTime) {
-        this.updatedTime = updatedTime;
-    }
+    @ApiModelProperty("审核更新时间")
+    private Date updatedTime;
 
     public Long getArticleId() {
         return articleId;
@@ -103,19 +119,19 @@ public class BbsAuthRecordVo implements Serializable {
         this.labelName = labelName;
     }
 
-    public String getStatus() {
+    public ArticleEnum getStatus() {
         return status;
     }
 
-    public void setStatus(String status) {
+    public void setStatus(ArticleEnum status) {
         this.status = status;
     }
 
-    public Integer getReplyFlag() {
+    public YesOrNoEnum getReplyFlag() {
         return replyFlag;
     }
 
-    public void setReplyFlag(Integer replyFlag) {
+    public void setReplyFlag(YesOrNoEnum replyFlag) {
         this.replyFlag = replyFlag;
     }
 
@@ -127,11 +143,11 @@ public class BbsAuthRecordVo implements Serializable {
         this.articleCreatedTime = articleCreatedTime;
     }
 
-    public String getAuditState() {
+    public ArticleEnum getAuditState() {
         return auditState;
     }
 
-    public void setAuditState(String auditState) {
+    public void setAuditState(ArticleEnum auditState) {
         this.auditState = auditState;
     }
 
@@ -142,4 +158,20 @@ public class BbsAuthRecordVo implements Serializable {
     public void setReason(String reason) {
         this.reason = reason;
     }
+
+    public Date getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Date createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Date getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Date updatedTime) {
+        this.updatedTime = updatedTime;
+    }
 }

+ 19 - 21
cooleshow-bbs/src/main/resources/config/mybatis/BbsAuthRecordMapper.xml

@@ -23,26 +23,24 @@
         LEFT JOIN bbs_auth_record r ON a.id_=r.article_id_
         LEFT JOIN bbs_config_label l ON a.label_id_ = l.id_
         WHERE a.status_ IN ('DOING','PASS','REJECT')
-        <where>
-            <if test="null != param.search and '' != param.search">
-                AND (
-                u.username_ LIKE CONCAT('%', #{param.search}, '%') OR
-                u.phone_ LIKE CONCAT('%', #{param.search}, '%') OR
-                a.title_ LIKE CONCAT('%', #{param.search}, '%')
-                )
-            </if>
-            <if test="param.auditState !=null and param.auditState !=''">
-                AND a.label_id_ = #{param.labelId}
-            </if>
-            <if test="param.auditState !=null and param.auditState !=''">
-                AND r.audit_state_ = #{param.auditState}
-            </if>
-            <if test="param.startTime !=null">
-                <![CDATA[AND a.create_time_ >= #{param.startTime} ]]>
-            </if>
-            <if test="param.endTime !=null">
-                <![CDATA[AND a.create_time_ <= #{param.endTime} ]]>
-            </if>
-        </where>
+        <if test="null != param.search and '' != param.search">
+            AND (
+            u.username_ LIKE CONCAT('%', #{param.search}, '%') OR
+            u.phone_ LIKE CONCAT('%', #{param.search}, '%') OR
+            a.title_ LIKE CONCAT('%', #{param.search}, '%')
+            )
+        </if>
+        <if test="param.labelId !=null">
+            AND a.label_id_ = #{param.labelId}
+        </if>
+        <if test="param.auditState !=null">
+            AND a.status_ = #{param.auditState}
+        </if>
+        <if test="param.startTime !=null">
+            <![CDATA[AND a.created_time_ >= #{param.startTime} ]]>
+        </if>
+        <if test="param.endTime !=null">
+            <![CDATA[AND a.created_time_ <= #{param.endTime} ]]>
+        </if>
     </select>
 </mapper>