|
@@ -0,0 +1,49 @@
|
|
|
+package com.example.nngkxxdp.service.impl;
|
|
|
+
|
|
|
+import com.example.nngkxxdp.dao.SortArticleHeadlinesDao;
|
|
|
+import com.example.nngkxxdp.entity.SortArticleHeadlinesDO;
|
|
|
+import com.example.nngkxxdp.service.SortArticleHeadlinesService;
|
|
|
+import com.example.nngkxxdp.util.ConstStr;
|
|
|
+import com.example.nngkxxdp.util.SendUtil;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * description: 新媒体局政管理
|
|
|
+ *
|
|
|
+ * @author zwq
|
|
|
+ * @date 2022/8/12 9:40
|
|
|
+ */
|
|
|
+@Service("SortArticleHeadlinesService")
|
|
|
+@AllArgsConstructor
|
|
|
+public class SortArticleHeadlinesServiceImpl implements SortArticleHeadlinesService {
|
|
|
+
|
|
|
+ private final SortArticleHeadlinesDao sortArticleHeadlinesDao;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * description: 分页列表
|
|
|
+ * @author zwq
|
|
|
+ * @date 2022/8/12 9:36
|
|
|
+ * @param startRows 开始页
|
|
|
+ * @param limit 一页数量
|
|
|
+ * @param officialAccount 公众号
|
|
|
+ * @param title 标题
|
|
|
+ * @return java.util.Map 分页信息
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> page(Integer startRows, Integer limit, String officialAccount, String title) {
|
|
|
+ long count = sortArticleHeadlinesDao.pageCount(officialAccount, title);
|
|
|
+ if (count == 0) {
|
|
|
+ return SendUtil.layuiTable(count, null);
|
|
|
+ }
|
|
|
+ startRows = (startRows - 1) * limit;
|
|
|
+ List<SortArticleHeadlinesDO> sortArticleHeadlinesDOList = sortArticleHeadlinesDao.pageList(startRows, limit, officialAccount, title);
|
|
|
+ if (!sortArticleHeadlinesDOList.isEmpty()){
|
|
|
+ return SendUtil.layuiTable(count, sortArticleHeadlinesDOList);
|
|
|
+ }
|
|
|
+ return SendUtil.send(false, ConstStr.RESULT_FAILED);
|
|
|
+ }
|
|
|
+}
|