Browse Source

宝象购修复

zyh
Loki 3 years ago
parent
commit
4d3b8caf21
  1. 1
      sync.sh
  2. 1
      yudao-dependencies/pom.xml
  3. 4
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ApiCode.java
  4. 9
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/ApiResult.java
  5. 6
      yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java
  6. 2
      yudao-server/pom.xml
  7. 228
      yudao-server/src/main/resources/application-prod.yaml
  8. 8
      yudao-server/src/main/resources/application.yaml
  9. 2
      yudao-server/src/main/resources/logback-spring.xml
  10. 6
      zsw-bxg/src/main/java/co/yixiang/app/common/util/JwtToken.java
  11. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java
  12. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreCombinationController.java
  13. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreSeckillController.java
  14. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/StoreIntegralController.java
  15. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/auth/rest/LetterAppAuthController.java
  16. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java
  17. 4
      zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java
  18. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/manage/rest/ShoperController.java
  19. 10
      zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java
  20. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreCategoryController.java
  21. 16
      zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreProductController.java
  22. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/services/AppAuthService.java
  23. 3
      zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/ArticleController.java
  24. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/IndexController.java
  25. 4
      zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/AppStoreAfterSalesController.java
  26. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/AppUserBillController.java
  27. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/AppUserExtractController.java
  28. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/AppUserRechargeController.java
  29. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/LetterAppUserController.java
  30. 4
      zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/UserAddressController.java
  31. 4
      zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/UserLevelController.java
  32. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/wechat/rest/controller/WechatController.java
  33. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/wechat/rest/controller/WechatLiveController.java
  34. 2
      zsw-bxg/src/main/java/co/yixiang/app/modules/wechat/rest/controller/WxMaUserController.java
  35. 6
      zsw-bxg/src/main/java/co/yixiang/config/CachingConfigurer.java
  36. 4
      zsw-bxg/src/main/java/co/yixiang/config/StringKeyRedisSerializer.java
  37. 5
      zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java
  38. 2
      zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java

1
sync.sh

@ -0,0 +1 @@
rsync yudao-server/target/yudao-server.jar root@39.105.46.0:/root/project/zen/yudao.jar

1
yudao-dependencies/pom.xml

@ -14,6 +14,7 @@
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
<properties>
<skipTest>true</skipTest>
<revision>1.6.2-snapshot</revision>
<!-- 统一依赖管理 -->
<spring.boot.version>2.5.10</spring.boot.version>

4
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/ApiCode.java

