Skip to content

Commit

Permalink
同步
Browse files Browse the repository at this point in the history
  • Loading branch information
lifenlong committed Jun 13, 2021
2 parents 332e287 + 89f4b71 commit 5a4f8e2
Show file tree
Hide file tree
Showing 47 changed files with 312 additions and 138 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_

2.禁止将本开源的代码和资源进行任何形式任何名义的出售.

3.限制商用,如果需要商业使用请联系我们。QQ3409056806.
3.软件受国家计算机软件著作权保护(登记号:2021SR0805085)。

4.限制商用,如果需要商业使用请联系我们。QQ3409056806.


### 交流群

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package cn.lili.controller.other;

import cn.lili.common.enums.ResultUtil;
import cn.lili.common.utils.PageUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.system.entity.dos.AppVersion;
import cn.lili.modules.system.service.AppVersionService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
Expand Down Expand Up @@ -33,4 +38,13 @@ public class AppVersionBuyerController {
public ResultMessage<Object> getAppVersion(@PathVariable String appType) {
return ResultUtil.data(appVersionService.getAppVersion(appType));
}

@ApiOperation(value = "获取版本号")
@ApiImplicitParam(name = "appType", value = "app类型", required = true, paramType = "path")
@GetMapping("/appVersion/{type}")
public ResultMessage<IPage<AppVersion>> appVersion(PageVO pageVO, @PathVariable String appType) {

IPage<AppVersion> page=appVersionService.page(PageUtil.initPage(pageVO), new LambdaQueryWrapper<AppVersion>().eq(AppVersion::getType, appType));
return ResultUtil.data(page);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import cn.lili.modules.payment.kit.enums.PaymentClientEnum;
import cn.lili.modules.payment.kit.enums.PaymentMethodEnum;
import cn.lili.modules.payment.kit.params.dto.CashierParam;
import cn.lili.modules.payment.service.PaymentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
Expand All @@ -35,8 +34,6 @@ public class CashierController {

@Autowired
private CashierSupport cashierSupport;
@Autowired
private PaymentService paymentService;


@ApiImplicitParams({
Expand Down
2 changes: 1 addition & 1 deletion buyer-api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ spring:
props:
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
sql:
show: true
show: false

# 忽略TOKEN 鉴权 的url
ignored:
Expand Down
2 changes: 1 addition & 1 deletion buyer-api/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spring:
props:
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
sql:
show: true
show: false

# 忽略鉴权url
ignored:
Expand Down
14 changes: 13 additions & 1 deletion common-api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spring:
props:
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
sql:
show: true
show: false

# 忽略鉴权url
ignored:
Expand Down Expand Up @@ -209,6 +209,18 @@ jasypt:
password: lili

lili:
#短信模版配置
sms:
#登录
LOGIN: SMS_205755300
#注册
REGISTER: SMS_205755298
#找回密码
FIND_USER: SMS_205755301
#设置密码
UPDATE_PASSWORD: SMS_205755297
#支付密码
WALLET_PASSWORD: SMS_205755301
system:
isDemoSite: true
licences: 'temporary'
Expand Down
16 changes: 14 additions & 2 deletions config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spring:
props:
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
sql:
show: true
show: false

# 忽略鉴权url
ignored:
Expand Down Expand Up @@ -210,6 +210,18 @@ jasypt:
password: lili

lili:
#短信模版配置
sms:
#登录
LOGIN: SMS_205755300
#注册
REGISTER: SMS_205755298
#找回密码
FIND_USER: SMS_205755301
#设置密码
UPDATE_PASSWORD: SMS_205755297
#支付密码
WALLET_PASSWORD: SMS_205755301
system:
isDemoSite: false
statistics:
Expand Down Expand Up @@ -237,7 +249,7 @@ lili:
# jwt 细节设定
jwt-setting:
# token过期时间(分钟)
tokenExpireTime: 60
tokenExpireTime: 1

# 使用Spring @Cacheable注解失效时间
cache:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cn.lili.event.impl;

import cn.lili.event.TradeEvent;
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
import cn.lili.modules.order.order.service.TradeService;
import cn.lili.modules.payment.kit.enums.PaymentMethodEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* 订单状态处理类
*
* @author Chopper
* @date 2020-07-03 11:20
**/
@Service
public class OrderStatusHandlerExecute implements TradeEvent {


@Autowired
private TradeService tradeService;

@Override
public void orderCreate(TradeDTO tradeDTO) {
//如果订单需要支付金额为0,则将订单步入到下一个流程
if (tradeDTO.getPriceDetailDTO().getFlowPrice() <= 0) {
tradeService.payTrade(tradeDTO.getSn(), PaymentMethodEnum.BANK_TRANSFER.name(), "-1");
}

}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cn.lili.trigger.executor;

import cn.hutool.json.JSONUtil;
import cn.lili.common.delayqueue.PintuanOrderMessage;
import cn.lili.common.delayqueue.PromotionMessage;
import cn.lili.common.trigger.message.PintuanOrderMessage;
import cn.lili.common.trigger.message.PromotionMessage;
import cn.lili.common.trigger.interfaces.TimeTrigger;
import cn.lili.common.trigger.interfaces.TimeTriggerExecutor;
import cn.lili.common.trigger.model.TimeExecuteConstant;
Expand Down
2 changes: 1 addition & 1 deletion consumer/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spring:
props:
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
sql:
show: true
show: false

# 忽略鉴权url
ignored:
Expand Down
31 changes: 31 additions & 0 deletions framework/src/main/java/cn/lili/common/cache/Cache.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,35 @@ public interface Cache<T> {
* @return
*/
Set<ZSetOperations.TypedTuple<Object>> reverseRangeWithScores(String sortedSetName, Integer start, Integer end);


/**
* 向Zset里添加成员
*
* @param key key值
* @param score 分数
* @param value 值
* @return 增加状态
*/
boolean zAdd(String key, long score, String value);


/**
* 获取 某key 下 某一分值区间的队列
*
* @param key 缓存key
* @param from 开始时间
* @param to 结束时间
* @return 数据
*/
Set<ZSetOperations.TypedTuple<Object>> zRangeByScore(String key, int from, long to);

/**
* 移除 Zset队列值
*
* @param key key值
* @param value 删除的集合
* @return 删除数量
*/
Long zRemove(String key, String... value);
}
43 changes: 43 additions & 0 deletions framework/src/main/java/cn/lili/common/cache/impl/RedisCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,47 @@ public void incrementScore(String sortedSetName, String keyword) {
public Set<ZSetOperations.TypedTuple<Object>> reverseRangeWithScores(String sortedSetName, Integer start, Integer end) {
return this.redisTemplate.opsForZSet().reverseRangeWithScores(sortedSetName, start, end);
}


/**
* 向Zset里添加成员
*
* @param key key值
* @param score 分数,通常用于排序
* @param value 值
* @return 增加状态
*/
@Override
public boolean zAdd(String key, long score, String value) {
Boolean result = redisTemplate.opsForZSet().add(key, value, score);
return result;

}


/**
* 获取 某key 下 某一分值区间的队列
*
* @param key 缓存key
* @param from 开始时间
* @param to 结束时间
* @return 数据
*/
@Override
public Set<ZSetOperations.TypedTuple<Object>> zRangeByScore(String key, int from, long to) {
Set<ZSetOperations.TypedTuple<Object>> set = redisTemplate.opsForZSet().rangeByScoreWithScores(key, from, to);
return set;
}

/**
* 移除 Zset队列值
*
* @param key key值
* @param value 删除的集合
* @return 删除数量
*/
@Override
public Long zRemove(String key, String... value) {
return redisTemplate.opsForZSet().remove(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public enum ResultCode {
/**
* 支付
*/
PAY_UN_WANTED(32000, "当前订单不需要付款,返回订单列表等待系统订单出库即可"),
PAY_SUCCESS(32001, "支付成功"),
PAY_INCONSISTENT_ERROR(32002, "付款金额和应付金额不一致"),
PAY_DOUBLE_ERROR(32003, "订单已支付,不能再次进行支付"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.regex.Pattern;

/**
* 防止Xss sql注入
* 防止Xss
*
* @author Chopper
* @version v1.0
Expand Down Expand Up @@ -93,8 +93,8 @@ private String cleanXSS2(String value) {
private String cleanXSS(String value) {
if (value != null) {
//推荐使用ESAPI库来避免脚本攻击,value = ESAPI.encoder().canonicalize(value);
// 避免空字符串
value = value.replaceAll(" ", "");
// // 避免空字符串
// value = value.replaceAll(" ", "");
// 避免script 标签
Pattern scriptPattern = Pattern.compile("<script>(.*?)</script>", Pattern.CASE_INSENSITIVE);
value = scriptPattern.matcher(value).replaceAll("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import cn.lili.common.sms.SmsUtil;
import cn.lili.common.utils.CommonUtil;
import cn.lili.common.verification.enums.VerificationEnums;
import cn.lili.config.properties.SmsTemplateSetting;
import cn.lili.modules.connect.util.Base64Utils;
import cn.lili.modules.member.entity.dos.Member;
import cn.lili.modules.member.service.MemberService;
Expand Down Expand Up @@ -51,6 +52,9 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil {
@Autowired
private MemberService memberService;

@Autowired
private SmsTemplateSetting smsTemplateSetting;

@Override
public void sendSmsCode(String mobile, VerificationEnums verificationEnums, String uuid) {
//获取短信配置
Expand All @@ -75,17 +79,17 @@ public void sendSmsCode(String mobile, VerificationEnums verificationEnums, Stri
switch (verificationEnums) {
//登录
case LOGIN: {
templateCode = "SMS_205755300";
templateCode = smsTemplateSetting.getLOGIN();
break;
}
//注册
case REGISTER: {
templateCode = "SMS_205755298";
templateCode = smsTemplateSetting.getREGISTER();
break;
}
//找回密码
case FIND_USER: {
templateCode = "SMS_205755301";
templateCode = smsTemplateSetting.getFIND_USER();
break;
}
//修改密码
Expand All @@ -96,7 +100,15 @@ public void sendSmsCode(String mobile, VerificationEnums verificationEnums, Stri
}
//更新为用户最新手机号
mobile = member.getMobile();
templateCode = "SMS_205755297";
templateCode = smsTemplateSetting.getUPDATE_PASSWORD();
break;
}
//设置支付密码
case WALLET_PASSWORD: {
Member member = memberService.getById(UserContext.getCurrentUser().getId());
//更新为用户最新手机号
mobile = member.getMobile();
templateCode = smsTemplateSetting.getWALLET_PASSWORD();
break;
}
//如果不是有效的验证码手段,则此处不进行短信操作
Expand Down
Loading

0 comments on commit 5a4f8e2

Please sign in to comment.