|
|
@@ -1,6 +1,7 @@
|
|
|
package com.cyksj.service.order.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
@@ -53,6 +54,15 @@ public class OrderCommentFrontServiceImpl implements OrderCommentFrontService {
|
|
|
.field(OrderDonView::getId, orderId)
|
|
|
.field(OrderDonView::getUserId, userId).build());
|
|
|
if (orderDonView == null) throw BusinessRuntimeException.getInstance("您评论的订单不存在");
|
|
|
+ if (request.getTitle().length() > 200) {
|
|
|
+ throw BusinessRuntimeException.getInstance("标题过长");
|
|
|
+ }
|
|
|
+ if (request.getContent().length() > 1000) {
|
|
|
+ throw BusinessRuntimeException.getInstance("评论内容过多");
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(request.getPicture()) && request.getPicture().length() > 2000) {
|
|
|
+ throw BusinessRuntimeException.getInstance("图片过多");
|
|
|
+ }
|
|
|
if (Constant.noOrderStatus.contains(orderDonView.getStatus().name())) {
|
|
|
throw BusinessRuntimeException.getInstance("您该订单未完成");
|
|
|
}
|