Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop

合并之前代码,解决部分参数校验问题,解决消息发送加入到两个mq队列通道问题,取消两个无效maven依赖
This commit is contained in:
Chopper 2021-09-27 14:31:25 +08:00
commit 87c82ce4d3
9 changed files with 36 additions and 17 deletions

View File

@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/** /**
* 买家端,意见反馈接口 * 买家端,意见反馈接口
* *
@ -31,7 +33,7 @@ public class FeedbackBuyerController {
@ApiOperation(value = "添加意见反馈") @ApiOperation(value = "添加意见反馈")
@PostMapping() @PostMapping()
public ResultMessage<Object> save(Feedback feedback) { public ResultMessage<Object> save(@Valid Feedback feedback) {
feedback.setUserName(UserContext.getCurrentUser().getNickName()); feedback.setUserName(UserContext.getCurrentUser().getNickName());
feedbackService.save(feedback); feedbackService.save(feedback);
return ResultUtil.success(); return ResultUtil.success();

View File

@ -137,11 +137,11 @@
<version>${jasypt-version}</version> <version>${jasypt-version}</version>
</dependency> </dependency>
<!-- 模板引擎 --> <!-- 模板引擎 -->
<dependency> <!-- <dependency>-->
<groupId>com.ibeetl</groupId> <!-- <groupId>com.ibeetl</groupId>-->
<artifactId>beetl</artifactId> <!-- <artifactId>beetl</artifactId>-->
<version>${beetl-version}</version> <!-- <version>${beetl-version}</version>-->
</dependency> <!-- </dependency>-->
<!-- 阿里云核心包--> <!-- 阿里云核心包-->
<dependency> <dependency>
<groupId>com.aliyun</groupId> <groupId>com.aliyun</groupId>
@ -276,11 +276,11 @@
<artifactId>logstash-logback-encoder</artifactId> <artifactId>logstash-logback-encoder</artifactId>
<version>${logstash-logback-encoder}</version> <version>${logstash-logback-encoder}</version>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>javax.interceptor</groupId> <!-- <groupId>javax.interceptor</groupId>-->
<artifactId>javax.interceptor-api</artifactId> <!-- <artifactId>javax.interceptor-api</artifactId>-->
<version>${interceptor-api}</version> <!-- <version>${interceptor-api}</version>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>de.codecentric</groupId> <groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId> <artifactId>spring-boot-admin-starter-client</artifactId>

View File

@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; 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; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "站内信节点") @ApiModelProperty(value = "站内信节点")
@NotEmpty(message = "站内信节点不能为空")
@Length(max = 50, message = "站内信节点名称太长,不能超过50")
private String noticeNode; private String noticeNode;
@ApiModelProperty(value = "站内信标题") @ApiModelProperty(value = "站内信标题")
@NotEmpty(message = "站内信标题不能为空")
@Length(max = 50, message = "站内信标题名称太长,不能超过50")
private String noticeTitle; private String noticeTitle;
@ApiModelProperty(value = "站内信内容") @ApiModelProperty(value = "站内信内容")
@NotEmpty(message = "站内信内容不能为空")
@Length(max = 200, message = "站内信内容名称太长不能超过200")
private String noticeContent; private String noticeContent;
/** /**
* @see cn.lili.common.enums.SwitchEnum * @see cn.lili.common.enums.SwitchEnum
*/ */
@NotEmpty(message = "站内信状态不能为空")
@ApiModelProperty(value = "站内信是否开启") @ApiModelProperty(value = "站内信是否开启")
private String noticeStatus; private String noticeStatus;
/** /**
* @see cn.lili.modules.message.entity.enums.NoticeMessageParameterEnum * @see cn.lili.modules.message.entity.enums.NoticeMessageParameterEnum
*/ */
@ApiModelProperty(value = "消息变量") @ApiModelProperty(value = "消息变量")
@NotEmpty(message = "站内信状态不能为空")
private String variable; private String variable;

View File

