From cf7532a1f5687b2c4382dd40dfd8dadd54a2a6f1 Mon Sep 17 00:00:00 2001 From: Yang Haoyu <2241399212@qq.com> Date: Wed, 1 Nov 2023 14:14:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/response/ResponseComment.java | 8 +++- .../publice/controller/CommentController.java | 41 ++++++++++++++++++- .../doctor/publice/mapper/CommentMapper.java | 3 ++ .../publice/service/CommentServlce.java | 4 ++ .../service/impl/CommentServlceimpl.java | 11 +++++ .../main/resources/mapper/CommentMapper.xml | 11 ++++- 6 files changed, 73 insertions(+), 5 deletions(-) diff --git a/grail-doctor-public-common/src/main/java/com/grail/publice/domain/response/ResponseComment.java b/grail-doctor-public-common/src/main/java/com/grail/publice/domain/response/ResponseComment.java index a48d386..239a6fd 100644 --- a/grail-doctor-public-common/src/main/java/com/grail/publice/domain/response/ResponseComment.java +++ b/grail-doctor-public-common/src/main/java/com/grail/publice/domain/response/ResponseComment.java @@ -29,11 +29,11 @@ public class ResponseComment { */ private Date commentTime; /** - * 发布评论患者Id + * 患者Id */ private Integer userId; /** - * 送礼用户名 + * 用户名 */ private String userName; /** @@ -52,4 +52,8 @@ public class ResponseComment { * 礼物名称 */ private String giftName; + /** + * 礼物图片 + */ + private String giftPicture; } diff --git a/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/controller/CommentController.java b/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/controller/CommentController.java index fbf4e89..65ab1a2 100644 --- a/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/controller/CommentController.java +++ b/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/controller/CommentController.java @@ -62,10 +62,10 @@ public class CommentController { */ @GetMapping("/giftList") public Result> giftList(){ - log.info("功能名称:查询礼物记录,根据用户选择查科室及详细功能进行排序,请求URL:【{}】,请求方法:【{}】",request.getRequestURI(), + log.info("功能名称:查询礼物详情,根据用户选择查科室及详细功能进行排序,请求URL:【{}】,请求方法:【{}】",request.getRequestURI(), request.getMethod()); Result> result = commentServlce.giftList(); - log.info("功能名称:查询礼物记录,根据用户选择查科室及详细功能进行排序,请求URL:【{}】,请求方法:【{}】",request.getRequestURI(), + log.info("功能名称:查询礼物详情,根据用户选择查科室及详细功能进行排序,请求URL:【{}】,请求方法:【{}】",request.getRequestURI(), request.getMethod()); return result; } @@ -144,5 +144,42 @@ public class CommentController { } + /** + * @Description:根据id查询评论详情 + No such property: code for class: Script1 + * @return: com.grail.common.core.domain.Result + * @Author: YHY + * @Updator: YHY + * @Date 2023/11/1 9:20 + */ + @GetMapping("/findCommentById/{commentId}") + public Result findCommentById(@PathVariable Integer commentId){ + log.info("功能名称:根据id查询评论详情,请求URL:【{}】,请求方法:【{}】,请求参数:【{}】",request.getRequestURI(), + request.getMethod()); + ResponseComment comment = commentServlce.findCommentById(commentId); + Result result = Result.success(comment); + log.info("功能名称:根据id查询评论详情,请求URL:【{}】,请求方法:【{}】,响应结果:【{}】",request.getRequestURI(), + request.getMethod(),JSONObject.toJSONString(result)); + return result; + } + + + /** + * @Description:医生查看礼物信息 + No such property: code for class: Script1 + * @return: com.grail.common.core.domain.Result> + * @Author: YHY + * @Updator: YHY + * @Date 2023/11/1 13:56 + */ + @GetMapping("/findDoctorGift") + public Result> findDoctorGift(){ + log.info("功能名称:医生查看礼物信息,请求URL:【{}】,请求方法:【{}】",request.getRequestURI(), + request.getMethod()); + Result> result = commentServlce.findDoctorGift(); + log.info("功能名称:医生查看礼物信息,请求URL:【{}】,请求方法:【{}】,请求参数:【{}】",request.getRequestURI(), + request.getMethod(),JSONObject.toJSONString(result)); + return result; + } } diff --git a/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/mapper/CommentMapper.java b/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/mapper/CommentMapper.java index b4f6631..96172be 100644 --- a/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/mapper/CommentMapper.java +++ b/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/mapper/CommentMapper.java @@ -30,4 +30,7 @@ public interface CommentMapper { int deleteGiftById(@Param("giftId") Integer giftId); + ResponseComment findCommentById(@Param("commentId") Integer commentId); + + List findDoctorGift(); } diff --git a/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/service/CommentServlce.java b/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/service/CommentServlce.java index 50670fe..8920b74 100644 --- a/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/service/CommentServlce.java +++ b/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/service/CommentServlce.java @@ -29,4 +29,8 @@ public interface CommentServlce { Result addGift(Gift gift); Result deleteGiftById(Integer giftId); + + ResponseComment findCommentById(Integer commentId); + + Result> findDoctorGift(); } diff --git a/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/service/impl/CommentServlceimpl.java b/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/service/impl/CommentServlceimpl.java index 90ac725..1992532 100644 --- a/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/service/impl/CommentServlceimpl.java +++ b/grail-doctor-public-server/src/main/java/com/grail/doctor/publice/service/impl/CommentServlceimpl.java @@ -100,5 +100,16 @@ public class CommentServlceimpl implements CommentServlce { return i>0?Result.success(200,"礼物已下架"):Result.success(500,"礼物下架失败"); } + @Override + public ResponseComment findCommentById(Integer commentId) { + return commentMapper.findCommentById(commentId); + } + + @Override + public Result> findDoctorGift() { + List list = commentMapper.findDoctorGift(); + return Result.success(list); + } + } diff --git a/grail-doctor-public-server/src/main/resources/mapper/CommentMapper.xml b/grail-doctor-public-server/src/main/resources/mapper/CommentMapper.xml index 07bb5dd..76be0e9 100644 --- a/grail-doctor-public-server/src/main/resources/mapper/CommentMapper.xml +++ b/grail-doctor-public-server/src/main/resources/mapper/CommentMapper.xml @@ -40,12 +40,21 @@ + +