功能更新

master
Yang Haoyu 2023-11-01 14:14:54 +08:00
parent 51993a6e59
commit cf7532a1f5
6 changed files with 73 additions and 5 deletions

View File

@ -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;
}

View File

@ -62,10 +62,10 @@ public class CommentController {
*/
@GetMapping("/giftList")
public Result<List<Gift>> giftList(){
log.info("功能名称:查询礼物记录根据用户选择查科室及详细功能进行排序请求URL【{}】,请求方法:【{}】",request.getRequestURI(),
log.info("功能名称:查询礼物详情根据用户选择查科室及详细功能进行排序请求URL【{}】,请求方法:【{}】",request.getRequestURI(),
request.getMethod());
Result<List<Gift>> 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<java.util.List<com.grail.publice.domain.response.ResponseComment>>
* @Author: YHY
* @Updator: YHY
* @Date 2023/11/1 13:56
*/
@GetMapping("/findDoctorGift")
public Result<List<ResponseComment>> findDoctorGift(){
log.info("功能名称医生查看礼物信息请求URL【{}】,请求方法:【{}】",request.getRequestURI(),
request.getMethod());
Result<List<ResponseComment>> result = commentServlce.findDoctorGift();
log.info("功能名称医生查看礼物信息请求URL【{}】,请求方法:【{}】,请求参数:【{}】",request.getRequestURI(),
request.getMethod(),JSONObject.toJSONString(result));
return result;
}
}

View File

@ -30,4 +30,7 @@ public interface CommentMapper {
int deleteGiftById(@Param("giftId") Integer giftId);
ResponseComment findCommentById(@Param("commentId") Integer commentId);
List<ResponseComment> findDoctorGift();
}

View File

@ -29,4 +29,8 @@ public interface CommentServlce {
Result addGift(Gift gift);
Result deleteGiftById(Integer giftId);
ResponseComment findCommentById(Integer commentId);
Result<List<ResponseComment>> findDoctorGift();
}

View File

@ -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<List<ResponseComment>> findDoctorGift() {
List<ResponseComment> list = commentMapper.findDoctorGift();
return Result.success(list);
}
}

View File

@ -40,12 +40,21 @@
<select id="commentList" resultType="com.grail.publice.domain.response.ResponseComment">
select t_comment.*,gift_name,user_name from t_comment left join
select t_comment.*,user_name,gift_name,gift_picture from t_comment left join
t_gift on t_comment.gift_id=t_gift.gift_id left join t_user
on t_comment.user_id=t_user.user_id
</select>
<select id="giftList" resultType="com.grail.publice.domain.Gift">
select * from t_gift
</select>
<select id="findCommentById" resultType="com.grail.publice.domain.response.ResponseComment">
select t_comment.*,user_name,gift_picture from t_comment left join
t_gift on t_comment.gift_id=t_gift.gift_id left join t_user
on t_comment.user_id=t_user.user_id where comment_id=#{commentId}
</select>
<select id="findDoctorGift" resultType="com.grail.publice.domain.response.ResponseComment">
select comment_time,user_name,gift_name,gift_picture from t_comment left join t_gift on
t_comment.gift_id=t_gift.gift_id left join t_user on t_comment.user_id=t_user.user_id
</select>
</mapper>