Przeglądaj źródła

修改用户展示页面-根据模块获取新闻-vo

xusonglin 5 lat temu
rodzic
commit
d07594697e

+ 32 - 0
src/main/java/com/jkcredit/sysnews/model/vo/newsArticle/NewsArticleBizVo.java

@@ -0,0 +1,32 @@
+package com.jkcredit.sysnews.model.vo.newsArticle;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/3/29 17:37
+ * @version: V1.0
+ **/
+@Data
+public class NewsArticleBizVo implements Serializable {
+    private static final long serialVersionUID = -7285944233786299821L;
+
+    private Long id;
+
+    private String title;
+
+    private String newsAbstract;
+
+    private Long photoId;
+
+    private Date createTime;
+
+    private String photoUrl;
+
+    private Integer topFlag;
+}

+ 5 - 1
src/main/java/com/jkcredit/sysnews/resource/biz/newsArticle/NewsArticleBizResource.java

@@ -1,5 +1,6 @@
 package com.jkcredit.sysnews.resource.biz.newsArticle;
 
+import com.jkcredit.sysnews.model.vo.newsArticle.NewsArticleBizVo;
 import com.jkcredit.sysnews.model.vo.newsArticle.NewsArticleVo;
 import com.jkcredit.sysnews.resource.base.BizResource;
 import com.jkcredit.sysnews.service.newsArticle.NewsArticleService;
@@ -30,11 +31,14 @@ public class NewsArticleBizResource extends BizResource {
     @ApiOperation("用户展示页面-根据模块id获取新闻")
     public ResponseData getNewsArticlesByNavigationBarId(@PathVariable Long id) {
         try {
-            List<NewsArticleVo> newsArticleVoList = newsArticleService.getNewsArticleByNavigationBarId(id);
+            List<NewsArticleBizVo> newsArticleVoList = newsArticleService.getNewsArticleByNavigationBarId(id);
             return ResponseData.success(newsArticleVoList);
         } catch (ServiceException e) {
             log.error(e.getMessage());
             return ResponseData.failed("获取新闻失败");
         }
     }
+    // todo getNewsArticleById
+    // todo 根据模块id获取新闻 内容 可以去掉
+    // todo 用户展示页面-获取全部友情链接 图片看下有没有
 }

+ 2 - 1
src/main/java/com/jkcredit/sysnews/service/newsArticle/NewsArticleService.java

@@ -3,6 +3,7 @@ package com.jkcredit.sysnews.service.newsArticle;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.sysnews.model.dto.newsArticle.NewsArticleDto;
+import com.jkcredit.sysnews.model.vo.newsArticle.NewsArticleBizVo;
 import com.jkcredit.sysnews.model.vo.newsArticle.NewsArticleVo;
 
 import java.util.List;
@@ -24,5 +25,5 @@ public interface NewsArticleService {
 
     void deleteNewsArticle(Long id);
 
-    List<NewsArticleVo> getNewsArticleByNavigationBarId(Long id);
+    List<NewsArticleBizVo> getNewsArticleByNavigationBarId(Long id);
 }

+ 4 - 3
src/main/java/com/jkcredit/sysnews/service/newsArticle/NewsArticleServiceImpl.java

@@ -13,6 +13,7 @@ import com.jkcredit.sysnews.model.po.newsArticle.NewsArticlePo;
 import com.jkcredit.sysnews.model.po.newsArticleNavigationBar.NewsArticleNavigationBarPo;
 import com.jkcredit.sysnews.model.po.newsArticlePhoto.NewsArticlePhotoPo;
 import com.jkcredit.sysnews.model.po.photo.PhotoPo;
+import com.jkcredit.sysnews.model.vo.newsArticle.NewsArticleBizVo;
 import com.jkcredit.sysnews.model.vo.newsArticle.NewsArticleVo;
 import com.jkcredit.sysnews.model.vo.photo.PhotoVo;
 import com.jkcredit.sysnews.service.base.BaseService;
@@ -343,13 +344,13 @@ public class NewsArticleServiceImpl extends BaseService implements NewsArticleSe
     }
 
     @Override
-    public List<NewsArticleVo> getNewsArticleByNavigationBarId(Long id) {
+    public List<NewsArticleBizVo> getNewsArticleByNavigationBarId(Long id) {
         AssertUtils.assertNotNull(id, "id不能为空");
         try {
             List<NewsArticlePo> newsArticlePoList = mapper.getNewsArticleByNavigationBarId(id);
-            List<NewsArticleVo> newsArticleVoList = new ArrayList<>();
+            List<NewsArticleBizVo> newsArticleVoList = new ArrayList<>();
             for (NewsArticlePo po : newsArticlePoList) {
-                NewsArticleVo newsArticleVo = new NewsArticleVo();
+                NewsArticleBizVo newsArticleVo = new NewsArticleBizVo();
                 BeanUtil.copyProperties(newsArticleVo, po);
                 if (po.getPhotoUrl() != null) {
                     String url = accessPath + accessResource + po.getPhotoUrl().replace("/","");