diff --git a/buyer-api/src/main/java/cn/lili/controller/other/FeedbackBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/other/FeedbackBuyerController.java index f47827db..83f0ac04 100644 --- a/buyer-api/src/main/java/cn/lili/controller/other/FeedbackBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/other/FeedbackBuyerController.java @@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.validation.Valid; + /** * 买家端,意见反馈接口 * @@ -31,7 +33,7 @@ public class FeedbackBuyerController { @ApiOperation(value = "添加意见反馈") @PostMapping() - public ResultMessage save(Feedback feedback) { + public ResultMessage save(@Valid Feedback feedback) { feedback.setUserName(UserContext.getCurrentUser().getNickName()); feedbackService.save(feedback); return ResultUtil.success(); diff --git a/framework/pom.xml b/framework/pom.xml index 787efb9e..24c56ec1 100644 --- a/framework/pom.xml +++ b/framework/pom.xml @@ -137,11 +137,11 @@ ${jasypt-version} - - com.ibeetl - beetl - ${beetl-version} - + + + + + com.aliyun @@ -276,11 +276,11 @@ logstash-logback-encoder ${logstash-logback-encoder} - - javax.interceptor - javax.interceptor-api - ${interceptor-api} - + + + + + de.codecentric spring-boot-admin-starter-client diff --git a/framework/src/main/java/cn/lili/modules/message/entity/dos/NoticeMessage.java b/framework/src/main/java/cn/lili/modules/message/entity/dos/NoticeMessage.java index ca0a0020..c8661143 100644 --- a/framework/src/main/java/cn/lili/modules/message/entity/dos/NoticeMessage.java +++ b/framework/src/main/java/cn/lili/modules/message/entity/dos/NoticeMessage.java @@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotEmpty; /** * 通知类站内信模版对象 @@ -21,22 +24,30 @@ public class NoticeMessage extends BaseEntity { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "站内信节点") + @NotEmpty(message = "站内信节点不能为空") + @Length(max = 50, message = "站内信节点名称太长,不能超过50") private String noticeNode; @ApiModelProperty(value = "站内信标题") + @NotEmpty(message = "站内信标题不能为空") + @Length(max = 50, message = "站内信标题名称太长,不能超过50") private String noticeTitle; @ApiModelProperty(value = "站内信内容") + @NotEmpty(message = "站内信内容不能为空") + @Length(max = 200, message = "站内信内容名称太长,不能超过200") private String noticeContent; /** * @see cn.lili.common.enums.SwitchEnum */ + @NotEmpty(message = "站内信状态不能为空") @ApiModelProperty(value = "站内信是否开启") private String noticeStatus; /** * @see cn.lili.modules.message.entity.enums.NoticeMessageParameterEnum */ @ApiModelProperty(value = "消息变量") + @NotEmpty(message = "站内信状态不能为空") private String variable; diff --git a/framework/src/main/java/cn/lili/modules/message/serviceimpl/MessageServiceImpl.java b/framework/src/main/java/cn/lili/modules/message/serviceimpl/MessageServiceImpl.java index 395d4811..690df3d8 100644 --- a/framework/src/main/java/cn/lili/modules/message/serviceimpl/MessageServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/message/serviceimpl/MessageServiceImpl.java @@ -43,8 +43,6 @@ public class MessageServiceImpl extends ServiceImpl impl //保存站内信信息 this.save(message); //发送站内信消息提醒 - String destination = rocketmqCustomProperties.getOtherTopic() + ":" + OtherTagsEnum.MESSAGE.name(); - rocketMQTemplate.asyncSend(destination, message, RocketmqSendCallbackBuilder.commonCallback()); String noticeSendDestination = rocketmqCustomProperties.getNoticeSendTopic() + ":" + OtherTagsEnum.MESSAGE.name(); rocketMQTemplate.asyncSend(noticeSendDestination, message, RocketmqSendCallbackBuilder.commonCallback()); return true; diff --git a/framework/src/main/java/cn/lili/modules/page/entity/dos/Feedback.java b/framework/src/main/java/cn/lili/modules/page/entity/dos/Feedback.java index efdc559d..276c2b0e 100644 --- a/framework/src/main/java/cn/lili/modules/page/entity/dos/Feedback.java +++ b/framework/src/main/java/cn/lili/modules/page/entity/dos/Feedback.java @@ -45,9 +45,11 @@ public class Feedback extends BaseIdEntity { private String context; @ApiModelProperty(value = "手机号") + @Length(max = 11, message = "手机号不能超过11位") private String mobile; @ApiModelProperty(value = "图片,多个图片使用:(,)分割") + @Length(max = 255, message = "图片上传太多啦,请选择删除掉") private String images; /** diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayApi.java b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayApi.java index c63eeced..c3770c14 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayApi.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayApi.java @@ -1,5 +1,6 @@ package cn.lili.modules.payment.kit.plugin.alipay; +import cn.hutool.http.HtmlUtil; import com.alibaba.fastjson.JSONObject; import com.alipay.api.*; import com.alipay.api.domain.*; @@ -950,7 +951,7 @@ public class AliPayApi { for (int i = 0; i < values.length; i++) { valueStr = (i == values.length - 1) ? valueStr + values[i] : valueStr + values[i] + ","; } - params.put(name, valueStr); + params.put(name, HtmlUtil.unescape(valueStr)); } return params; } diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java index 751559d8..21d04846 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillServiceImpl.java @@ -188,6 +188,9 @@ public class SeckillServiceImpl extends ServiceImpl impl if (PromotionStatusEnum.START.name().equals(seckillVO.getPromotionStatus())) { throw new ServiceException(ResultCode.PROMOTION_UPDATE_ERROR); } + if (seckillVO.getEndTime() == null) { + seckillVO.setEndTime(cn.hutool.core.date.DateUtil.endOfDay(seckillVO.getStartTime())); + } PromotionTools.checkPromotionTime(seckillVO.getStartTime().getTime(), seckillVO.getEndTime().getTime()); //更新到MYSQL中 boolean result = this.updateById(seckillVO); diff --git a/framework/src/main/java/cn/lili/modules/search/entity/dto/HotWordsDTO.java b/framework/src/main/java/cn/lili/modules/search/entity/dto/HotWordsDTO.java index 8756dcf2..b05f330e 100644 --- a/framework/src/main/java/cn/lili/modules/search/entity/dto/HotWordsDTO.java +++ b/framework/src/main/java/cn/lili/modules/search/entity/dto/HotWordsDTO.java @@ -2,8 +2,7 @@ package cn.lili.modules.search.entity.dto; import lombok.Data; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; +import javax.validation.constraints.*; /** * 搜索热词 @@ -16,9 +15,12 @@ import javax.validation.constraints.NotNull; public class HotWordsDTO { @NotBlank(message = "搜索热词不能为空") + @Size(max = 20, min = 1, message = "搜索热词长度限制在1-20") private String keywords; @NotNull(message = "分数不能为空") + @Max(value = 9999999999L,message = "分数不能大于9999999999") + @Min(value = -9999999999L,message = "分数不能小于9999999999") private Integer point; } diff --git a/manager-api/src/main/java/cn/lili/controller/setting/NoticeMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/setting/NoticeMessageManagerController.java index e9d73632..33d50c50 100644 --- a/manager-api/src/main/java/cn/lili/controller/setting/NoticeMessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/setting/NoticeMessageManagerController.java @@ -96,7 +96,7 @@ public class NoticeMessageManagerController { noticeMessage.setNoticeContent(noticeContent); noticeMessage.setNoticeTitle(noticeTitle); noticeMessageService.updateById(noticeMessage); - ResultUtil.data(noticeMessage); + return ResultUtil.data(noticeMessage); } throw new ResourceNotFoundException(ResultCode.NOTICE_NOT_EXIST.message()); }