diff --git a/pom.xml b/pom.xml
index 16c8bbc..bd2ce30 100644
--- a/pom.xml
+++ b/pom.xml
@@ -180,11 +180,6 @@
weixin-java-open
3.7.0
-
- com.github.binarywang
- java-emoji-converter
- 1.0.0
-
diff --git a/src/main/java/com/rymcu/vertical/dto/ArticleDTO.java b/src/main/java/com/rymcu/vertical/dto/ArticleDTO.java
index 50cedc3..aaa0759 100644
--- a/src/main/java/com/rymcu/vertical/dto/ArticleDTO.java
+++ b/src/main/java/com/rymcu/vertical/dto/ArticleDTO.java
@@ -53,4 +53,6 @@ public class ArticleDTO {
private List articleComments;
private List portfolios;
+
+ private Integer sortNo;
}
diff --git a/src/main/java/com/rymcu/vertical/dto/PortfolioArticleDTO.java b/src/main/java/com/rymcu/vertical/dto/PortfolioArticleDTO.java
index e50c381..adb755a 100644
--- a/src/main/java/com/rymcu/vertical/dto/PortfolioArticleDTO.java
+++ b/src/main/java/com/rymcu/vertical/dto/PortfolioArticleDTO.java
@@ -18,4 +18,6 @@ public class PortfolioArticleDTO {
private String portfolioTitle;
+ private Integer sortNo;
+
}
diff --git a/src/main/java/com/rymcu/vertical/entity/Portfolio.java b/src/main/java/com/rymcu/vertical/entity/Portfolio.java
index c18877a..3cd2482 100644
--- a/src/main/java/com/rymcu/vertical/entity/Portfolio.java
+++ b/src/main/java/com/rymcu/vertical/entity/Portfolio.java
@@ -28,6 +28,8 @@ public class Portfolio {
private Integer portfolioAuthorId;
/** 作品集介绍 */
private String portfolioDescription;
+ /** 作品集介绍 Html */
+ private String portfolioDescriptionHtml;
/** 创建时间 */
private Date createdTime;
/** 更新时间 */
diff --git a/src/main/java/com/rymcu/vertical/mapper/PortfolioMapper.java b/src/main/java/com/rymcu/vertical/mapper/PortfolioMapper.java
index c259b09..f9a11fb 100644
--- a/src/main/java/com/rymcu/vertical/mapper/PortfolioMapper.java
+++ b/src/main/java/com/rymcu/vertical/mapper/PortfolioMapper.java
@@ -21,9 +21,10 @@ public interface PortfolioMapper extends Mapper {
/**
* 查询作品集
* @param id
+ * @param type
* @return
*/
- PortfolioDTO selectPortfolioDTOById(@Param("id") Integer id);
+ PortfolioDTO selectPortfolioDTOById(@Param("id") Integer id, @Param("type") Integer type);
/**
* 统计作品集下文章数
@@ -55,4 +56,13 @@ public interface PortfolioMapper extends Mapper {
* @return
*/
Integer selectMaxSortNo(@Param("idPortfolio") Integer idPortfolio);
+
+ /**
+ * 更新文章排序号
+ * @param idPortfolio
+ * @param idArticle
+ * @param sortNo
+ * @return
+ */
+ Integer updateArticleSortNo(@Param("idPortfolio") Integer idPortfolio, @Param("idArticle") Integer idArticle, @Param("sortNo") Integer sortNo);
}
diff --git a/src/main/java/com/rymcu/vertical/service/PortfolioService.java b/src/main/java/com/rymcu/vertical/service/PortfolioService.java
index 9291e5c..ffd5241 100644
--- a/src/main/java/com/rymcu/vertical/service/PortfolioService.java
+++ b/src/main/java/com/rymcu/vertical/service/PortfolioService.java
@@ -24,9 +24,10 @@ public interface PortfolioService extends Service {
/** 查询作品集
* @param idPortfolio
+ * @param type
* @return
*/
- PortfolioDTO findPortfolioDTOById(Integer idPortfolio);
+ PortfolioDTO findPortfolioDTOById(Integer idPortfolio, Integer type);
/**
* 保持/更新作品集
@@ -54,4 +55,11 @@ public interface PortfolioService extends Service {
* @return
*/
Map bindArticle(PortfolioArticleDTO portfolioArticle);
+
+ /**
+ * 更新文章排序号
+ * @param portfolioArticle
+ * @return
+ */
+ Map updateArticleSortNo(PortfolioArticleDTO portfolioArticle);
}
diff --git a/src/main/java/com/rymcu/vertical/service/impl/PortfolioServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/PortfolioServiceImpl.java
index 3fc3a32..0cb5cb4 100644
--- a/src/main/java/com/rymcu/vertical/service/impl/PortfolioServiceImpl.java
+++ b/src/main/java/com/rymcu/vertical/service/impl/PortfolioServiceImpl.java
@@ -48,8 +48,8 @@ public class PortfolioServiceImpl extends AbstractService implements
}
@Override
- public PortfolioDTO findPortfolioDTOById(Integer idPortfolio) {
- PortfolioDTO portfolio = portfolioMapper.selectPortfolioDTOById(idPortfolio);
+ public PortfolioDTO findPortfolioDTOById(Integer idPortfolio, Integer type) {
+ PortfolioDTO portfolio = portfolioMapper.selectPortfolioDTOById(idPortfolio,type);
Author author = userService.selectAuthor(portfolio.getPortfolioAuthorId());
genPortfolioAuthor(portfolio,author);
Integer articleNumber = portfolioMapper.selectCountArticleNumber(portfolio.getIdPortfolio());
@@ -106,6 +106,27 @@ public class PortfolioServiceImpl extends AbstractService implements
return map;
}
+ @Override
+ public Map updateArticleSortNo(PortfolioArticleDTO portfolioArticle) {
+ Map map = new HashMap(1);
+ if (portfolioArticle.getIdPortfolio() == null || portfolioArticle.getIdPortfolio() == 0) {
+ map.put("message", "作品集数据异常!");
+ }
+ if (portfolioArticle.getIdArticle() == null || portfolioArticle.getIdArticle() == 0) {
+ map.put("message", "文章数据异常!");
+ }
+ if (portfolioArticle.getSortNo() == null) {
+ map.put("message", "排序号不能为空!");
+ }
+ Integer result = portfolioMapper.updateArticleSortNo(portfolioArticle.getIdPortfolio(),portfolioArticle.getIdArticle(),portfolioArticle.getSortNo());
+ if (result > 0) {
+ map.put("message", "更新成功!");
+ } else {
+ map.put("message", "更新失败!");
+ }
+ return map;
+ }
+
private PortfolioDTO genPortfolioAuthor(PortfolioDTO portfolioDTO, Author author) {
portfolioDTO.setPortfolioAuthorAvatarUrl(author.getUserAvatarURL());
portfolioDTO.setPortfolioAuthorName(author.getUserNickname());
diff --git a/src/main/java/com/rymcu/vertical/web/api/common/CommonApiController.java b/src/main/java/com/rymcu/vertical/web/api/common/CommonApiController.java
index 311fc80..722b5bc 100644
--- a/src/main/java/com/rymcu/vertical/web/api/common/CommonApiController.java
+++ b/src/main/java/com/rymcu/vertical/web/api/common/CommonApiController.java
@@ -124,7 +124,7 @@ public class CommonApiController {
@GetMapping("/portfolio/{id}")
@VisitLogger
public GlobalResult