This commit is contained in:
quantulr
2023-11-07 17:21:11 +08:00
parent d6e1cdf5ba
commit 76e65829c3
9 changed files with 300 additions and 212 deletions

View File

@ -24,8 +24,8 @@ server:
# 框架配置
spring:
profiles:
active: dev
# profiles:
# active: dev
mvc:
static-path-pattern: /api/static/**
throw-exception-if-no-handler-found: true

View File

@ -240,22 +240,23 @@ public class PcServiceImpI implements IPcService {
.eq("id", article.getCid())
.eq("is_delete", 0));
// TODO: 传入参数判断上下一条记录是否与当前同一分类
// 上一条记录
Article prev = articleMapper.selectOne(new QueryWrapper<Article>()
.select("id,title")
.eq(article.getCid() != null, "cid", article.getCid())
.lt("id", id)
.eq("is_delete", 0)
.eq(article.getCid() != null, "cid", article.getCid())
.orderByDesc(Arrays.asList("sort", "id"))
.last("limit 1"));
// 下一条记录
Article next = articleMapper.selectOne(new QueryWrapper<Article>()
.select("id,title")
.eq(article.getCid() != null, "cid", article.getCid())
.gt("id", id)
.eq("is_delete", 0)
.eq(article.getCid() != null, "cid", article.getCid())
.orderByDesc(Arrays.asList("sort", "id"))
.orderByAsc(Arrays.asList("sort", "id"))
.last("limit 1"));
// 是否收藏

View File

@ -17,8 +17,8 @@ server:
# 框架配置
spring:
profiles:
active: dev
# profiles:
# active: dev
mvc:
static-path-pattern: /api/static/**
throw-exception-if-no-handler-found: true