@ -21,9 +21,9 @@ public enum ApiCode {
**/
SUCCESS(200, "操作成功"),
/**
* 非法访问
* 登录状态失效 请重新登录
**/
UNAUTHORIZED(401, "非法访问"),
UNAUTHORIZED(401, "登录状态失效 请重新登录"),
/**
* 没有权限
**/

9
zsw-bxg/src/main/java/co/yixiang/api/ApiResult.java → yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/ApiResult.java

@ -6,18 +6,17 @@
* 购买后可获得全部源代码禁止转卖分享上传到码云github等开源平台
* 一经发现盗用分享等行为将追究法律责任后果自负
*/
package co.yixiang.api;
package cn.iocoder.yudao.framework.common.pojo;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.exception.ApiCode;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.util.Date;
@ -78,7 +77,7 @@ public class ApiResult<T> implements Serializable {
* 响应时间
*/
@ApiModelProperty(value = "响应时间")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
//@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date time;
@ -119,7 +118,7 @@ public class ApiResult<T> implements Serializable {
if (apiCode.getCode() == ApiCode.SUCCESS.getCode()){
success = true;
}
if (StringUtils.isBlank(message)){
if (StrUtil.isBlank(message)){
message = apiCode.getMessage();
}
return (ApiResult<T>) ApiResult.builder()

6
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java

@ -5,6 +5,7 @@ import cn.hutool.core.map.MapUtil;
import cn.hutool.extra.servlet.ServletUtil;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO;
@ -217,9 +218,10 @@ public class GlobalExceptionHandler {
}
@ExceptionHandler(value = YshopException.class)
public CommonResult<?> yshopException(YshopException ex){
public ApiResult<?> yshopException(YshopException ex){
log.info("[YshopException]",ex);
return CommonResult.error(ex.getErrorCode(), ex.getMessage());
return ApiResult.fail(ex.getErrorCode(),ex.getMessage());
//return CommonResult.error(ex.getErrorCode(), ex.getMessage());
}
/**

2
yudao-server/pom.xml

@ -13,6 +13,7 @@
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
后端 Server 的主项目,通过引入需要 yudao-module-xxx 的依赖,
从而实现提供 RESTful API 给 yudao-ui-admin、yudao-ui-user 等前端项目。
@ -93,6 +94,7 @@
<configuration>
<fork>true</fork>
</configuration>
<executions>
<execution>
<goals>

228
yudao-server/src/main/resources/application-prod.yaml

@ -0,0 +1,228 @@
server:
port: 48080
--- #################### 数据库相关配置 ####################
spring:
# 数据源配置项
autoconfigure:
exclude:
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
datasource:
druid: # Druid 【监控】相关的全局配置
web-stat-filter:
enabled: true
stat-view-servlet:
enabled: true
allow: # 设置白名单,不填则允许所有访问
url-pattern: /druid/*
login-username: # 控制台管理用户名和密码
login-password:
filter:
stat:
enabled: true
log-slow-sql: true # 慢 SQL 记录
slow-sql-millis: 100
merge-sql: true
wall:
config:
multi-statement-allow: true
dynamic: # 多数据源配置
druid: # Druid 【连接池】相关的全局配置
initial-size: 5 # 初始连接数
min-idle: 10 # 最小连接池数量
max-active: 20 # 最大连接池数量
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
test-while-idle: true
test-on-borrow: false
test-on-return: false
primary: master
datasource:
master:
name: ruoyi-vue-pro
url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver
username: root
password: cyjj123!
slave: # 模拟从库,可根据自己需要修改
name: ruoyi-vue-pro
url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver
username: root
password: cyjj123!
xiaohui: # 农场数据源
name: bxg
url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.xiaohui.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver
username: root
password: cyjj123!
# farm: # 农场数据源
# name: zsw-farm
# url: jdbc:mysql://192.168.10.129:3306/${spring.datasource.dynamic.datasource.farm.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
# driver-class-name: com.mysql.jdbc.Driver
# username: root
# password: root
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:
host: 127.0.0.1 # 地址
port: 6379 # 端口
database: 15 # 数据库索引
--- #################### 定时任务相关配置 ####################
# Quartz 配置项,对应 QuartzProperties 配置类
spring:
quartz:
auto-startup: false # 本地开发环境,尽量不要开启 Job
scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName
job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。
wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true
properties: # 添加 Quartz Scheduler 附加属性,更多可以看 http://www.quartz-scheduler.org/documentation/2.4.0-SNAPSHOT/configuration.html 文档
org:
quartz:
# Scheduler 相关配置
scheduler:
instanceName: schedulerName
instanceId: AUTO # 自动生成 instance ID
# JobStore 相关配置
jobStore:
# JobStore 实现类。可见博客:https://blog.csdn.net/weixin_42458219/article/details/122247162
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
isClustered: true # 是集群模式
clusterCheckinInterval: 15000 # 集群检查频率,单位:毫秒。默认为 15000,即 15 秒
misfireThreshold: 60000 # misfire 阀值,单位:毫秒。
# 线程池相关配置
threadPool:
threadCount: 25 # 线程池大小。默认为 10 。
threadPriority: 5 # 线程优先级
class: org.quartz.simpl.SimpleThreadPool # 线程池类型
jdbc: # 使用 JDBC 的 JobStore 的时候,JDBC 的配置
initialize-schema: NEVER # 是否自动使用 SQL 初始化 Quartz 表结构。这里设置成 never ,我们手动创建表结构。
--- #################### 配置中心相关配置 ####################
# Apollo 配置中心
apollo:
bootstrap:
enabled: true # 设置 Apollo 在启动阶段生效
eagerLoad:
enabled: true # 设置 Apollo 在日志初始化前生效,可以实现日志的动态级别配置
jdbc: # 自定义的 JDBC 配置项,用于数据库的地址
dao: cn.iocoder.yudao.module.infra.dal.mysql.config.ConfigDAOImpl
url: ${spring.datasource.dynamic.datasource.master.url}
username: ${spring.datasource.dynamic.datasource.master.username}
password: ${spring.datasource.dynamic.datasource.master.password}
#################### 服务保障相关配置 ####################
# Lock4j 配置项
lock4j:
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
# Resilience4j 配置项
resilience4j:
ratelimiter:
instances:
backendA:
limit-for-period: 1 # 每个周期内,允许的请求数。默认为 50
limit-refresh-period: 60s # 每个周期的时长,单位:微秒。默认为 500
timeout-duration: 1s # 被限流时,阻塞等待的时长,单位:微秒。默认为 5s
register-health-indicator: true # 是否注册到健康监测
#################### 监控相关配置 ####################
# Actuator 监控端点的配置项
management:
endpoints:
web:
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
exposure:
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
# Spring Boot Admin 配置项
spring:
boot:
admin:
# Spring Boot Admin Client 客户端的相关配置
client:
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
instance:
prefer-ip: true # 注册实例时,优先使用 IP
# Spring Boot Admin Server 服务端的相关配置
context-path: /admin # 配置 Spring
# 日志文件配置
logging:
file:
name: logs/${spring.application.name}.log # 日志文件名,全路径
level:
# 配置自己写的 MyBatis Mapper 打印日志
cn.iocoder.yudao.module.bpm.dal.mysql: debug
cn.iocoder.yudao.module.infra.dal.mysql: debug
cn.iocoder.yudao.module.pay.dal.mysql: debug
cn.iocoder.yudao.module.system.dal.mysql: debug
cn.iocoder.yudao.module.tool.dal.mysql: debug
cn.iocoder.yudao.module.member.dal.mysql: debug
co.yixiang: debug
--- #################### 微信公众号相关配置 ####################
wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
mp:
# 公众号配置(必填)
app-id: wx041349c6f39b268b
secret: 5abee519483bc9f8cb37ce280e814bd0
# 存储配置,解决 AccessToken 的跨节点的共享
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
key-prefix: wx # Redis Key 的前缀 TODO 芋艿:解决下 Redis key 管理的配置
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
--- #################### 芋道相关配置 ####################
# 芋道配置项,设置当前项目所有自定义的配置
yudao:
captcha:
enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试
security:
token-header: Authorization
token-timeout: 1d
session-timeout: 1d
mock-enable: true
mock-secret: test
xss:
enable: false
exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
pay:
pay-notify-url: http://niubi.natapp1.cc/api/pay/order/notify
pay-return-url: http://niubi.natapp1.cc/api/pay/order/return
refund-notify-url: http://niubi.natapp1.cc/api/pay/refund/notify
demo: false # 关闭演示模式
justauth:
enabled: true
type:
GITEE: # Gitee
client-id: ee61f0374a4c6c404a8717094caa7a410d76950e45ff60348015830c519ba5c1
client-secret: 7c044a5671be3b051414db0cf2cec6ad702dd298d2416ba24ceaf608e6fa26f9
ignore-check-redirect-uri: true
DINGTALK: # 钉钉
client-id: dingvrnreaje3yqvzhxg
client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI
ignore-check-redirect-uri: true
WECHAT_ENTERPRISE: # 企业微信
client-id: wwd411c69a39ad2e54
client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
agent-id: 1000004
ignore-check-redirect-uri: true
cache:
type: REDIS
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟

8
yudao-server/src/main/resources/application.yaml

@ -135,13 +135,11 @@ yudao:
debug: false
yshop:
bxg:
# 配置
version: 3.2
apiUrl: http://127.0.0.1:8009/api
security:
jwt-key: yshopmini
token-expired-in: 86400000
jwt-key: bxg
token-expired-in: 30
# sm.ms 图床的 token
smms:

2
yudao-server/src/main/resources/logback-spring.xml

@ -65,7 +65,7 @@
</root>
</springProfile>
<!-- 其它环境 -->
<springProfile name="dev,default">
<springProfile name="dev,default,prod">
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="ASYNC"/>

6
zsw-bxg/src/main/java/co/yixiang/app/common/util/JwtToken.java

@ -36,12 +36,12 @@ public class JwtToken {
private static Integer expiredTimeIn;
private static Integer defaultScope = 8;
@Value("${yshop.security.jwt-key}")
@Value("${bxg.security.jwt-key}")
public void setJwtKey(String jwtKey) {
JwtToken.jwtKey = jwtKey;
}
@Value("${yshop.security.token-expired-in}")
@Value("${bxg.security.token-expired-in}")
public void setExpiredTimeIn(Integer expiredTimeIn) {
JwtToken.expiredTimeIn = expiredTimeIn;
}
@ -99,7 +99,7 @@ public class JwtToken {
Map<String, Date> map = new HashMap<>();
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
calendar.add(Calendar.SECOND, JwtToken.expiredTimeIn);
calendar.add(Calendar.DATE, JwtToken.expiredTimeIn);
map.put("now", now);
map.put("expiredTime", calendar.getTime());
return map;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java

@ -11,7 +11,7 @@ package co.yixiang.app.modules.activity.rest;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.aop.NoRepeatSubmit;
import co.yixiang.app.common.bean.LocalUser;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreCombinationController.java

@ -10,7 +10,7 @@ package co.yixiang.app.modules.activity.rest;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.bean.LocalUser;
import co.yixiang.app.modules.activity.param.PinkCancelParam;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreSeckillController.java

@ -11,7 +11,7 @@ package co.yixiang.app.modules.activity.rest;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.logging.aop.log.AppLog;
import co.yixiang.app.common.bean.LocalUser;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/StoreIntegralController.java

@ -1,6 +1,6 @@
package co.yixiang.app.modules.activity.rest;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import co.yixiang.modules.product.param.YxStoreProductQueryParam;
import co.yixiang.modules.product.service.YxStoreProductService;
import co.yixiang.modules.product.vo.YxStoreProductQueryVo;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/auth/rest/LetterAppAuthController.java

@ -12,7 +12,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.enums.SmsTypeEnum;
import co.yixiang.app.common.util.JwtToken;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java

@ -9,7 +9,7 @@
package co.yixiang.app.modules.cart.rest;
import co.yixiang.annotation.Limit;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import co.yixiang.app.common.aop.NoRepeatSubmit;
import co.yixiang.app.common.bean.LocalUser;
import co.yixiang.app.modules.cart.param.CartIdsParm;

4
zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java

@ -9,7 +9,7 @@
package co.yixiang.app.modules.coupon.rest;
import cn.hutool.core.util.NumberUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.logging.aop.log.AppLog;
import co.yixiang.app.common.aop.NoRepeatSubmit;
@ -87,7 +87,7 @@ public class CouponController {
public ApiResult<Boolean> receive(@Validated @RequestBody YxStoreCouponQueryParam param){
Long uid = LocalUser.getUser().getUid();
if(!NumberUtil.isNumber(param.getCouponId())){
throw new YshopException("参数非法");
throw new YshopException("参数错误哦");
}
Integer couponId = Integer.valueOf(param.getCouponId());
couponIssueService.issueUserCoupon(couponId,uid);

2
zsw-bxg/src/main/java/co/yixiang/app/modules/manage/rest/ShoperController.java

@ -10,7 +10,7 @@ package co.yixiang.app.modules.manage.rest;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.modules.order.param.OrderDeliveryParam;
import co.yixiang.app.modules.order.param.OrderRefundParam;

10
zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java

@ -11,8 +11,7 @@ package co.yixiang.app.modules.order.rest;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.qrcode.QrCodeUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.aop.NoRepeatSubmit;
import co.yixiang.app.common.bean.LocalUser;
@ -21,7 +20,6 @@ import co.yixiang.app.modules.order.param.ExpressParam;
import co.yixiang.app.modules.services.CreatShareProductService;
import co.yixiang.app.modules.services.OrderSupplyService;
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;
import co.yixiang.constant.SystemConfigConstants;
import co.yixiang.enums.*;
import co.yixiang.logging.aop.log.AppLog;
import co.yixiang.modules.mp.domain.YxWechatTemplate;
@ -39,7 +37,6 @@ import co.yixiang.modules.order.vo.ComputeVo;
import co.yixiang.modules.order.vo.ConfirmOrderVo;
import co.yixiang.modules.order.vo.OrderCartInfoVo;
import co.yixiang.modules.order.vo.YxStoreOrderQueryVo;
import co.yixiang.modules.shop.service.YxSystemConfigService;
import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.tools.express.ExpressService;
import co.yixiang.tools.express.config.ExpressAutoConfiguration;
@ -51,17 +48,12 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.imageio.ImageIO;
import javax.validation.Valid;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedHashMap;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreCategoryController.java

@ -9,7 +9,7 @@
package co.yixiang.app.modules.product.rest;
import co.yixiang.annotation.AnonymousAccess;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import co.yixiang.modules.category.service.YxStoreCategoryService;
import co.yixiang.utils.CateDTO;
import io.swagger.annotations.Api;

16
zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreProductController.java

@ -10,12 +10,9 @@ package co.yixiang.app.modules.product.rest;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.qrcode.QrCodeUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.aop.NoRepeatSubmit;
import co.yixiang.app.common.bean.LocalUser;
@ -38,7 +35,6 @@ import co.yixiang.modules.product.vo.ProductVo;
import co.yixiang.modules.product.vo.ReplyCountVo;
import co.yixiang.modules.product.vo.YxStoreProductQueryVo;
import co.yixiang.modules.product.vo.YxStoreProductReplyQueryVo;
import co.yixiang.modules.shop.domain.YxSystemAttachment;
import co.yixiang.modules.shop.service.YxSystemAttachmentService;
import co.yixiang.modules.shop.service.YxSystemConfigService;
import co.yixiang.modules.user.domain.YxUser;
@ -50,14 +46,10 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.imageio.ImageIO;
import java.awt.FontFormatException;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.LinkedHashMap;
@ -219,7 +211,7 @@ public class AppStoreProductController {
public ApiResult<Boolean> collectAdd(@Validated @RequestBody YxStoreProductRelationQueryParam param){
long uid = LocalUser.getUser().getUid();
if(!NumberUtil.isNumber(param.getId())) {
throw new YshopException("参数非法");
throw new YshopException("参数错误哦");
}
productRelationService.addRroductRelation(Long.valueOf(param.getId()),uid,param.getCategory());
return ApiResult.ok();
@ -236,7 +228,7 @@ public class AppStoreProductController {
public ApiResult<Boolean> collectDel(@Validated @RequestBody YxStoreProductRelationQueryParam param){
long uid = LocalUser.getUser().getUid();
if(!NumberUtil.isNumber(param.getId())) {
throw new YshopException("参数非法");
throw new YshopException("参数错误哦");
}
productRelationService.delRroductRelation(Long.valueOf(param.getId()),
uid,param.getCategory());
@ -253,7 +245,7 @@ public class AppStoreProductController {
@ApiOperation(value = "删除足跡",notes = "删除足跡")
public ApiResult<Boolean> collectDelFoot(@Validated @RequestBody CollectDelFootParam param){
if (CollectionUtil.isEmpty(param.getIds())){
throw new YshopException("参数非法");
throw new YshopException("参数错误哦");
}
productRelationService.collectDelFoot(param.getIds());
return ApiResult.ok();

2
zsw-bxg/src/main/java/co/yixiang/app/modules/services/AppAuthService.java

@ -63,7 +63,7 @@ public class AppAuthService {
private static Integer expiredTimeIn;
private final YxSystemAttachmentService systemAttachmentService;
@Value("${yshop.security.token-expired-in}")
@Value("${bxg.security.token-expired-in}")
public void setExpiredTimeIn(Integer expiredTimeIn) {
AppAuthService.expiredTimeIn = expiredTimeIn;
}

3
zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/ArticleController.java

@ -8,7 +8,7 @@
*/
package co.yixiang.app.modules.shop.rest;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import co.yixiang.modules.mp.service.YxArticleService;
import co.yixiang.modules.mp.vo.YxArticleQueryVo;
import io.swagger.annotations.Api;
@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collections;
import java.util.List;
/**

2
zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/IndexController.java

@ -10,7 +10,7 @@ package co.yixiang.app.modules.shop.rest;
import cn.hutool.core.io.file.FileReader;
import cn.hutool.core.io.resource.ClassPathResource;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.constant.ShopConstants;
import co.yixiang.enums.ProductEnum;

4
zsw-bxg/src/main/java/co/yixiang/app/rest/AppStoreAfterSalesController.java → zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/AppStoreAfterSalesController.java

@ -1,8 +1,8 @@
package co.yixiang.app.rest;
package co.yixiang.app.modules.user.rest;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.bean.LocalUser;
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/AppUserBillController.java

@ -10,7 +10,7 @@ package co.yixiang.app.modules.user.rest;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.bean.LocalUser;
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/AppUserExtractController.java

@ -9,7 +9,7 @@
package co.yixiang.app.modules.user.rest;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import co.yixiang.app.common.bean.LocalUser;
import co.yixiang.logging.aop.log.AppLog;
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/AppUserRechargeController.java

@ -9,7 +9,7 @@
package co.yixiang.app.modules.user.rest;
import cn.hutool.core.bean.BeanUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.bean.LocalUser;
import co.yixiang.app.modules.user.param.RechargeParam;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/LetterAppUserController.java

@ -9,7 +9,7 @@
package co.yixiang.app.modules.user.rest;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import co.yixiang.app.common.aop.NoRepeatSubmit;
import co.yixiang.app.common.bean.LocalUser;
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;

4
zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/UserAddressController.java

@ -10,7 +10,7 @@ package co.yixiang.app.modules.user.rest;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.bean.LocalUser;
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;
@ -147,7 +147,7 @@ public class UserAddressController {
@ApiOperation(value = "地址详情",notes = "地址详情")
public ApiResult<YxUserAddressQueryVo> addressDetail(@PathVariable String id){
if(StrUtil.isBlank(id) || !NumberUtil.isNumber(id)){
throw new YshopException("参数非法");
throw new YshopException("参数错误哦");
}
return ApiResult.ok(userAddressService.getDetail(Long.valueOf(id)));
}

4
zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/UserLevelController.java

@ -11,7 +11,7 @@ package co.yixiang.app.modules.user.rest;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.bean.LocalUser;
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;
@ -64,7 +64,7 @@ public class UserLevelController {
@ApiOperation(value = "获取等级任务",notes = "获取等级任务")
public ApiResult<Object> getTask(@PathVariable String id){
if(StrUtil.isBlank(id) || !NumberUtil.isNumber(id)){
throw new YshopException("参数非法");
throw new YshopException("参数错误哦");
}
Long uid = LocalUser.getUser().getUid();
return ApiResult.ok(systemUserTaskService.getTaskList(Integer.valueOf(id),uid));

2
zsw-bxg/src/main/java/co/yixiang/app/modules/wechat/rest/controller/WechatController.java

@ -10,7 +10,7 @@ package co.yixiang.app.modules.wechat.rest.controller;
import cn.binarywang.wx.miniapp.api.WxMaService;
import co.yixiang.annotation.AnonymousAccess;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import co.yixiang.constant.SystemConfigConstants;
import co.yixiang.enums.AfterSalesStatusEnum;
import co.yixiang.enums.BillDetailEnum;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/wechat/rest/controller/WechatLiveController.java

@ -9,7 +9,7 @@
package co.yixiang.app.modules.wechat.rest.controller;
import cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import co.yixiang.modules.mp.service.YxWechatLiveService;
import co.yixiang.modules.mp.service.dto.YxWechatLiveQueryCriteria;
import co.yixiang.modules.mp.vo.WechatLiveVo;

2
zsw-bxg/src/main/java/co/yixiang/app/modules/wechat/rest/controller/WxMaUserController.java

@ -11,7 +11,7 @@ package co.yixiang.app.modules.wechat.rest.controller;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.hutool.core.util.StrUtil;
import co.yixiang.api.ApiResult;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.YshopException;
import co.yixiang.app.common.bean.LocalUser;
import co.yixiang.app.modules.wechat.rest.param.BindPhoneParam;

6
zsw-bxg/src/main/java/co/yixiang/config/CachingConfigurer.java

@ -1,5 +1,7 @@
package co.yixiang.config;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
@ -24,6 +26,10 @@ public class CachingConfigurer extends CachingConfigurerSupport {
@Override
public KeyGenerator keyGenerator() {
return (target, method, params) -> {
Long tenantId = TenantContextHolder.getTenantId();
if (ObjectUtil.isNotEmpty(tenantId)){
return tenantId;
}
Map<String,Object> container = new HashMap<>(3);
Class<?> targetClassClass = target.getClass();
// 类地址

4
zsw-bxg/src/main/java/co/yixiang/config/StringKeyRedisSerializer.java

@ -33,7 +33,7 @@ public class StringKeyRedisSerializer implements RedisSerializer<Object> {
return null;
}
log.info("redis serialize:{}",string);
// log.info("redis serialize:{}",string);
string = string.replace("\"", "");
if (ObjectUtil.isNotEmpty(TenantContextHolder.getTenantId())){
string = StrUtil.format("{}_{}",TenantContextHolder.getTenantId().toString(),string);
@ -44,7 +44,7 @@ public class StringKeyRedisSerializer implements RedisSerializer<Object> {
@Override
public Object deserialize(byte[] bytes) throws SerializationException {
String rs = (bytes == null ? null : new String(bytes));
log.info("redis deserialize:{}",rs);
// log.info("redis deserialize:{}",rs);
return rs;
}
}

5
zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java

@ -72,9 +72,6 @@ import java.util.stream.Collectors;
@SuppressWarnings("unchecked")
public class StoreOrderController {
@Value("${yshop.apiUrl}")
private String apiUrl;
private final IGenerator generator;
private final YxStoreOrderService yxStoreOrderService;
private final YxStoreOrderStatusService yxStoreOrderStatusService;
@ -390,7 +387,7 @@ public class StoreOrderController {
String orderType){
//默认查询所有快递订单
criteria.setShippingType(OrderInfoEnum.SHIPPIING_TYPE_1.getValue());
// criteria.setShippingType(OrderInfoEnum.SHIPPIING_TYPE_1.getValue());
//订单状态查询
if (StrUtil.isNotEmpty(orderStatus)) {
switch (orderStatus) {

2
zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java

@ -127,7 +127,7 @@ public class YxUserRechargeServiceImpl extends BaseServiceImpl<UserRechargeMappe
@Override
public String addRecharge(YxUser user,String price,String paidPrice) {
if(StrUtil.isBlank(price) || StrUtil.isBlank(paidPrice)){
throw new YshopException("参数非法");
throw new YshopException("参数错误哦");
}
YxUserRecharge yxUserRecharge = new YxUserRecharge();

Loading…
Cancel
Save