From 7f80c71c5a8e3da69feed1c27a28e47f5c5c2bc1 Mon Sep 17 00:00:00 2001 From: wxl <727869402@qq.com> Date: Thu, 26 Dec 2024 00:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=9B=9E=E5=A4=8D=E7=82=B9?= =?UTF-8?q?=E8=B5=9E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dd/admin/business/api/AuthApi.java | 55 ++++++++++-- .../dd/admin/business/note/domain/NoteVo.java | 4 - .../business/note/mapper/xml/NoteMapper.xml | 6 +- .../admin/business/reply/domain/ReplyDto.java | 5 +- .../admin/business/reply/domain/ReplyVo.java | 11 +-- .../dd/admin/business/reply/entity/Reply.java | 2 +- .../business/reply/mapper/xml/ReplyMapper.xml | 34 +++++-- .../controller/UpReplysController.java | 88 +++++++++++++++++++ .../business/upReplys/domain/UpReplysDto.java | 55 ++++++++++++ .../business/upReplys/domain/UpReplysVo.java | 51 +++++++++++ .../business/upReplys/entity/UpReplys.java | 62 +++++++++++++ .../upReplys/mapper/UpReplysMapper.java | 28 ++++++ .../upReplys/mapper/xml/UpReplysMapper.xml | 33 +++++++ .../upReplys/service/UpReplysService.java | 28 ++++++ .../service/impl/UpReplysServiceImpl.java | 47 ++++++++++ 15 files changed, 479 insertions(+), 30 deletions(-) create mode 100644 src/main/java/com/dd/admin/business/upReplys/controller/UpReplysController.java create mode 100644 src/main/java/com/dd/admin/business/upReplys/domain/UpReplysDto.java create mode 100644 src/main/java/com/dd/admin/business/upReplys/domain/UpReplysVo.java create mode 100644 src/main/java/com/dd/admin/business/upReplys/entity/UpReplys.java create mode 100644 src/main/java/com/dd/admin/business/upReplys/mapper/UpReplysMapper.java create mode 100644 src/main/java/com/dd/admin/business/upReplys/mapper/xml/UpReplysMapper.xml create mode 100644 src/main/java/com/dd/admin/business/upReplys/service/UpReplysService.java create mode 100644 src/main/java/com/dd/admin/business/upReplys/service/impl/UpReplysServiceImpl.java diff --git a/src/main/java/com/dd/admin/business/api/AuthApi.java b/src/main/java/com/dd/admin/business/api/AuthApi.java index c60cf52..df4c1a3 100644 --- a/src/main/java/com/dd/admin/business/api/AuthApi.java +++ b/src/main/java/com/dd/admin/business/api/AuthApi.java @@ -28,6 +28,8 @@ import com.dd.admin.business.upNotes.domain.UpNotesDto; import com.dd.admin.business.upNotes.domain.UpNotesVo; import com.dd.admin.business.upNotes.entity.UpNotes; import com.dd.admin.business.upNotes.service.UpNotesService; +import com.dd.admin.business.upReplys.entity.UpReplys; +import com.dd.admin.business.upReplys.service.UpReplysService; import com.dd.admin.common.aop.operationLog.aop.OperLog; import com.dd.admin.common.aop.operationLog.aop.OperType; import com.dd.admin.common.model.result.ResultBean; @@ -45,10 +47,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import static com.dd.admin.common.consts.XhsConst.TRUE; @@ -75,6 +74,8 @@ public class AuthApi { FollowService followService; @Autowired ReplyService replyService; + @Autowired + UpReplysService upReplysService; @ApiOperation(value = "获取所有笔记") @ApiOperationSupport(order = 1) @@ -306,9 +307,13 @@ public class AuthApi { @ApiOperationSupport(order = 1) @GetMapping("/api/auth/getNoteReply") @OperLog(operModule = "获取笔记评论",operType = OperType.QUERY,operDesc = "获取笔记评论") - public ResultBean getNoteReply( ReplyDto replyDto) { + public ResultBean getNoteReply( ReplyDto replyDto) { + String fellowId = String.valueOf(request.getAttribute("authorId")); + + String noteId = replyDto.getNoteId(); - List replyList = replyService.selectReplyList(new ReplyDto().setNoteId(noteId)); + List replyList = replyService.selectReplyList(new ReplyDto().setNoteId(noteId).setFollowId(fellowId)); + Integer totalCount = replyList.size(); // 先构建一个以回复ID为键,回复对象为值的Map,方便后续快速查找回复对象 // 构建以replyId为键,ReplyVo对象为值的Map,方便后续快速查找回复对象 Map replyMap = replyList.stream() @@ -344,7 +349,12 @@ public class AuthApi { }); - return ResultBean.success(firstLevelReplies); + Map map = new HashMap(); + map.put("totalCount",totalCount); + map.put("replys",firstLevelReplies); + + + return ResultBean.success(map); } @@ -409,7 +419,7 @@ public class AuthApi { replyDto.setFirstReplay(TRUE); } replyDto.setNoteId(note.getNoteId()); - replyDto.setNoteTitile(note.getNoteTitle()); + replyDto.setNoteTitle(note.getNoteTitle()); replyDto.setAuthorId(authorId); replyDto.setAuthorName(author.getAuthorName()); replyDto.setAvatarUrl(author.getAvatarUrl()); @@ -420,4 +430,33 @@ public class AuthApi { return ResultBean.success(); } + + @ApiOperation(value = "点赞评论") + @ApiOperationSupport(order = 1) + @PostMapping("/api/auth/upReply") + @OperLog(operModule = "点赞评论",operType = OperType.ADD,operDesc = "点赞评论") + public ResultBean upReply(@RequestBody ReplyDto replyDto) { + String followId = String.valueOf(request.getAttribute("authorId")); + Author follow = authorService.getById(followId); + Boolean isUp = Boolean.FALSE; + //查看在不在点赞列表 + UpReplys upReplys = upReplysService.selectOneByFollowId(replyDto.getReplyId(),replyDto.getAuthorId(), followId); + //不在证明是点赞 + if(upReplys==null){ + upReplys = new UpReplys(); + upReplys.setAuthorId(replyDto.getAuthorId()); + upReplys.setAuthorName(replyDto.getAuthorName()); + upReplys.setFollowId(follow.getAuthorId()); + upReplys.setFollowName(follow.getAuthorName()); + upReplys.setReplyId(replyDto.getReplyId()); + upReplys.setReplyContent(replyDto.getReplayContent()); + isUp = Boolean.TRUE; + upReplysService.save(upReplys); + }else{ + //在则表示取消赞删除数据 + upReplysService.removeById(upReplys); + } + return ResultBean.success(isUp); + }; + } diff --git a/src/main/java/com/dd/admin/business/note/domain/NoteVo.java b/src/main/java/com/dd/admin/business/note/domain/NoteVo.java index b8c737e..ac4af85 100644 --- a/src/main/java/com/dd/admin/business/note/domain/NoteVo.java +++ b/src/main/java/com/dd/admin/business/note/domain/NoteVo.java @@ -71,10 +71,6 @@ public class NoteVo { @ApiModelProperty(value = "创建时间") private Date createTime; - @ApiModelProperty(value = "创建时间") - @JsonFormat(pattern="MM-dd", timezone = "GMT+8") - private Date createTimeStr; - @ApiModelProperty(value = "修改时间") private Date updateTime; diff --git a/src/main/java/com/dd/admin/business/note/mapper/xml/NoteMapper.xml b/src/main/java/com/dd/admin/business/note/mapper/xml/NoteMapper.xml index 3b417f0..5c5b496 100644 --- a/src/main/java/com/dd/admin/business/note/mapper/xml/NoteMapper.xml +++ b/src/main/java/com/dd/admin/business/note/mapper/xml/NoteMapper.xml @@ -33,8 +33,7 @@ SELECT a.*, COALESCE(COUNT(b.note_id), 0) AS starCount, - COALESCE(COUNT(c.note_id), 0) AS upCount, - a.CREATE_TIME AS createTimeStr + COALESCE(COUNT(c.note_id), 0) AS upCount ,CASE WHEN EXISTS ( SELECT 1 @@ -98,8 +97,7 @@ SELECT a.*, COALESCE(COUNT(b.note_id), 0) AS starCount, - COALESCE(COUNT(c.note_id), 0) AS upCount, - a.CREATE_TIME AS createTimeStr + COALESCE(COUNT(c.note_id), 0) AS upCount -- 使用 CASE WHEN 语句判断是否存在当前用户(通过传入的 followId)对笔记的收藏记录,有则为 true,否则为 false ,CASE WHEN EXISTS ( diff --git a/src/main/java/com/dd/admin/business/reply/domain/ReplyDto.java b/src/main/java/com/dd/admin/business/reply/domain/ReplyDto.java index 1c61f13..b8ba8b7 100644 --- a/src/main/java/com/dd/admin/business/reply/domain/ReplyDto.java +++ b/src/main/java/com/dd/admin/business/reply/domain/ReplyDto.java @@ -40,7 +40,7 @@ public class ReplyDto { private String noteId; @ApiModelProperty(value = "笔记标题") - private String noteTitile; + private String noteTitle; @ApiModelProperty(value = "作者id") private String authorId; @@ -99,5 +99,8 @@ public class ReplyDto { @ApiModelProperty(value = "头像地址") private String avatarUrl; + @ApiModelProperty(value = "作者ID") + //传入此参数 如果你点赞了会显示相应状态 + private String followId; } diff --git a/src/main/java/com/dd/admin/business/reply/domain/ReplyVo.java b/src/main/java/com/dd/admin/business/reply/domain/ReplyVo.java index 7241845..c944657 100644 --- a/src/main/java/com/dd/admin/business/reply/domain/ReplyVo.java +++ b/src/main/java/com/dd/admin/business/reply/domain/ReplyVo.java @@ -39,7 +39,7 @@ public class ReplyVo { private String noteId; @ApiModelProperty(value = "笔记标题") - private String noteTitile; + private String noteTitle; @ApiModelProperty(value = "作者id") private String authorId; @@ -74,10 +74,6 @@ public class ReplyVo { @ApiModelProperty(value = "创建时间") private Date createTime; - @ApiModelProperty(value = "创建时间") - @JsonFormat(pattern="MM-dd", timezone = "GMT+8") - private Date createTimeStr; - @ApiModelProperty(value = "ip地址") private String ipAddress; @@ -103,4 +99,9 @@ public class ReplyVo { private String avatarUrl; private List Reply = new ArrayList<>(); + + @ApiModelProperty(value = "被当前达人点赞") + private Boolean isUp = Boolean.FALSE; + + } diff --git a/src/main/java/com/dd/admin/business/reply/entity/Reply.java b/src/main/java/com/dd/admin/business/reply/entity/Reply.java index 98deb96..955e91d 100644 --- a/src/main/java/com/dd/admin/business/reply/entity/Reply.java +++ b/src/main/java/com/dd/admin/business/reply/entity/Reply.java @@ -40,7 +40,7 @@ public class Reply implements Serializable { @ApiModelProperty(value = "笔记标题") @TableField("NOTE_TITILE") - private String noteTitile; + private String noteTitle; @ApiModelProperty(value = "作者id") @TableField("AUTHOR_ID") diff --git a/src/main/java/com/dd/admin/business/reply/mapper/xml/ReplyMapper.xml b/src/main/java/com/dd/admin/business/reply/mapper/xml/ReplyMapper.xml index df595ab..bf94348 100644 --- a/src/main/java/com/dd/admin/business/reply/mapper/xml/ReplyMapper.xml +++ b/src/main/java/com/dd/admin/business/reply/mapper/xml/ReplyMapper.xml @@ -6,7 +6,7 @@ - + @@ -37,12 +37,32 @@ + + + diff --git a/src/main/java/com/dd/admin/business/upReplys/controller/UpReplysController.java b/src/main/java/com/dd/admin/business/upReplys/controller/UpReplysController.java new file mode 100644 index 0000000..5d725fa --- /dev/null +++ b/src/main/java/com/dd/admin/business/upReplys/controller/UpReplysController.java @@ -0,0 +1,88 @@ +package com.dd.admin.business.upReplys.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.dd.admin.common.model.UpdateGroup; +import com.dd.admin.common.model.result.ResultBean; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import javax.validation.constraints.NotBlank; +import com.dd.admin.business.upReplys.entity.UpReplys; +import com.dd.admin.business.upReplys.domain.UpReplysVo; +import com.dd.admin.business.upReplys.domain.UpReplysDto; +import com.dd.admin.business.upReplys.service.UpReplysService; + +import java.util.List; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 笔记点赞表 前端控制器 + *

+ * + * @author 727869402@qq.com + * @since 2024-12-25 + */ +@Api(tags = "笔记点赞表") +@RestController +public class UpReplysController { + + @Autowired + UpReplysService upReplysService; + + @ApiOperation(value = "笔记点赞表-分页列表") + @ApiOperationSupport(order = 1) + @GetMapping("/admin/upReplys/page") + public ResultBean> page(UpReplysDto upReplysDto) { + IPage pageInfo = upReplysService.selectUpReplysPage(upReplysDto); + return ResultBean.success(pageInfo); + } + + @ApiOperation(value = "笔记点赞表-列表") + @ApiOperationSupport(order = 2) + @GetMapping("/admin/upReplys/list") + public ResultBean> list(UpReplysDto upReplysDto) { + List list = upReplysService.selectUpReplysList(upReplysDto); + return ResultBean.success(list); + } + + @ApiOperation(value = "笔记点赞表-添加") + @ApiOperationSupport(order = 3) + @PostMapping("/admin/upReplys/add") + public ResultBean add(@RequestBody @Validated UpReplysDto upReplysDto) { + UpReplys upReplys = BeanUtil.copyProperties(upReplysDto, UpReplys.class); + upReplysService.save(upReplys); + return ResultBean.success(upReplys); + } + + @ApiOperation(value = "笔记点赞表-查询") + @ApiOperationSupport(order = 4) + @GetMapping("/admin/upReplys/{upReplysId}") + public ResultBean get(@PathVariable @NotBlank String upReplysId) { + UpReplys upReplys = upReplysService.getById(upReplysId); + UpReplysVo upReplysVo = BeanUtil.copyProperties(upReplys,UpReplysVo.class); + return ResultBean.success(upReplysVo); + } + + @ApiOperation(value = "笔记点赞表-修改") + @ApiOperationSupport(order = 5) + @PostMapping("/admin/upReplys/update") + public ResultBean update(@RequestBody @Validated(UpdateGroup.class) UpReplysDto upReplysDto) { + UpReplys upReplys = BeanUtil.copyProperties(upReplysDto, UpReplys.class); + upReplysService.updateById(upReplys); + return ResultBean.success(upReplys); + } + + @ApiOperation(value = "笔记点赞表-删除") + @ApiOperationSupport(order = 6) + @GetMapping("/admin/upReplys/delete/{upReplysId}") + public ResultBean delete(@PathVariable @NotBlank String upReplysId) { + Boolean b = upReplysService.removeById(upReplysId); + return ResultBean.success(b); + } +} diff --git a/src/main/java/com/dd/admin/business/upReplys/domain/UpReplysDto.java b/src/main/java/com/dd/admin/business/upReplys/domain/UpReplysDto.java new file mode 100644 index 0000000..bcae9a6 --- /dev/null +++ b/src/main/java/com/dd/admin/business/upReplys/domain/UpReplysDto.java @@ -0,0 +1,55 @@ +package com.dd.admin.business.upReplys.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.Version; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import javax.validation.constraints.NotBlank; +import com.dd.admin.common.model.UpdateGroup; + + +/** + *

+ * 笔记点赞表返回对象 + *

+ * + * @author 727869402@qq.com + * @since 2024-12-25 + */ +@Data +@ApiModel(value="笔记点赞表接收对象") +public class UpReplysDto { + + + @NotBlank(message = "笔记点赞表id不能为空",groups = UpdateGroup.class) + private String replyUpId; + + private String replyId; + + private String replyContent; + + @ApiModelProperty(value = "被关注id") + private String authorId; + + @ApiModelProperty(value = "被关注名字") + private String authorName; + + @ApiModelProperty(value = "关注者") + private String followId; + + @ApiModelProperty(value = "关注者名字") + private String followName; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + +} diff --git a/src/main/java/com/dd/admin/business/upReplys/domain/UpReplysVo.java b/src/main/java/com/dd/admin/business/upReplys/domain/UpReplysVo.java new file mode 100644 index 0000000..c0d1989 --- /dev/null +++ b/src/main/java/com/dd/admin/business/upReplys/domain/UpReplysVo.java @@ -0,0 +1,51 @@ +package com.dd.admin.business.upReplys.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.Version; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 笔记点赞表返回对象 + *

+ * + * @author 727869402@qq.com + * @since 2024-12-25 + */ +@Data +@ApiModel(value="笔记点赞表返回对象") +public class UpReplysVo { + + + private String replyUpId; + + private String replyId; + + private String replyContent; + + @ApiModelProperty(value = "被关注id") + private String authorId; + + @ApiModelProperty(value = "被关注名字") + private String authorName; + + @ApiModelProperty(value = "关注者") + private String followId; + + @ApiModelProperty(value = "关注者名字") + private String followName; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + +} diff --git a/src/main/java/com/dd/admin/business/upReplys/entity/UpReplys.java b/src/main/java/com/dd/admin/business/upReplys/entity/UpReplys.java new file mode 100644 index 0000000..1f2d7cb --- /dev/null +++ b/src/main/java/com/dd/admin/business/upReplys/entity/UpReplys.java @@ -0,0 +1,62 @@ +package com.dd.admin.business.upReplys.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.Version; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 笔记点赞表 + *

+ * + * @author 727869402@qq.com + * @since 2024-12-25 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("business_up_replys") +@ApiModel(value="UpReplys对象", description="笔记点赞表") +public class UpReplys implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "REPLY_UP_ID", type = IdType.ASSIGN_UUID) + private String replyUpId; + + @TableField("REPLY_ID") + private String replyId; + + @TableField("REPLY_CONTENT") + private String replyContent; + + @ApiModelProperty(value = "被关注id") + @TableField("AUTHOR_ID") + private String authorId; + + @ApiModelProperty(value = "被关注名字") + @TableField("AUTHOR_NAME") + private String authorName; + + @ApiModelProperty(value = "关注者") + @TableField("FOLLOW_ID") + private String followId; + + @ApiModelProperty(value = "关注者名字") + @TableField("FOLLOW_NAME") + private String followName; + + @ApiModelProperty(value = "创建时间") + @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT) + private Date createTime; + + +} diff --git a/src/main/java/com/dd/admin/business/upReplys/mapper/UpReplysMapper.java b/src/main/java/com/dd/admin/business/upReplys/mapper/UpReplysMapper.java new file mode 100644 index 0000000..5d0a8ff --- /dev/null +++ b/src/main/java/com/dd/admin/business/upReplys/mapper/UpReplysMapper.java @@ -0,0 +1,28 @@ +package com.dd.admin.business.upReplys.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dd.admin.business.upReplys.entity.UpReplys; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dd.admin.business.upReplys.domain.UpReplysVo; +import com.dd.admin.business.upReplys.domain.UpReplysDto; + +import java.util.List; + +/** + *

+ * 笔记点赞表 Mapper 接口 + *

+ * + * @author 727869402@qq.com + * @since 2024-12-25 + */ +@Mapper +public interface UpReplysMapper extends BaseMapper { + + IPage selectUpReplysPage(Page page, @Param("upReplysDto") UpReplysDto upReplysDto); + + List selectUpReplysList(@Param("upReplysDto") UpReplysDto upReplysDto); +} diff --git a/src/main/java/com/dd/admin/business/upReplys/mapper/xml/UpReplysMapper.xml b/src/main/java/com/dd/admin/business/upReplys/mapper/xml/UpReplysMapper.xml new file mode 100644 index 0000000..19faa8b --- /dev/null +++ b/src/main/java/com/dd/admin/business/upReplys/mapper/xml/UpReplysMapper.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + REPLY_UP_ID, REPLY_ID, REPLY_CONTENT, AUTHOR_ID, AUTHOR_NAME, FOLLOW_ID, FOLLOW_NAME, CREATE_TIME + + + + + + diff --git a/src/main/java/com/dd/admin/business/upReplys/service/UpReplysService.java b/src/main/java/com/dd/admin/business/upReplys/service/UpReplysService.java new file mode 100644 index 0000000..b754462 --- /dev/null +++ b/src/main/java/com/dd/admin/business/upReplys/service/UpReplysService.java @@ -0,0 +1,28 @@ +package com.dd.admin.business.upReplys.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dd.admin.business.upReplys.entity.UpReplys; +import com.baomidou.mybatisplus.extension.service.IService; +import com.dd.admin.business.upReplys.domain.UpReplysVo; +import com.dd.admin.business.upReplys.domain.UpReplysDto; +import java.util.List; + +/** + *

+ * 笔记点赞表 服务类 + *

+ * + * @author 727869402@qq.com + * @since 2024-12-25 + */ +public interface UpReplysService extends IService { + + //笔记点赞表-分页列表 + IPage selectUpReplysPage(UpReplysDto upReplysDto); + + //笔记点赞表-列表 + List selectUpReplysList(UpReplysDto upReplysDto); + + UpReplys selectOneByFollowId(String replyId,String authorId,String followId); + +} diff --git a/src/main/java/com/dd/admin/business/upReplys/service/impl/UpReplysServiceImpl.java b/src/main/java/com/dd/admin/business/upReplys/service/impl/UpReplysServiceImpl.java new file mode 100644 index 0000000..7394e70 --- /dev/null +++ b/src/main/java/com/dd/admin/business/upReplys/service/impl/UpReplysServiceImpl.java @@ -0,0 +1,47 @@ +package com.dd.admin.business.upReplys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dd.admin.business.upNotes.entity.UpNotes; +import com.dd.admin.common.model.PageFactory; +import com.dd.admin.business.upReplys.entity.UpReplys; +import com.dd.admin.business.upReplys.mapper.UpReplysMapper; +import com.dd.admin.business.upReplys.service.UpReplysService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.dd.admin.business.upReplys.domain.UpReplysVo; +import com.dd.admin.business.upReplys.domain.UpReplysDto; +import java.util.List; + +/** + *

+ * 笔记点赞表 服务实现类 + *

+ * + * @author 727869402@qq.com + * @since 2024-12-25 + */ +@Service +public class UpReplysServiceImpl extends ServiceImpl implements UpReplysService { + + @Override + public IPage selectUpReplysPage(UpReplysDto upReplysDto) { + Page page = PageFactory.defaultPage(); + return baseMapper.selectUpReplysPage(page,upReplysDto); + } + + @Override + public List selectUpReplysList(UpReplysDto upReplysDto) { + return baseMapper.selectUpReplysList(upReplysDto); + } + + @Override + public UpReplys selectOneByFollowId(String replyId, String authorId, String followId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(UpReplys::getReplyId,replyId); + queryWrapper.eq(UpReplys::getAuthorId,authorId); + queryWrapper.eq(UpReplys::getFollowId,followId); + return this.getOne(queryWrapper); + } +}