From e343e508ce5f2d355ad82c05a319981c66d1324b Mon Sep 17 00:00:00 2001
From: inleft <inleft@qq.com>
Date: Wed, 02 Mar 2022 01:36:27 +0800
Subject: [PATCH] 评论页追加完成

---
 snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/controller/BlogArticleOutsideController.java |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/controller/BlogArticleOutsideController.java b/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/controller/BlogArticleOutsideController.java
index b206a94..76073b9 100644
--- a/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/controller/BlogArticleOutsideController.java
+++ b/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/controller/BlogArticleOutsideController.java
@@ -43,7 +43,7 @@
 import vip.xiaonuo.modular.blogarticle.entity.BlogArticle;
 import vip.xiaonuo.modular.blogarticle.param.BlogArticleAddDto;
 import vip.xiaonuo.modular.blogarticle.param.BlogArticleQueryDto;
-import vip.xiaonuo.modular.blogarticle.param.BlogArticleVo;
+import vip.xiaonuo.modular.blogarticle.entity.BlogArticleVo;
 import vip.xiaonuo.modular.blogarticle.service.BlogArticleService;
 import vip.xiaonuo.modular.blogarticletype.entity.BlogArticleType;
 import vip.xiaonuo.modular.blogarticletype.service.BlogArticleTypeService;
@@ -124,15 +124,11 @@
         BlogArticle article = new BlogArticle();
         BeanUtil.copyProperties(addDto, article);
         article.setSeparateYear(DateUtil.year(article.getPublishDate()));
-        article.setSeparateMonth(DateUtil.month(article.getPublishDate()));
+        article.setSeparateMonth(DateUtil.month(article.getPublishDate())+1);
         article.setSeparateDay(DateUtil.dayOfMonth(article.getPublishDate()));
 
         article.setIsEnable(MyConstant.Yes);
         blogArticleService.save(article);
-        System.out.println(article.toString());
-
-
-//        blogArticleService.add(blogArticleParam);
         return new SuccessResponseData();
     }
 
@@ -192,7 +188,7 @@
                 throw new BlogException(BlogExceptionEnum.article_auth_error);
             }
             //授权码比对
-            if (!SecureUtil.md5(find.getAuthPassword()).equals(queryDto.getAuthWord())) {
+            if (!find.getAuthPassword().equals(queryDto.getAuthWord())) {
                 throw new BlogException(BlogExceptionEnum.article_auth_pass_error);
             }
         } else if (find.getAuthStatus().equals(MyConstant.AuthStatus.privateCode)) {
@@ -203,16 +199,13 @@
 
         BeanUtil.copyProperties(find, vo);
 
-        if (queryDto.getId() % 2 == 0) {
-            String tempURL = this.getBlogSourceURL(find.getArticleFileId());
 
-            if (StrUtil.isEmpty(tempURL))
-                throw new BlogException(BlogExceptionEnum.article_file_lose);
+        String tempURL = this.getBlogSourceURL(find.getArticleFileId());
 
-            vo.setArticleFileURL(tempURL);
-        } else {
-            vo.setArticleFileURL("http://t.inleft.com/share/book/blog/es-search.md");
-        }
+        if (StrUtil.isEmpty(tempURL))
+            throw new BlogException(BlogExceptionEnum.article_file_lose);
+
+        vo.setArticleFileURL(tempURL);
 
         return new SuccessResponseData(vo);
     }
@@ -223,7 +216,7 @@
             return null;
         } else {
             String blogSourcePrefix = ConstantContextHolder.getBlogSourcePrefix();
-            return blogSourcePrefix + sysFileInfo.getFileBucket() +"/"+ sysFileInfo.getFileObjectName();
+            return blogSourcePrefix + sysFileInfo.getFileBucket() + "/" + sysFileInfo.getFileObjectName();
         }
     }
 

--
Gitblit v1.9.1