@ -43,8 +43,6 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
//保存站内信信息 //保存站内信信息
this.save(message); this.save(message);
//发送站内信消息提醒 //发送站内信消息提醒
String destination = rocketmqCustomProperties.getOtherTopic() + ":" + OtherTagsEnum.MESSAGE.name();
rocketMQTemplate.asyncSend(destination, message, RocketmqSendCallbackBuilder.commonCallback());
String noticeSendDestination = rocketmqCustomProperties.getNoticeSendTopic() + ":" + OtherTagsEnum.MESSAGE.name(); String noticeSendDestination = rocketmqCustomProperties.getNoticeSendTopic() + ":" + OtherTagsEnum.MESSAGE.name();
rocketMQTemplate.asyncSend(noticeSendDestination, message, RocketmqSendCallbackBuilder.commonCallback()); rocketMQTemplate.asyncSend(noticeSendDestination, message, RocketmqSendCallbackBuilder.commonCallback());
return true; return true;

View File

@ -45,9 +45,11 @@ public class Feedback extends BaseIdEntity {
private String context; private String context;
@ApiModelProperty(value = "手机号") @ApiModelProperty(value = "手机号")
@Length(max = 11, message = "手机号不能超过11位")
private String mobile; private String mobile;
@ApiModelProperty(value = "图片,多个图片使用:()分割") @ApiModelProperty(value = "图片,多个图片使用:()分割")
@Length(max = 255, message = "图片上传太多啦,请选择删除掉")
private String images; private String images;
/** /**

View File

@ -1,5 +1,6 @@
package cn.lili.modules.payment.kit.plugin.alipay; package cn.lili.modules.payment.kit.plugin.alipay;
import cn.hutool.http.HtmlUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alipay.api.*; import com.alipay.api.*;
import com.alipay.api.domain.*; import com.alipay.api.domain.*;
@ -950,7 +951,7 @@ public class AliPayApi {
for (int i = 0; i < values.length; i++) { for (int i = 0; i < values.length; i++) {
valueStr = (i == values.length - 1) ? valueStr + values[i] : valueStr + values[i] + ","; valueStr = (i == values.length - 1) ? valueStr + values[i] : valueStr + values[i] + ",";
} }
params.put(name, valueStr); params.put(name, HtmlUtil.unescape(valueStr));
} }
return params; return params;
} }

View File

@ -188,6 +188,9 @@ public class SeckillServiceImpl extends ServiceImpl<SeckillMapper, Seckill> impl
if (PromotionStatusEnum.START.name().equals(seckillVO.getPromotionStatus())) { if (PromotionStatusEnum.START.name().equals(seckillVO.getPromotionStatus())) {
throw new ServiceException(ResultCode.PROMOTION_UPDATE_ERROR); 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()); PromotionTools.checkPromotionTime(seckillVO.getStartTime().getTime(), seckillVO.getEndTime().getTime());
//更新到MYSQL中 //更新到MYSQL中
boolean result = this.updateById(seckillVO); boolean result = this.updateById(seckillVO);

View File

@ -2,8 +2,7 @@ package cn.lili.modules.search.entity.dto;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.*;
import javax.validation.constraints.NotNull;
/** /**
* 搜索热词 * 搜索热词
@ -16,9 +15,12 @@ import javax.validation.constraints.NotNull;
public class HotWordsDTO { public class HotWordsDTO {
@NotBlank(message = "搜索热词不能为空") @NotBlank(message = "搜索热词不能为空")
@Size(max = 20, min = 1, message = "搜索热词长度限制在1-20")
private String keywords; private String keywords;
@NotNull(message = "分数不能为空") @NotNull(message = "分数不能为空")
@Max(value = 9999999999L,message = "分数不能大于9999999999")
@Min(value = -9999999999L,message = "分数不能小于9999999999")
private Integer point; private Integer point;
} }

View File

@ -96,7 +96,7 @@ public class NoticeMessageManagerController {
noticeMessage.setNoticeContent(noticeContent); noticeMessage.setNoticeContent(noticeContent);
noticeMessage.setNoticeTitle(noticeTitle); noticeMessage.setNoticeTitle(noticeTitle);
noticeMessageService.updateById(noticeMessage); noticeMessageService.updateById(noticeMessage);
ResultUtil.data(noticeMessage); return ResultUtil.data(noticeMessage);
} }
throw new ResourceNotFoundException(ResultCode.NOTICE_NOT_EXIST.message()); throw new ResourceNotFoundException(ResultCode.NOTICE_NOT_EXIST.message());
} }