From 4f50605455254108bfa0764f1a457807b89f2b67 Mon Sep 17 00:00:00 2001 From: wangtongzhou Date: Sat, 1 Jun 2019 17:51:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=84=E8=AE=BA=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E6=8E=A5=E5=8F=A3=E5=92=8C=E8=AF=84=E8=AE=BA=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3=E5=AE=9E=E7=8E=B0=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=AE=9E=E4=BD=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/application/OrderApplication.java | 27 +++++++++ .../users/OrderCommentController.java | 17 ++++-- .../users/OrderCommentReplyController.java | 42 ++++++++++++++ .../src/main/resources/application.yaml | 6 +- .../mall/order/api/bo/OrderCommentPageBO.java | 6 +- .../api/bo/OrderCommentReplyCreateBO.java | 15 ++++- .../constant/OrderCommentRelpyTypeEnum.java | 35 +++++++++++ .../api/constant/OrderReplyUserTypeEnum.java | 4 +- .../biz/convert/OrderCommentConvert.java | 5 +- .../biz/convert/OrderCommentReplyConvert.java | 27 +++++++++ .../order/biz/dao/OrderCommentMapper.java | 8 ++- .../biz/dataobject/OrderCommentReplyDO.java | 2 +- .../service/OrderCommentReplyServiceImpl.java | 58 +++++++++++++++++++ .../biz/service/OrderCommentServiceImpl.java | 26 ++++++++- .../resources/mapper/OrderCommentMapper.xml | 6 +- .../mapper/OrderCommentReplayMapper.xml | 25 +++++++- 16 files changed, 283 insertions(+), 26 deletions(-) create mode 100644 order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentReplyController.java create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentRelpyTypeEnum.java create mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java create mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyServiceImpl.java diff --git a/order/order-application/src/main/java/cn/iocoder/mall/order/application/OrderApplication.java b/order/order-application/src/main/java/cn/iocoder/mall/order/application/OrderApplication.java index 4cb758966..6928ec3ff 100644 --- a/order/order-application/src/main/java/cn/iocoder/mall/order/application/OrderApplication.java +++ b/order/order-application/src/main/java/cn/iocoder/mall/order/application/OrderApplication.java @@ -1,7 +1,12 @@ package cn.iocoder.mall.order.application; +import org.apache.catalina.connector.Connector; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; +import org.springframework.context.annotation.Bean; @SpringBootApplication(scanBasePackages = {"cn.iocoder.mall.order"}) public class OrderApplication { @@ -10,4 +15,26 @@ public class OrderApplication { SpringApplication.run(OrderApplication.class, args); } + + + /** + * 解决异常信息: + * java.lang.IllegalArgumentException: + * Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 + * @return + */ + @Bean + public ConfigurableServletWebServerFactory webServerFactory() { + TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(); + factory.addConnectorCustomizers(new TomcatConnectorCustomizer() { + @Override + public void customize(Connector connector) { + connector.setProperty("relaxedQueryChars", "|{}[]"); + } + }); + return factory; + } + + + } \ No newline at end of file diff --git a/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentController.java b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentController.java index 1e1915b4a..9687484cf 100644 --- a/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentController.java +++ b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentController.java @@ -4,17 +4,14 @@ import cn.iocoder.common.framework.constant.MallConstants; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.order.api.OrderCommentService; import cn.iocoder.mall.order.api.bo.OrderCommentCreateBO; +import cn.iocoder.mall.order.api.bo.OrderCommentPageBO; import cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO; -import cn.iocoder.mall.user.sdk.annotation.RequiresLogin; +import cn.iocoder.mall.order.api.dto.OrderCommentPageDTO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.dubbo.config.annotation.Reference; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - +import org.springframework.web.bind.annotation.*; import static cn.iocoder.common.framework.vo.CommonResult.success; @@ -41,4 +38,12 @@ public class OrderCommentController { public CommonResult createOrder(@RequestBody @Validated OrderCommentCreateDTO orderCommentCreateDTO) { return success(orderCommentService.createOrderComment(orderCommentCreateDTO)); } + + @GetMapping("getOrderCommentPage") + //@RequiresLogin + @ApiOperation(value = "获取评论分页") + public CommonResult getOrderCommentPage(@Validated OrderCommentPageDTO orderCommentPageDTO){ + return success(orderCommentService.getOrderCommentPage(orderCommentPageDTO)); + } + } diff --git a/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentReplyController.java b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentReplyController.java new file mode 100644 index 000000000..0aefbce1a --- /dev/null +++ b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentReplyController.java @@ -0,0 +1,42 @@ +package cn.iocoder.mall.order.application.controller.users; + +import cn.iocoder.common.framework.constant.MallConstants; +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.order.api.OrderCommentReplyService; +import cn.iocoder.mall.order.api.bo.OrderCommentCreateBO; +import cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO; +import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.dubbo.config.annotation.Reference; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static cn.iocoder.common.framework.vo.CommonResult.success; + + +/** + * + * 评论回复模块 Api(user) + * + * @author wtz + * @time 2019-05-31 18:00 + */ +@RestController +@RequestMapping(MallConstants.ROOT_PATH_USER + "/order_comment_reply") +@Api("用户评论回复模块 ") +public class OrderCommentReplyController { + + @Reference(validation = "true", version = "${dubbo.provider.OrderCommentService.version}") + private OrderCommentReplyService orderCommentReplyService; + + @PostMapping("create_order_comment") + //@RequiresLogin + @ApiOperation(value = "创建订单") + public CommonResult createOrderCommentReply(@RequestBody @Validated OrderCommentReplyCreateDTO orderCommentReplyCreateDTO){ + return success(orderCommentReplyService.createOrderCommentReply(orderCommentReplyCreateDTO)); + } +} diff --git a/order/order-application/src/main/resources/application.yaml b/order/order-application/src/main/resources/application.yaml index f8614c729..24054aa83 100644 --- a/order/order-application/src/main/resources/application.yaml +++ b/order/order-application/src/main/resources/application.yaml @@ -17,7 +17,11 @@ server: context-path: /order-api/ swagger: - enable: false + enable: true # 暂时不去掉 + title: 订单子系统 + description: 订单子系统 + version: 1.0.0 + base-package: cn.iocoder.mall.order.application.controller management: endpoints: diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java index e5221ca13..245fa38b0 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java @@ -1,5 +1,6 @@ package cn.iocoder.mall.order.api.bo; +import lombok.AllArgsConstructor; import lombok.Data; import lombok.experimental.Accessors; @@ -48,6 +49,7 @@ public class OrderCommentPageBO implements Serializable { @Data @Accessors(chain = true) + @AllArgsConstructor public static class OrderCommentItem{ /** * 评论 id @@ -87,7 +89,7 @@ public class OrderCommentPageBO implements Serializable { /** * 点赞数 */ - private Integer collectCount; + private Integer likeCount; /** * 创建时间 @@ -98,7 +100,7 @@ public class OrderCommentPageBO implements Serializable { * 商家回复列表 * 只展示最近的一条 */ - private String MerchantRaplayContent; + private String replyContent; } diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java index 5fcd00ce3..453aeb04c 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java @@ -1,5 +1,10 @@ package cn.iocoder.mall.order.api.bo; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + /** * * 订单回复创建 @@ -7,5 +12,13 @@ package cn.iocoder.mall.order.api.bo; * @author wtz * @time 2019-05-19 18:35 */ -public class OrderCommentReplyCreateBO { +@Data +@Accessors(chain = true) +public class OrderCommentReplyCreateBO implements Serializable { + + + /** + * 评论回复 id + */ + private Integer id; } diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentRelpyTypeEnum.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentRelpyTypeEnum.java new file mode 100644 index 000000000..c42f05bce --- /dev/null +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderCommentRelpyTypeEnum.java @@ -0,0 +1,35 @@ +package cn.iocoder.mall.order.api.constant; + +/** + * + * 评论回复类型 + * + * @author wtz + * @time 2019-06-01 10:30:00 + */ +public enum OrderCommentRelpyTypeEnum { + + REPLY_REPLY(0, "回复的回复"), + COMMENT_REPLY(1, "评论的回复"); + /** + * 状态值 + */ + private Integer value; + /** + * 状态名 + */ + private String name; + + OrderCommentRelpyTypeEnum(Integer value, String name) { + this.value = value; + this.name = name; + } + + public Integer getValue() { + return value; + } + + public String getName() { + return name; + } +} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java index 5d6865486..f22acdec1 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java @@ -9,8 +9,8 @@ package cn.iocoder.mall.order.api.constant; */ public enum OrderReplyUserTypeEnum { - USER(1, "普通用户"), - MERCHANT(2, "商家"); + USER(0, "普通用户"), + MERCHANT(1, "商家"); /** * 状态值 */ diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentConvert.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentConvert.java index 8ff2bac61..964cabbdd 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentConvert.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentConvert.java @@ -12,6 +12,9 @@ import java.util.List; /** * 订单评论 convert + * + * @author wtz + * @time 2019-05-30 18:30 */ @Mapper public interface OrderCommentConvert { @@ -24,6 +27,4 @@ public interface OrderCommentConvert { @Mappings({}) OrderCommentCreateBO convert(OrderCommentDO orderCommentDO); - @Mappings({}) - List convert(List orderCommentDOList); } diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java new file mode 100644 index 000000000..4149da6da --- /dev/null +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java @@ -0,0 +1,27 @@ +package cn.iocoder.mall.order.biz.convert; + +import cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO; +import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO; +import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO; +import org.mapstruct.Mapper; +import org.mapstruct.Mappings; +import org.mapstruct.factory.Mappers; + +/** + * + * 评论回复 convert + * + * @author wtz + * @time 2019-05-31 18:30 + */ +@Mapper +public interface OrderCommentReplyConvert { + + OrderCommentReplyConvert INSTANCE = Mappers.getMapper(OrderCommentReplyConvert.class); + + @Mappings({}) + OrderCommentReplyDO convert(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO); + + @Mappings({}) + OrderCommentReplyCreateBO convert(OrderCommentReplyDO orderCommentReplyDO); +} diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java index 0fabdb377..7c030b20f 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java @@ -39,10 +39,14 @@ public interface OrderCommentMapper{ /** * 根据 sku id 分页查询评论 - * @param orderCommentPageDTO + * @param productSkuId + * @param offset + * @param limit * @return */ - List selectCommentPage(OrderCommentPageDTO orderCommentPageDTO); + List selectCommentPage(@Param("productSkuId") Integer productSkuId, + @Param("offset") Integer offset, + @Param("limit") Integer limit); /** diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java index a581efaef..ac39e63bc 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java @@ -55,7 +55,7 @@ public class OrderCommentReplyDO extends BaseDO { private String parentUserAvatar; /** - * 回复的数量 + * 回复的内容 */ private String replyContent; diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyServiceImpl.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyServiceImpl.java new file mode 100644 index 000000000..21c689b56 --- /dev/null +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyServiceImpl.java @@ -0,0 +1,58 @@ +package cn.iocoder.mall.order.biz.service; + +import cn.iocoder.mall.order.api.OrderCommentReplyService; +import cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO; +import cn.iocoder.mall.order.api.bo.OrderCommentReplyPageBO; +import cn.iocoder.mall.order.api.constant.OrderCommentRelpyTypeEnum; +import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO; +import cn.iocoder.mall.order.api.dto.OrderCommentReplyPageDTO; +import cn.iocoder.mall.order.biz.convert.OrderCommentReplyConvert; +import cn.iocoder.mall.order.biz.dao.OrderCommentReplayMapper; +import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * + * 订单评论回复 service impl + * + * @author wtz + * @time 2019-05-31 18:30 + */ +@Service +@org.apache.dubbo.config.annotation.Service(validation = "true",version = "${dubbo.provider.OrderCommentReplyService.version}") +public class OrderCommentReplyServiceImpl implements OrderCommentReplyService { + + @Autowired + private OrderCommentReplayMapper orderCommentReplayMapper; + + @Override + public List getOrderCommentReplyPage(OrderCommentReplyPageDTO orderCommentReplyPageDTO) { + return null; + } + + + /** + * 创建评论回复 + * @param orderCommentReplyCreateDTO + * @return + */ + @Override + public OrderCommentReplyCreateBO createOrderCommentReply(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO) { + OrderCommentReplyDO orderCommentReplyDO=OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyCreateDTO); + orderCommentReplyDO.setCreateTime(new Date()); + orderCommentReplyDO.setUpdateTime(new Date()); + + Integer replyType=orderCommentReplyCreateDTO.getCommentId()==orderCommentReplyCreateDTO.getParentId()? + OrderCommentRelpyTypeEnum.COMMENT_REPLY.getValue():OrderCommentRelpyTypeEnum.REPLY_REPLY.getValue(); + + orderCommentReplyDO.setReplyType(replyType); + + orderCommentReplayMapper.insert(orderCommentReplyDO); + + return OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyDO); + } +} diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentServiceImpl.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentServiceImpl.java index a7320f38e..670007fd5 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentServiceImpl.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentServiceImpl.java @@ -4,17 +4,21 @@ import cn.iocoder.mall.order.api.OrderCommentService; import cn.iocoder.mall.order.api.bo.OrderCommentCreateBO; import cn.iocoder.mall.order.api.bo.OrderCommentInfoAndMerchantReplyBO; import cn.iocoder.mall.order.api.bo.OrderCommentPageBO; +import cn.iocoder.mall.order.api.constant.OrderReplyUserTypeEnum; import cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO; import cn.iocoder.mall.order.api.dto.OrderCommentPageDTO; import cn.iocoder.mall.order.biz.convert.OrderCommentConvert; import cn.iocoder.mall.order.biz.dao.OrderCommentMapper; import cn.iocoder.mall.order.biz.dao.OrderCommentReplayMapper; import cn.iocoder.mall.order.biz.dataobject.OrderCommentDO; +import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; /** * @@ -30,6 +34,9 @@ public class OrderCommentServiceImpl implements OrderCommentService { @Autowired private OrderCommentMapper orderCommentMapper; + @Autowired + private OrderCommentReplayMapper orderCommentReplayMapper; + @Autowired private OrderCommentService orderCommentService; @@ -50,11 +57,24 @@ public class OrderCommentServiceImpl implements OrderCommentService { public OrderCommentPageBO getOrderCommentPage(OrderCommentPageDTO orderCommentPageDTO) { OrderCommentPageBO orderCommentPageBO=new OrderCommentPageBO(); //分页内容 - List orderCommentDOList=orderCommentMapper.selectCommentPage(orderCommentPageDTO); - //查询商家的回复 + int offset = (orderCommentPageDTO.getPageNo() - 1) * orderCommentPageDTO.getPageSize(); + List orderCommentDOList=orderCommentMapper.selectCommentPage(orderCommentPageDTO.getProductSkuId(), + offset,orderCommentPageDTO.getPageSize()); + //分页评论的 id + List commentIds=orderCommentDOList.stream().map(x->x.getId()).collect(Collectors.toList()); + //获取商家最新的评论回复 + List orderCommentReplyDOList=orderCommentReplayMapper.selectCommentNewMerchantReplyByCommentIds(commentIds, + OrderReplyUserTypeEnum.MERCHANT.getValue()); + //评论组装 + List orderCommentItemList=orderCommentDOList.stream() + .flatMap(x->orderCommentReplyDOList.stream() + .filter(y->x.getId()==y.getCommentId()) + .map(y->new OrderCommentPageBO.OrderCommentItem(x.getId(),x.getUserAvatar(),x.getUserNickName(),x.getStar(), + x.getCommentContent(),x.getCommentPics(),x.getReplayCount(),x.getLikeCount(),x.getCreateTime(),y.getReplyContent())) + ).collect(Collectors.toList()); //总数 int totalCount=orderCommentMapper.selectCommentTotalCountByProductSkuId(orderCommentPageDTO.getProductSkuId()); - orderCommentPageBO.setOrderCommentItems(OrderCommentConvert.INSTANCE.convert(orderCommentDOList)); + orderCommentPageBO.setOrderCommentItems(orderCommentItemList); orderCommentPageBO.setTotal(totalCount); return orderCommentPageBO; } diff --git a/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml b/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml index 9d96f35ac..5a1d5292f 100644 --- a/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml +++ b/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml @@ -21,7 +21,7 @@ @@ -46,7 +46,7 @@ WHERE id = #{id} ORDER BY create_time DESC - LIMIT ${pageNo * pageSize}, ${pageSize} + LIMIT ${ pageNo * pageSize },${ pageSize } \ No newline at end of file diff --git a/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml b/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml index 17906b50b..aa917b97c 100644 --- a/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml +++ b/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml @@ -9,7 +9,7 @@ - INSERT INTO order_comment_replay(comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,reply_user_id + INSERT INTO order_comment_replay(comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,reply_user_id, reply_user_nick_name,reply_user_avatar,user_type,create_time,update_time) VALUES (#{commentId},#{replyType},#{parentId},#{parentUserId},#{parentUserNickName},#{parentUserAvatar},#{replyContent},#{replyUserId}, #{replyUserNickName},#{replyUserAvatar},#{userType},#{createTime},#{updateTime}) @@ -51,10 +51,29 @@ LIMIT ${pageNo * pageSize}, ${pageSize} -