git 5 年 前
コミット
1048a5f58e

+ 1 - 64
core/src/main/java/com/mooctest/crowd/domain/model/TechnicalArticlesPO.java

@@ -13,6 +13,7 @@ public class TechnicalArticlesPO {
 
     @Id
     @Column(name = "TA_ID")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Long id;
 
     @Column(name = "TA_TITLE")
@@ -30,70 +31,6 @@ public class TechnicalArticlesPO {
     @Column(name = "TA_SOURCE")
     private String source;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getPhotoUrl() {
-        return photoUrl;
-    }
-
-    public void setPhotoUrl(String photoUrl) {
-        this.photoUrl = photoUrl;
-    }
-
-    public String getArticlesUrl() {
-        return articlesUrl;
-    }
-
-    public void setArticlesUrl(String articlesUrl) {
-        this.articlesUrl = articlesUrl;
-    }
-
-    public String getAuthor() {
-        return author;
-    }
-
-    public void setAuthor(String author) {
-        this.author = author;
-    }
-
-    public String getSource() {
-        return source;
-    }
-
-    public void setSource(String source) {
-        this.source = source;
-    }
-
-    public int getReading() {
-        return reading;
-    }
-
-    public void setReading(int reading) {
-        this.reading = reading;
-    }
-
-    public Timestamp getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Timestamp createTime) {
-        this.createTime = createTime;
-    }
-
     @Column(name = "TA_READING")
     private int reading;
 

+ 0 - 68
site/src/main/java/com/mooctest/crowd/site/data/vo/TechnicalArticlesVO.java

@@ -21,77 +21,9 @@ public class TechnicalArticlesVO {
     private String author;
     private String source;
     private String time_interval;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getPhotoUrl() {
-        return photoUrl;
-    }
-
-    public void setPhotoUrl(String photoUrl) {
-        this.photoUrl = photoUrl;
-    }
-
-    public String getArticlesUrl() {
-        return articlesUrl;
-    }
-
-    public void setArticlesUrl(String articlesUrl) {
-        this.articlesUrl = articlesUrl;
-    }
-
-    public String getAuthor() {
-        return author;
-    }
-
-    public void setAuthor(String author) {
-        this.author = author;
-    }
-
-    public String getSource() {
-        return source;
-    }
-
-    public void setSource(String source) {
-        this.source = source;
-    }
-
-    public int getReading() {
-        return reading;
-    }
-
-    public void setReading(int reading) {
-        this.reading = reading;
-    }
-
-    public Timestamp getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Timestamp createTime) {
-        this.createTime = createTime;
-    }
-
     private int reading;
     private Timestamp createTime;
 
-    public void setName(Iterable<TechnicalArticlesPO> technicalArticlesPO) {
-
-    }
 
     public TechnicalArticlesVO(TechnicalArticles project){
         this.id = project.getId();

+ 0 - 2
site/src/main/java/com/mooctest/crowd/site/mediator/ViewMediator.java

@@ -53,8 +53,6 @@ public interface ViewMediator {
 
     List<BaseAuthVO> renderAuthedList();
 
-    List<TechnicalArticlesVO> technicalArticles(Pageable pageable);
-
     // 项目模糊查询
     List<CrowdTestProjectVO>     findByNameLike(String name);
 

+ 0 - 19
site/src/main/java/com/mooctest/crowd/site/mediator/impl/WebMediatorImpl.java

@@ -668,25 +668,6 @@ public class WebMediatorImpl implements ViewMediator {
     }
 
     @Override
-    public List<TechnicalArticlesVO> technicalArticles(Pageable pageable) {
-        List<TechnicalArticlesVO> technicalArticlesVOList = new ArrayList<>();
-        technicalarticlesDao.findAll(pageable).forEach(technicalArticlesPO -> {
-            TechnicalArticlesVO technicalArticlesVO = new TechnicalArticlesVO();
-            technicalArticlesVO.setId(technicalArticlesPO.getId());
-            technicalArticlesVO.setName(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getName());
-            technicalArticlesVO.setPhotoUrl(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getPhotoUrl());
-            technicalArticlesVO.setArticlesUrl(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getArticlesUrl());
-            technicalArticlesVO.setAuthor(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getAuthor());
-            technicalArticlesVO.setSource(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getSource());
-            technicalArticlesVO.setReading(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getReading());
-            technicalArticlesVO.setCreateTime(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getCreateTime());
-            technicalArticlesVOList.add(technicalArticlesVO);
-        });
-        List<TechnicalArticlesVO> results = technicalArticlesVOList.stream().distinct().collect(Collectors.toList());
-        return results;
-    }
-
-    @Override
     public List<CrowdTestProjectVO> findByNameLike(String name) {
         List<CrowdTestProjectVO> authingList = new ArrayList<>();
         authingList.addAll(projectDao.findByNameLike("%"+name+"%").stream().map(crowdTestProjectPO -> {