diff --git a/README.md b/README.md index e6be9b11..08e48ec5 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,13 @@ gitee:https://gitee.com/gz-yami/mall4cloud/tree/master/doc +本项目是一个极度遵守阿里巴巴代码规约的项目,以下是代码规约扫描结果 + + +![阿里代码规约扫描结果](./doc/阿里代码规约扫描结果.png) + +具体目录结构和代码规范,可以查看 https://gitee.com/gz-yami/mall4cloud/tree/master/doc/%E4%BB%A3%E7%A0%81%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84 + ### 授权 除开源版本外,本商城还提供商业版本的B2B2C商城,采用PC+小程序+APP,欲知详情,请访问官网。 @@ -109,4 +116,4 @@ H5端:https://h5.mall4j.com/cloud ## 你的点赞鼓励,是我们前进的动力~ ## 你的点赞鼓励,是我们前进的动力~ -## 你的点赞鼓励,是我们前进的动力~ \ No newline at end of file +## 你的点赞鼓励,是我们前进的动力~ diff --git "a/doc/img/\351\230\277\351\207\214\344\273\243\347\240\201\350\247\204\347\272\246\346\211\253\346\217\217\347\273\223\346\236\234.png" "b/doc/img/\351\230\277\351\207\214\344\273\243\347\240\201\350\247\204\347\272\246\346\211\253\346\217\217\347\273\223\346\236\234.png" new file mode 100644 index 00000000..530be40d Binary files /dev/null and "b/doc/img/\351\230\277\351\207\214\344\273\243\347\240\201\350\247\204\347\272\246\346\211\253\346\217\217\347\273\223\346\236\234.png" differ diff --git "a/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/README.md" "b/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/README.md" new file mode 100644 index 00000000..05b45374 --- /dev/null +++ "b/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/README.md" @@ -0,0 +1,6 @@ +`mall4cloud`是一个前后端分离的项目,所以由多个项目组成,如下: + +- `mall4cloud` : java微服务后台代码(包含后台、前端、所有微服务相关的接口) +- `mall4cloud-multishop` : 商家端vue代码 +- `mall4cloud-platform` : 平台端vue代码 +- `mall4cloud-uniapp` : 移动端uniapp代码(包含 H5、小程序、android、ios) diff --git "a/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/mall4cloud-multishop\343\200\201mall4cloud-platform\347\233\256\345\275\225\347\273\223\346\236\204.md" "b/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/mall4cloud-multishop\343\200\201mall4cloud-platform\347\233\256\345\275\225\347\273\223\346\236\204.md" new file mode 100644 index 00000000..9e5d0f1d --- /dev/null +++ "b/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/mall4cloud-multishop\343\200\201mall4cloud-platform\347\233\256\345\275\225\347\273\223\346\236\204.md" @@ -0,0 +1,37 @@ +后台基础框架采用使用mit开源协议的 `vue-element-admin` + +具体可以查看 [vue-element-admin 介绍](https://panjiachen.gitee.io/vue-element-admin-site/zh/guide/) + +https://panjiachen.gitee.io/vue-element-admin-site/zh/guide/ + +``` +├── build # 构建相关 +├── public # 静态资源 +│ │── favicon.ico # favicon图标 +│ └── index.html # html模板 +├── src # 源代码 +│ ├── api # 所有请求(根据不同后台不同的服务分包) +│ ├── assets # 主题 字体等静态资源 +│ ├── components # 全局公用组件 +│ ├── directive # 全局指令 +│ ├── filters # 全局 filter +│ ├── icons # 项目所有 svg icons +│ ├── lang # 国际化 language +│ ├── layout # 全局 layout +│ ├── router # 路由 +│ ├── store # 全局 store管理 +│ ├── styles # 全局样式 +│ ├── utils # 全局公用方法 +│ ├── views # views 所有页面 +│ ├── App.vue # 入口页面 +│ ├── main.js # 入口文件 加载组件 初始化等 +│ └── permission.js # 权限管理 +├── tests # 测试 +├── .env.xxx # 环境变量配置 +├── .eslintrc.js # eslint 配置项 +├── .babelrc # babel-loader 配置 +├── .travis.yml # 自动化CI配置 +├── vue.config.js # vue-cli 配置 +├── postcss.config.js # postcss 配置 +└── package.json # package.json +``` diff --git "a/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/mall4cloud-uniapp\347\233\256\345\275\225\347\273\223\346\236\204.md" "b/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/mall4cloud-uniapp\347\233\256\345\275\225\347\273\223\346\236\204.md" new file mode 100644 index 00000000..f8e0bd51 --- /dev/null +++ "b/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/mall4cloud-uniapp\347\233\256\345\275\225\347\273\223\346\236\204.md" @@ -0,0 +1,31 @@ +``` +├── public # 公共文件目录 +│ └── index.html # html模版 +├── src # 源代码 +│ ├── components # 公共组件 +│ ├── js_sdk # uniapp第三方插件目录 +│ ├── packageActivities # 活动功能分包 +│ ├── packageShop # 店铺功能分包 +│ ├── pages # 主包 +│ ├── static # 静态资源 +│ │ │── empty-img # 提示图片 +│ │ │── images # 各页面的图片资源 +│ │ └── tabbar # 底部tab栏的图标 +│ ├── utils # 存放通用工具 +│ ├── wxs # wxs文件目录 +│ ├── app.css # 全局样式 +│ ├── App.vue # 入口页面 +│ ├── main.js # 初始化入口文件 +│ ├── mainfest.json # uniapp项目配置文件 +│ ├── pages.json # 全局页面配置文件 +│ ├── popup.css # 公共弹窗css样式 +│ ├── router.js # 导航路由 +│ └── uni.scss # uni-app内置的常用样式变量 +├── .eslintignore # eslint忽略配置 +├── .eslintrc.js # eslint规则制定文件 +├── babel.config.js # babel配置 +├── package-lock.json # 锁定安装时包的版本号 +├── package.json # package.json 项目基本信息 +├── postcss.config # postcss配置文件 +└── vue.config.js # vue-cli 配置 +``` diff --git "a/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/mall4cloud\347\233\256\345\275\225\347\273\223\346\236\204.md" "b/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/mall4cloud\347\233\256\345\275\225\347\273\223\346\236\204.md" new file mode 100644 index 00000000..5cc84d00 --- /dev/null +++ "b/doc/\344\273\243\347\240\201\347\233\256\345\275\225\347\273\223\346\236\204/mall4cloud\347\233\256\345\275\225\347\273\223\346\236\204.md" @@ -0,0 +1,89 @@ +> 为了让项目更加方便检测出代码规范的问题,我们在项目中使用的是阿里的规范(详细可以看https://github.com/alibaba/p3c 这里面的[Java开发手册(嵩山版).pdf](https://github.com/alibaba/p3c/blob/master/Java开发手册(嵩山版).pdf)),同时使用 `Alibaba Java Coding Guidelines` 这款插件进行规约扫描 + + + +我们先来看下规范当中的目录结构 + +![](../img/目录结构和规范/阿里应用分层.png) + +- 开放 API 层:可直接封装 Service 接口暴露成 RPC 接口;通过 Web 封装成 http 接口;网关控制层等。 +- 终端显示层:各个端的模板渲染并执行显示的层。当前主要是 velocity 渲染,JS 渲染,JSP 渲染,移 动端展示等。 +- Web 层:主要是对访问控制进行转发,各类基本参数校验,或者不复用的业务简单处理等。 +- Service 层:相对具体的业务逻辑服务层。 +- Manager 层:通用业务处理层,它有如下特征: + - 1) 对第三方平台封装的层,预处理返回结果及转化异常信息,适配上层接口。 + - 2) 对 Service 层通用能力的下沉,如缓存方案、中间件通用处理。 + - 3) 与 DAO 层交互,对多个 DAO 的组合复用。 +- DAO 层:数据访问层,与底层 MySQL、Oracle、Hbase、OB 等进行数据交互。 +- 第三方服务:包括其它部门 RPC 服务接口,基础平台,其它公司的 HTTP 接口,如淘宝开放平台、支 付宝付款服务、高德地图服务等。 +- 外部数据接口:外部(应用)数据存储服务提供的接口,多见于数据迁移场景中。 + + + +------ + +以上是阿里规范当中的目录结构,我们也有自己的目录结构 + +![](../img/目录结构和规范/应用分层.png) + +- VO(View Object):显示层对象,通常是 Web 向模板渲染引擎层传输的对象。 +- DTO(Data Transfer Object):数据传输对象,前端像后台进行传输的对象,类似于param。 +- BO(Business Object):业务对象,内部业务对象,只在内部传递,不对外进行传递。 +- Model:模型层,此对象与数据库表结构一一对应,通过 Mapper 层向上传输数据源对象。 +- Controller:主要是对外部访问控制进行转发,各类基本参数校验,或者不复用的业务简单处理等。为了简单起见,一些与事务无关的代码也在这里编写。 +- FeignClient:由于微服务之间存在互相调用,这里是内部请求的接口。 +- Controller:主要是对内部访问控制进行转发,各类基本参数校验,或者不复用的业务简单处理等。为了简单起见,一些与事务无关的代码也在这里编写。 +- Service 层:相对具体的业务逻辑服务层。 +- Manager 层:通用业务处理层,它有如下特征: + - 1) 对第三方平台封装的层,预处理返回结果及转化异常信息,适配上层接口。 + - 2) 对 Service 层通用能力的下沉,如缓存方案、中间件通用处理。 + - 3) 与 DAO 层交互,对多个 DAO 的组合复用。 +- Mapper持久层:数据访问层,与底层 MySQL进行数据交互。 +- Task层:由于每个服务之间会存在定时任务,比如定时确认收货,定时将活动失效等情况,这里面的Task实际上连接的是`xxl-job`(具体可以查看 https://github.com/xuxueli/xxl-job )进行任务调度。 +- Listener:监听 `RocketMQ` 进行处理,有时候会监听`easyexcel`相关数据。 + + + +关于`FeignClient`,由于微服务之间存在互相调用,`Feign` 是http协议,理论上是为了解耦,而实际上提供方接口进行修改,调用方却没有进行修改的时候,会造成异常,所以我们抽取出来。还有就是对内暴露的接口,是很多地方都公用的,所以我们还将接口抽取了出了一个模块,方便引用。可以看到`mall4cloud-api`这个模块下是所有对内`feign`接口的信息。 + + + + + +## 目录结构 + +``` +mall4cloud +├─mall4cloud-api -- 内网接口 +│ ├─mall4cloud-api-auth -- 授权对内接口 +│ ├─mall4cloud-api-biz -- biz对内接口 +│ ├─mall4cloud-api-leaf -- 美团分布式id生成接口 +│ ├─mall4cloud-api-multishop -- 店铺对内接口 +│ ├─mall4cloud-api-order -- 订单对内接口 +│ ├─mall4cloud-api-platform -- 平台对内接口 +│ ├─mall4cloud-api-product -- 商品对内接口 +│ ├─mall4cloud-api-rbac -- 用户角色权限对内接口 +│ ├─mall4cloud-api-search -- 搜索对内接口 +│ └─mall4cloud-api-user -- 用户对内接口 +├─mall4cloud-auth -- 授权校验模块 +├─mall4cloud-biz -- mall4cloud 业务代码。如图片上传/短信等 +├─mall4cloud-common -- 一些公共的方法 +│ ├─mall4cloud-common-cache -- 缓存相关公共代码 +│ ├─mall4cloud-common-core -- 公共模块核心(公共中的公共代码) +│ ├─mall4cloud-common-database -- 数据库连接相关公共代码 +│ ├─mall4cloud-common-order -- 订单相关公共代码 +│ ├─mall4cloud-common-product -- 商品相关公共代码 +│ ├─mall4cloud-common-rocketmq -- rocketmq相关公共代码 +│ └─mall4cloud-common-security -- 安全相关公共代码 +├─mall4cloud-gateway -- 网关 +├─mall4cloud-group -- 团购服务 +├─mall4cloud-leaf -- 基于美团leaf的生成id服务 +├─mall4cloud-multishop -- 商家端 +├─mall4cloud-order -- 订单服务 +├─mall4cloud-payment -- 支付服务 +├─mall4cloud-platform -- 平台端 +├─mall4cloud-product -- 商品服务 +├─mall4cloud-rbac -- 用户角色权限模块 +├─mall4cloud-search -- 搜索模块 +└─mall4cloud-user -- 用户服务 +``` diff --git a/mall4cloud-api/mall4cloud-api-multishop/src/main/java/com/mall4j/cloud/api/multishop/feign/IndexImgFeignClient.java b/mall4cloud-api/mall4cloud-api-multishop/src/main/java/com/mall4j/cloud/api/multishop/feign/IndexImgFeignClient.java index ff8799d8..cf7dacf1 100644 --- a/mall4cloud-api/mall4cloud-api-multishop/src/main/java/com/mall4j/cloud/api/multishop/feign/IndexImgFeignClient.java +++ b/mall4cloud-api/mall4cloud-api-multishop/src/main/java/com/mall4j/cloud/api/multishop/feign/IndexImgFeignClient.java @@ -16,6 +16,8 @@ public interface IndexImgFeignClient { /** * 根据商品d删除轮播图信息 * @param spuId 商品id + * @param shopId 店鋪id + * @return void */ @GetMapping(value = FeignInsideAuthConfig.FEIGN_INSIDE_URL_PREFIX + "/insider/indexImg/deleteBySpuId") ServerResponseEntity deleteBySpuId(@RequestParam("spuId") Long spuId, @RequestParam("shopId") Long shopId); diff --git a/mall4cloud-api/mall4cloud-api-product/src/main/java/com/mall4j/cloud/api/product/manager/ShopCartAdapter.java b/mall4cloud-api/mall4cloud-api-product/src/main/java/com/mall4j/cloud/api/product/manager/ShopCartAdapter.java index 59084083..3266c8fb 100644 --- a/mall4cloud-api/mall4cloud-api-product/src/main/java/com/mall4j/cloud/api/product/manager/ShopCartAdapter.java +++ b/mall4cloud-api/mall4cloud-api-product/src/main/java/com/mall4j/cloud/api/product/manager/ShopCartAdapter.java @@ -3,7 +3,7 @@ import cn.hutool.core.collection.CollectionUtil; import com.google.common.collect.Lists; import com.mall4j.cloud.api.multishop.feign.ShopDetailFeignClient; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.api.product.dto.ShopCartItemDTO; import com.mall4j.cloud.api.product.feign.ShopCartFeignClient; import com.mall4j.cloud.api.product.feign.SpuFeignClient; @@ -113,7 +113,7 @@ public List conversionShopCart(List shopCartItems){ // 店铺信息 ServerResponseEntity shopNameResponse = shopDetailFeignClient.getShopNameByShopId(shopId); if (!shopNameResponse.isSuccess()) { - throw new mall4cloudException(shopNameResponse.getMsg()); + throw new Mall4cloudException(shopNameResponse.getMsg()); } shopCart.setShopName(shopNameResponse.getData()); shopCarts.add(shopCart); diff --git a/mall4cloud-auth/src/main/java/com/mall4j/cloud/auth/feign/AccountFeignController.java b/mall4cloud-auth/src/main/java/com/mall4j/cloud/auth/feign/AccountFeignController.java index a8d86ae8..41c5fb18 100644 --- a/mall4cloud-auth/src/main/java/com/mall4j/cloud/auth/feign/AccountFeignController.java +++ b/mall4cloud-auth/src/main/java/com/mall4j/cloud/auth/feign/AccountFeignController.java @@ -10,7 +10,7 @@ import com.mall4j.cloud.auth.manager.TokenStore; import com.mall4j.cloud.auth.mapper.AuthAccountMapper; import com.mall4j.cloud.auth.model.AuthAccount; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.security.AuthUserContext; @@ -53,7 +53,7 @@ public class AccountFeignController implements AccountFeignClient { public ServerResponseEntity save(AuthAccountDTO authAccountDTO) { ServerResponseEntity segmentIdResponse = segmentFeignClient.getSegmentId("mall4cloud-auth-account"); if (!segmentIdResponse.isSuccess()) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } ServerResponseEntity verify = verify(authAccountDTO); @@ -82,7 +82,7 @@ public ServerResponseEntity update(AuthAccountDTO authAccountDTO) { @Transactional(rollbackFor = Exception.class) public ServerResponseEntity updateAuthAccountStatus(AuthAccountDTO authAccountDTO) { if (Objects.isNull(authAccountDTO.getStatus())) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } AuthAccount authAccount = mapperFacade.map(authAccountDTO, AuthAccount.class); authAccountMapper.updateAccountInfo(authAccount); @@ -144,7 +144,7 @@ public ServerResponseEntity updateUserInfoByUserIdAndSysType(UserInfoInTok AuthAccount authAccount = mapperFacade.map(userInfoInTokenBO, AuthAccount.class); int res = authAccountMapper.updateUserInfoByUserId(authAccount, userId, sysType); if (res != 1) { - throw new mall4cloudException("用户信息错误,更新失败"); + throw new Mall4cloudException("用户信息错误,更新失败"); } return ServerResponseEntity.success(); } diff --git a/mall4cloud-auth/src/main/java/com/mall4j/cloud/auth/manager/TokenStore.java b/mall4cloud-auth/src/main/java/com/mall4j/cloud/auth/manager/TokenStore.java index f6efc50f..dc1e3b59 100644 --- a/mall4cloud-auth/src/main/java/com/mall4j/cloud/auth/manager/TokenStore.java +++ b/mall4cloud-auth/src/main/java/com/mall4j/cloud/auth/manager/TokenStore.java @@ -6,7 +6,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.symmetric.AES; import com.mall4j.cloud.common.cache.constant.CacheNames; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.security.bo.TokenInfoBO; import com.mall4j.cloud.api.auth.bo.UserInfoInTokenBO; @@ -308,7 +308,7 @@ public void updateUserInfoByUidAndAppId(Long uid, String appId, UserInfoInTokenB String uidKey = getUidToAccessKey(getApprovalKey(appId, uid)); Set tokenInfoBoList = stringRedisTemplate.opsForSet().members(uidKey); if (tokenInfoBoList == null || tokenInfoBoList.size() == 0) { - throw new mall4cloudException(ResponseEnum.UNAUTHORIZED); + throw new Mall4cloudException(ResponseEnum.UNAUTHORIZED); } for (String accessTokenWithRefreshToken : tokenInfoBoList) { String[] accessTokenWithRefreshTokenArr = accessTokenWithRefreshToken.split(StrUtil.COLON); diff --git a/mall4cloud-biz/src/main/java/com/mall4j/cloud/biz/config/MinioTemplate.java b/mall4cloud-biz/src/main/java/com/mall4j/cloud/biz/config/MinioTemplate.java index 50d86963..8c5c0b1d 100644 --- a/mall4cloud-biz/src/main/java/com/mall4j/cloud/biz/config/MinioTemplate.java +++ b/mall4cloud-biz/src/main/java/com/mall4j/cloud/biz/config/MinioTemplate.java @@ -1,6 +1,6 @@ package com.mall4j.cloud.biz.config; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ResponseEnum; import io.minio.*; import io.minio.http.Method; @@ -49,7 +49,7 @@ public String getPresignedObjectUrl(String objectName){ return presignedObjectUrl; } catch (Exception e) { e.printStackTrace(); - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } } } diff --git a/mall4cloud-biz/src/main/java/com/mall4j/cloud/biz/controller/multishop/AttachFileController.java b/mall4cloud-biz/src/main/java/com/mall4j/cloud/biz/controller/multishop/AttachFileController.java index 2134c45f..b7de43bc 100644 --- a/mall4cloud-biz/src/main/java/com/mall4j/cloud/biz/controller/multishop/AttachFileController.java +++ b/mall4cloud-biz/src/main/java/com/mall4j/cloud/biz/controller/multishop/AttachFileController.java @@ -7,7 +7,7 @@ import com.mall4j.cloud.biz.vo.AttachFileVO; import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -62,7 +62,7 @@ public ServerResponseEntity save(@RequestBody List attachFi public ServerResponseEntity updateFileName(@RequestBody AttachFileDTO attachFileDto) { if (Objects.isNull(attachFileDto.getFileName())) { // 图片名称不能为空 - throw new mall4cloudException("图片名称不能为空"); + throw new Mall4cloudException("图片名称不能为空"); } AttachFile attachFile = mapperFacade.map(attachFileDto, AttachFile.class); return ServerResponseEntity.success(attachFileService.updateFileName(attachFile)); diff --git a/mall4cloud-common/mall4cloud-common-cache/src/main/java/com/mall4j/cloud/common/cache/util/RedisUtil.java b/mall4cloud-common/mall4cloud-common-cache/src/main/java/com/mall4j/cloud/common/cache/util/RedisUtil.java index 4cee055c..32e41c58 100644 --- a/mall4cloud-common/mall4cloud-common-cache/src/main/java/com/mall4j/cloud/common/cache/util/RedisUtil.java +++ b/mall4cloud-common/mall4cloud-common-cache/src/main/java/com/mall4j/cloud/common/cache/util/RedisUtil.java @@ -3,7 +3,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.mall4j.cloud.common.cache.constant.CacheNames; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.util.SpringContextUtils; import org.slf4j.Logger; @@ -40,7 +40,7 @@ public class RedisUtil { */ public static Boolean expire(String key, long time) { if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } try { if (time > 0) { @@ -61,7 +61,7 @@ public static Boolean expire(String key, long time) { */ public static Long getExpire(String key) { if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } return REDIS_TEMPLATE.getExpire(key, TimeUnit.SECONDS); } @@ -73,7 +73,7 @@ public static Long getExpire(String key) { */ public static Boolean hasKey(String key) { if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } try { return REDIS_TEMPLATE.hasKey(key); @@ -93,7 +93,7 @@ public static void del(String... key) { if (key != null && key.length > 0) { for (String s : key) { if (s.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } } @@ -115,7 +115,7 @@ public static void del(String... key) { @SuppressWarnings("unchecked") public static T get(String key) { if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } return (T) REDIS_TEMPLATE.opsForValue().get(key); } @@ -129,7 +129,7 @@ public static T get(String key) { */ public static boolean set(String key, Object value, long time) { if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } try { if (time > 0) { @@ -154,7 +154,7 @@ public static boolean set(String key, Object value, long time) { */ public static Long incr(String key, long delta) { if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } if (delta < 0) { throw new RuntimeException("递增因子必须大于0"); @@ -170,7 +170,7 @@ public static Long incr(String key, long delta) { */ public static Long decr(String key, long delta) { if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } if (delta < 0) { throw new RuntimeException("递减因子必须小于0"); @@ -180,7 +180,7 @@ public static Long decr(String key, long delta) { public static boolean setLongValue(String key, Long value, long time) { if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } try { if (time > 0) { @@ -207,7 +207,7 @@ public static Long getLongValue(String key) { return null; } if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } String result = STRING_REDIS_TEMPLATE.opsForValue().get(key); if (result == null) { @@ -226,7 +226,7 @@ public static void deleteBatch(List keys) { } for (String key : keys) { if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } } REDIS_TEMPLATE.delete(keys); @@ -247,7 +247,7 @@ public static void deleteBatch(String cacheName, List cacheKeys) { String key = cacheName + CacheNames.UNION + cacheKey; keys.add(key); if (key.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } } REDIS_TEMPLATE.delete(keys); @@ -260,7 +260,7 @@ public static void deleteBatch(String cacheName, List cacheKeys) { public static boolean cad(String key, String value) { if (key.contains(StrUtil.SPACE) || value.contains(StrUtil.SPACE)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } String script = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end"; diff --git a/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/exception/mall4cloudException.java b/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/exception/Mall4cloudException.java similarity index 65% rename from mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/exception/mall4cloudException.java rename to mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/exception/Mall4cloudException.java index eec31ec1..cbff004b 100644 --- a/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/exception/mall4cloudException.java +++ b/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/exception/Mall4cloudException.java @@ -6,7 +6,7 @@ * @author FrozenWatermelon * @date 2020/7/11 */ -public class mall4cloudException extends RuntimeException { +public class Mall4cloudException extends RuntimeException { private static final long serialVersionUID = 1L; @@ -14,26 +14,26 @@ public class mall4cloudException extends RuntimeException { private ResponseEnum responseEnum; - public mall4cloudException(String msg) { + public Mall4cloudException(String msg) { super(msg); } - public mall4cloudException(String msg, Object object) { + public Mall4cloudException(String msg, Object object) { super(msg); this.object = object; } - public mall4cloudException(String msg, Throwable cause) { + public Mall4cloudException(String msg, Throwable cause) { super(msg, cause); } - public mall4cloudException(ResponseEnum responseEnum) { + public Mall4cloudException(ResponseEnum responseEnum) { super(responseEnum.getMsg()); this.responseEnum = responseEnum; } - public mall4cloudException(ResponseEnum responseEnum, Object object) { + public Mall4cloudException(ResponseEnum responseEnum, Object object) { super(responseEnum.getMsg()); this.responseEnum = responseEnum; this.object = object; diff --git a/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/handler/DefaultExceptionHandlerConfig.java b/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/handler/DefaultExceptionHandlerConfig.java index 8843b395..13fbe6cd 100644 --- a/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/handler/DefaultExceptionHandlerConfig.java +++ b/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/handler/DefaultExceptionHandlerConfig.java @@ -1,7 +1,7 @@ package com.mall4j.cloud.common.handler; import cn.hutool.core.util.StrUtil; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.response.ServerResponseEntity; import io.seata.core.context.RootContext; @@ -65,8 +65,8 @@ public ResponseEntity>> methodArgumentNotV .body(ServerResponseEntity.fail(ResponseEnum.HTTP_MESSAGE_NOT_READABLE)); } - @ExceptionHandler(mall4cloudException.class) - public ResponseEntity> mall4cloudExceptionHandler(mall4cloudException e) { + @ExceptionHandler(Mall4cloudException.class) + public ResponseEntity> mall4cloudExceptionHandler(Mall4cloudException e) { logger.error("mall4cloudExceptionHandler", e); ResponseEnum responseEnum = e.getResponseEnum(); diff --git a/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/handler/HttpHandler.java b/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/handler/HttpHandler.java index a5290cbf..09ccb1dd 100644 --- a/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/handler/HttpHandler.java +++ b/mall4cloud-common/mall4cloud-common-core/src/main/java/com/mall4j/cloud/common/handler/HttpHandler.java @@ -2,7 +2,7 @@ import cn.hutool.core.util.CharsetUtil; import com.fasterxml.jackson.databind.ObjectMapper; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.xss.XssUtil; import org.slf4j.Logger; @@ -55,7 +55,7 @@ public void printServerResponseToWeb(ServerResponseEntity serverResponseE printWriter.write(XssUtil.clean(objectMapper.writeValueAsString(serverResponseEntity))); } catch (IOException e) { - throw new mall4cloudException("io 异常", e); + throw new Mall4cloudException("io 异常", e); } } diff --git a/mall4cloud-common/mall4cloud-common-database/src/main/java/com/mall4j/cloud/common/database/interceptor/GeneratedKeyInterceptor.java b/mall4cloud-common/mall4cloud-common-database/src/main/java/com/mall4j/cloud/common/database/interceptor/GeneratedKeyInterceptor.java index 1155c29c..ca55f28f 100644 --- a/mall4cloud-common/mall4cloud-common-database/src/main/java/com/mall4j/cloud/common/database/interceptor/GeneratedKeyInterceptor.java +++ b/mall4cloud-common/mall4cloud-common-database/src/main/java/com/mall4j/cloud/common/database/interceptor/GeneratedKeyInterceptor.java @@ -2,7 +2,7 @@ import com.mall4j.cloud.api.leaf.feign.SegmentFeignClient; import com.mall4j.cloud.common.database.annotations.DistributedId; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.model.BaseModel; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.response.ServerResponseEntity; @@ -144,7 +144,7 @@ private void generatedKey(Object parameter) throws Throwable { field.set(parameter,segmentIdResponseEntity.getData()); } else { logger.error("can't get distributed id !!!! "); - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } } } diff --git a/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/controller/app/ShopDetailController.java b/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/controller/app/ShopDetailController.java index e4d44a0e..1e20d362 100644 --- a/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/controller/app/ShopDetailController.java +++ b/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/controller/app/ShopDetailController.java @@ -1,7 +1,7 @@ package com.mall4j.cloud.multishop.controller.app; import com.mall4j.cloud.api.multishop.vo.ShopDetailVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.multishop.service.ShopDetailService; import com.mall4j.cloud.multishop.vo.ShopHeadInfoVO; @@ -37,7 +37,7 @@ public ServerResponseEntity getShopHeadInfo(Long shopId) { ShopHeadInfoVO shopHeadInfoVO = new ShopHeadInfoVO(); ShopDetailVO shopDetailVO = shopDetailService.getByShopId(shopId); if (Objects.isNull(shopDetailVO)) { - throw new mall4cloudException("店铺不存在"); + throw new Mall4cloudException("店铺不存在"); } shopHeadInfoVO.setShopStatus(shopDetailVO.getShopStatus()); if (!Objects.equals(shopDetailVO.getShopStatus(), 1)) { diff --git a/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/controller/platform/ShopDetailController.java b/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/controller/platform/ShopDetailController.java index 1e309044..e716dd7c 100644 --- a/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/controller/platform/ShopDetailController.java +++ b/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/controller/platform/ShopDetailController.java @@ -4,7 +4,7 @@ import com.mall4j.cloud.common.constant.Constant; import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.security.AuthUserContext; @@ -40,7 +40,7 @@ public class ShopDetailController { @ApiOperation(value = "分页查询", notes = "分页查询") public ServerResponseEntity> getShopAuditingPage(PageDTO pageDTO, ShopDetailDTO shopDetailDTO) { if (!Objects.equals(Constant.PLATFORM_SHOP_ID, AuthUserContext.get().getTenantId())) { - throw new mall4cloudException(ResponseEnum.UNAUTHORIZED); + throw new Mall4cloudException(ResponseEnum.UNAUTHORIZED); } return ServerResponseEntity.success(shopDetailService.page(pageDTO, shopDetailDTO)); } diff --git a/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/service/impl/ShopDetailServiceImpl.java b/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/service/impl/ShopDetailServiceImpl.java index bbf377b1..c6c40fc5 100644 --- a/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/service/impl/ShopDetailServiceImpl.java +++ b/mall4cloud-multishop/src/main/java/com/mall4j/cloud/multishop/service/impl/ShopDetailServiceImpl.java @@ -18,7 +18,7 @@ import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.util.PageUtil; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.security.AuthUserContext; @@ -78,7 +78,7 @@ public PageVO page(PageDTO pageDTO, ShopDetailDTO shopDetailDTO) { public ShopDetailVO getByShopId(Long shopId) { ServerResponseEntity accountRes = accountFeignClient.getMerchantInfoByTenantId(shopId); if (!accountRes.isSuccess()) { - throw new mall4cloudException("商家信息获取失败"); + throw new Mall4cloudException("商家信息获取失败"); } AuthAccountVO authAccountVO = accountRes.getData(); ShopDetailVO shopDetailVO = shopDetailMapper.getByShopId(shopId); @@ -119,7 +119,7 @@ public PageVO shopSearchPage(PageDTO pageDTO, ShopDetailDTO sho Set spuIdSet = page.getList().stream().map(ShopDetailAppVO::getShopId).collect(Collectors.toSet()); ServerResponseEntity> spuResponse = searchSpuFeignClient.limitSizeListByShopIds(new ArrayList<>(spuIdSet), Constant.SPU_SIZE_FIVE); if (!Objects.equals(spuResponse.getCode(), ResponseEnum.OK.value())) { - throw new mall4cloudException(spuResponse.getMsg()); + throw new Mall4cloudException(spuResponse.getMsg()); } else if (CollectionUtil.isEmpty(spuResponse.getData())) { return page; } @@ -169,7 +169,7 @@ public void createShop(ShopDetailDTO shopDetailDTO) { checkShopInfo(shopDetailDTO); UserInfoInTokenBO userInfoInTokenBO = AuthUserContext.get(); if (Objects.nonNull(userInfoInTokenBO.getTenantId())) { - throw new mall4cloudException("该用户已经创建过店铺"); + throw new Mall4cloudException("该用户已经创建过店铺"); } // 保存店铺 ShopDetail shopDetail = mapperFacade.map(shopDetailDTO, ShopDetail.class); @@ -197,7 +197,7 @@ public void createShop(ShopDetailDTO shopDetailDTO) { userInfoInTokenBO.setTenantId(shopDetail.getShopId()); ServerResponseEntity updateTenantIdRes = accountFeignClient.updateUserInfoByUserIdAndSysType(userInfoInTokenBO, AuthUserContext.get().getUserId(), SysTypeEnum.ORDINARY.value()); if (!Objects.equals(updateTenantIdRes.getCode(), ResponseEnum.OK.value())) { - throw new mall4cloudException(updateTenantIdRes.getMsg()); + throw new Mall4cloudException(updateTenantIdRes.getMsg()); } } @@ -222,23 +222,23 @@ private void checkShopInfo(ShopDetailDTO shopDetailDTO) { shopDetailDTO.setShopName(shopDetailDTO.getShopName().trim()); } if(shopDetailMapper.countShopName(shopDetailDTO.getShopName(), null) > 0) { - throw new mall4cloudException("店铺名称已存在"); + throw new Mall4cloudException("店铺名称已存在"); } String username = shopDetailDTO.getUsername(); // 用户名 if (!PrincipalUtil.isUserName(username)) { - throw new mall4cloudException("用户名格式不正确"); + throw new Mall4cloudException("用户名格式不正确"); } ServerResponseEntity accountResponse = accountFeignClient.getByUsernameAndSysType(username, SysTypeEnum.MULTISHOP); if (!Objects.equals(accountResponse.getCode(), ResponseEnum.OK.value())) { - throw new mall4cloudException(accountResponse.getMsg()); + throw new Mall4cloudException(accountResponse.getMsg()); } AuthAccountVO authAccountVO = accountResponse.getData(); if (Objects.nonNull(authAccountVO)) { - throw new mall4cloudException("用户账号已存在"); + throw new Mall4cloudException("用户账号已存在"); } } @@ -266,7 +266,7 @@ public void createShopAccount(ShopDetailDTO shopDetailDTO, StatusEnum statusEnum authAccountDTO.setIsAdmin(UserAdminType.ADMIN.value()); ServerResponseEntity save = accountFeignClient.save(authAccountDTO); if (!Objects.equals(save.getCode(), ResponseEnum.OK.value())) { - throw new mall4cloudException(save.getMsg()); + throw new Mall4cloudException(save.getMsg()); } } } diff --git a/mall4cloud-order/src/main/java/com/mall4j/cloud/order/listener/OrderNotifyConsumer.java b/mall4cloud-order/src/main/java/com/mall4j/cloud/order/listener/OrderNotifyConsumer.java index 46df7532..f6c2977a 100644 --- a/mall4cloud-order/src/main/java/com/mall4j/cloud/order/listener/OrderNotifyConsumer.java +++ b/mall4cloud-order/src/main/java/com/mall4j/cloud/order/listener/OrderNotifyConsumer.java @@ -1,6 +1,6 @@ package com.mall4j.cloud.order.listener; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.order.bo.PayNotifyBO; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.rocketmq.config.RocketMqConstant; @@ -40,7 +40,7 @@ public void onMessage(PayNotifyBO message) { // 发送消息,订单支付成功 通知库存扣减 SendStatus sendStockStatus = orderNotifyStockTemplate.syncSend(RocketMqConstant.ORDER_NOTIFY_STOCK_TOPIC, new GenericMessage<>(message)).getSendStatus(); if (!Objects.equals(sendStockStatus,SendStatus.SEND_OK)) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } } } diff --git a/mall4cloud-order/src/main/java/com/mall4j/cloud/order/service/impl/OrderServiceImpl.java b/mall4cloud-order/src/main/java/com/mall4j/cloud/order/service/impl/OrderServiceImpl.java index 9a817c1d..509944b5 100644 --- a/mall4cloud-order/src/main/java/com/mall4j/cloud/order/service/impl/OrderServiceImpl.java +++ b/mall4cloud-order/src/main/java/com/mall4j/cloud/order/service/impl/OrderServiceImpl.java @@ -12,7 +12,7 @@ import com.mall4j.cloud.api.product.dto.SkuStockLockDTO; import com.mall4j.cloud.api.product.feign.ShopCartFeignClient; import com.mall4j.cloud.api.product.feign.SkuStockLockFeignClient; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.order.vo.ShopCartItemVO; import com.mall4j.cloud.common.order.vo.ShopCartOrderMergerVO; import com.mall4j.cloud.common.order.vo.ShopCartOrderVO; @@ -103,13 +103,13 @@ public List submit(Long userId, ShopCartOrderMergerVO mergerOrder) { ServerResponseEntity lockStockResponse = skuStockLockFeignClient.lock(skuStockLocks); // 锁定不成,抛异常,让回滚订单 if (!lockStockResponse.isSuccess()) { - throw new mall4cloudException(lockStockResponse.getMsg()); + throw new Mall4cloudException(lockStockResponse.getMsg()); } // 发送消息,如果三十分钟后没有支付,则取消订单 SendStatus sendStatus = orderCancelTemplate.syncSend(RocketMqConstant.ORDER_CANCEL_TOPIC, new GenericMessage<>(orderIds), RocketMqConstant.TIMEOUT, RocketMqConstant.CANCEL_ORDER_DELAY_LEVEL).getSendStatus(); if (!Objects.equals(sendStatus,SendStatus.SEND_OK)) { // 消息发不出去就抛异常,发的出去无所谓 - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } return orderIds; } @@ -170,7 +170,7 @@ public void cancelOrderAndGetCancelOrderIds(List orderIds) { SendStatus stockSendStatus = stockMqTemplate.syncSend(RocketMqConstant.STOCK_UNLOCK_TOPIC, new GenericMessage<>(orderIds)).getSendStatus(); if (!Objects.equals(stockSendStatus,SendStatus.SEND_OK)) { // 消息发不出去就抛异常,发的出去无所谓 - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } } @@ -179,7 +179,7 @@ public Order getOrderByOrderIdAndUserId(Long orderId, Long userId) { Order order = orderMapper.getOrderByOrderIdAndUserId(orderId, userId); if (order == null) { // 订单不存在 - throw new mall4cloudException(ResponseEnum.ORDER_NOT_EXIST); + throw new Mall4cloudException(ResponseEnum.ORDER_NOT_EXIST); } return order; } @@ -189,7 +189,7 @@ public OrderVO getOrderByOrderId(Long orderId) { Order order = orderMapper.getOrderByOrderIdAndShopId(orderId, AuthUserContext.get().getTenantId()); if (order == null) { // 订单不存在 - throw new mall4cloudException(ResponseEnum.ORDER_NOT_EXIST); + throw new Mall4cloudException(ResponseEnum.ORDER_NOT_EXIST); } return mapperFacade.map(order, OrderVO.class); } @@ -242,7 +242,7 @@ public List saveOrder(Long userId, ShopCartOrderMergerVO mergerOrder) { // 地址信息 if (Objects.isNull(orderAddr)) { // 请填写收货地址 - throw new mall4cloudException("请填写收货地址"); + throw new Mall4cloudException("请填写收货地址"); } // 保存收货地址 orderAddrService.save(orderAddr); @@ -294,7 +294,7 @@ private OrderItem getOrderItem(Order order, ShopCartItemVO shopCartItem) { private Order getOrder(Long userId, Integer dvyType, ShopCartOrderVO shopCartOrderDto) { ServerResponseEntity segmentIdResponse = segmentFeignClient.getSegmentId(Order.DISTRIBUTED_ID_KEY); if (!segmentIdResponse.isSuccess()) { - throw new mall4cloudException("获取订单id失败"); + throw new Mall4cloudException("获取订单id失败"); } // 订单信息 Order order = new Order(); diff --git a/mall4cloud-payment/src/main/java/com/mall4j/cloud/payment/service/impl/PayInfoServiceImpl.java b/mall4cloud-payment/src/main/java/com/mall4j/cloud/payment/service/impl/PayInfoServiceImpl.java index 4b93840b..4d2b1b7b 100644 --- a/mall4cloud-payment/src/main/java/com/mall4j/cloud/payment/service/impl/PayInfoServiceImpl.java +++ b/mall4cloud-payment/src/main/java/com/mall4j/cloud/payment/service/impl/PayInfoServiceImpl.java @@ -4,7 +4,7 @@ import com.mall4j.cloud.api.leaf.feign.SegmentFeignClient; import com.mall4j.cloud.api.order.feign.OrderFeignClient; import com.mall4j.cloud.api.order.vo.OrderAmountVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.order.bo.PayNotifyBO; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.response.ServerResponseEntity; @@ -55,7 +55,7 @@ public PayInfoBO pay(Long userId, PayInfoDTO payParam) { // 支付单号 ServerResponseEntity segmentIdResponse = segmentFeignClient.getSegmentId(PayInfo.DISTRIBUTED_ID_KEY); if (!segmentIdResponse.isSuccess()) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } Long payId = segmentIdResponse.getData(); List orderIds = payParam.getOrderIds(); @@ -63,7 +63,7 @@ public PayInfoBO pay(Long userId, PayInfoDTO payParam) { ServerResponseEntity ordersAmountAndIfNoCancelResponse = orderFeignClient.getOrdersAmountAndIfNoCancel(orderIds); // 如果订单已经关闭了,此时不能够支付了 if (!ordersAmountAndIfNoCancelResponse.isSuccess()) { - throw new mall4cloudException(ordersAmountAndIfNoCancelResponse.getMsg()); + throw new Mall4cloudException(ordersAmountAndIfNoCancelResponse.getMsg()); } OrderAmountVO orderAmount = ordersAmountAndIfNoCancelResponse.getData(); PayInfo payInfo = new PayInfo(); @@ -104,7 +104,7 @@ public void paySuccess(PayInfoResultBO payInfoResult, List orderIds) { SendStatus sendStatus = orderNotifyTemplate.syncSend(RocketMqConstant.ORDER_NOTIFY_TOPIC, new GenericMessage<>(new PayNotifyBO(orderIds))).getSendStatus(); if (!Objects.equals(sendStatus, SendStatus.SEND_OK)) { // 消息发不出去就抛异常,因为订单回调会有多次,几乎不可能每次都无法发送出去,发的出去无所谓因为接口是幂等的 - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } } diff --git a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/AttrController.java b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/AttrController.java index cbdd0d48..793cee9f 100644 --- a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/AttrController.java +++ b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/AttrController.java @@ -5,7 +5,7 @@ import com.mall4j.cloud.common.constant.Constant; import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.security.AuthUserContext; import com.mall4j.cloud.product.constant.AttrType; @@ -59,7 +59,7 @@ public ServerResponseEntity getByAttrId(@RequestParam Long attrId) { @ApiOperation(value = "保存属性信息", notes = "保存属性信息") public ServerResponseEntity save(@Valid @RequestBody AttrDTO attrDTO) { if (Objects.equals(Constant.PLATFORM_SHOP_ID, AuthUserContext.get().getTenantId()) && Objects.isNull(attrDTO.getAttrType())) { - throw new mall4cloudException("属性类型不能为空"); + throw new Mall4cloudException("属性类型不能为空"); } checkAttrInfo(attrDTO); Attr attr = mapperFacade.map(attrDTO, Attr.class); @@ -124,10 +124,10 @@ private void checkAttrInfo(AttrDTO attrDTO) { return; } if (CollUtil.isEmpty(attrDTO.getCategoryIds())) { - throw new mall4cloudException("关联分类不能为空"); + throw new Mall4cloudException("关联分类不能为空"); } if (Objects.isNull(attrDTO.getSearchType())) { - throw new mall4cloudException("搜索属性不能为空"); + throw new Mall4cloudException("搜索属性不能为空"); } } diff --git a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/CategoryController.java b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/CategoryController.java index d2664fc8..ef6c088f 100644 --- a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/CategoryController.java +++ b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/CategoryController.java @@ -3,7 +3,7 @@ import com.mall4j.cloud.api.product.constant.CategoryLevel; import com.mall4j.cloud.api.product.vo.CategoryVO; import com.mall4j.cloud.common.constant.Constant; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.security.AuthUserContext; import com.mall4j.cloud.product.dto.CategoryDTO; @@ -48,7 +48,7 @@ public ServerResponseEntity getByCategoryId(@RequestParam Long categ @ApiOperation(value = "保存分类信息", notes = "保存分类信息") public ServerResponseEntity save(@Valid @RequestBody CategoryDTO categoryDTO) { if (!Objects.equals(Constant.PLATFORM_SHOP_ID, AuthUserContext.get().getTenantId()) && categoryDTO.getLevel() > CategoryLevel.SECOND.value()) { - throw new mall4cloudException("分类等级最高只能为二级分类"); + throw new Mall4cloudException("分类等级最高只能为二级分类"); } Category category = mapperFacade.map(categoryDTO, Category.class); categoryService.save(category); diff --git a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/SpuController.java b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/SpuController.java index 7398b79c..328077b6 100644 --- a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/SpuController.java +++ b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/admin/SpuController.java @@ -6,7 +6,7 @@ import com.mall4j.cloud.common.constant.StatusEnum; import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.security.AuthUserContext; import com.mall4j.cloud.product.dto.SkuDTO; @@ -144,7 +144,7 @@ private void spuUpdateStatus(SpuDTO spu) { SpuVO dbSpu = spuService.getBySpuId(spu.getSpuId()); String error = checkUpdateStatusData(dbSpu); if (StrUtil.isNotBlank(error)) { - throw new mall4cloudException(error); + throw new Mall4cloudException(error); } spuService.changeSpuStatus(spu.getSpuId(), spu.getStatus()); spuService.removeSpuCacheBySpuId(spu.getSpuId()); @@ -159,7 +159,7 @@ private void spuBatchUpdateStatus(SpuDTO spu) { List errorList = new ArrayList<>(spu.getSpuIds()); List spuList = spuService.listBySpuIds(spu.getSpuIds(), null, null); if (CollUtil.isEmpty(spuList)) { - throw new mall4cloudException("您选择的商品信息有误,请刷新后重试"); + throw new Mall4cloudException("您选择的商品信息有误,请刷新后重试"); } Map spuMap = spuList.stream().collect(Collectors.toMap(SpuVO::getSpuId, s -> s)); for (Long spuId : spu.getSpuIds()) { @@ -170,11 +170,11 @@ private void spuBatchUpdateStatus(SpuDTO spu) { } } if (CollUtil.isEmpty(spuIds)) { - throw new mall4cloudException("您所选择的商品中没有符合操作条件的商品"); + throw new Mall4cloudException("您所选择的商品中没有符合操作条件的商品"); } spuService.batchRemoveSpuCacheBySpuId(spuIds); if (errorList.size() > 0) { - throw new mall4cloudException("商品id为:" + errorList.toString() + "的" + errorList.size() + "件商品不符合操作条件"); + throw new Mall4cloudException("商品id为:" + errorList.toString() + "的" + errorList.size() + "件商品不符合操作条件"); } spuService.changeSpuStatus(spu.getSpuId(), spu.getStatus()); spuService.removeSpuCacheBySpuId(spu.getSpuId()); @@ -223,7 +223,7 @@ private void loadSpuAttrs(SpuVO spuVO) { */ private void checkSaveOrUpdateInfo(SpuDTO spuDTO) { if (!Objects.equals(Constant.PLATFORM_SHOP_ID, AuthUserContext.get().getTenantId()) && Objects.isNull(spuDTO.getShopCategoryId())) { - throw new mall4cloudException("店铺分类不能为空"); + throw new Mall4cloudException("店铺分类不能为空"); } if (Objects.isNull(spuDTO.getSeq())) { spuDTO.setSeq(0); diff --git a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/platform/BrandController.java b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/platform/BrandController.java index acf05c87..eedbd1f9 100644 --- a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/platform/BrandController.java +++ b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/controller/platform/BrandController.java @@ -4,7 +4,7 @@ import com.mall4j.cloud.api.product.vo.BrandVO; import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.product.dto.BrandDTO; import com.mall4j.cloud.product.model.Brand; @@ -63,7 +63,7 @@ public ServerResponseEntity getByBrandId(@RequestParam Long brandId) { @ApiOperation(value = "保存品牌信息", notes = "保存品牌信息") public ServerResponseEntity save(@Valid @RequestBody BrandDTO brandDTO) { if (CollUtil.isEmpty(brandDTO.getCategoryIds())) { - throw new mall4cloudException("分类不能为空"); + throw new Mall4cloudException("分类不能为空"); } Brand brand = mapperFacade.map(brandDTO, Brand.class); brandService.save(brand, brandDTO.getCategoryIds()); @@ -75,7 +75,7 @@ public ServerResponseEntity save(@Valid @RequestBody BrandDTO brandDTO) { @ApiOperation(value = "更新品牌信息", notes = "更新品牌信息") public ServerResponseEntity update(@Valid @RequestBody BrandDTO brandDTO) { if (CollUtil.isEmpty(brandDTO.getCategoryIds())) { - throw new mall4cloudException("分类不能为空"); + throw new Mall4cloudException("分类不能为空"); } Brand brand = mapperFacade.map(brandDTO, Brand.class); brandService.update(brand, brandDTO.getCategoryIds()); @@ -98,10 +98,10 @@ public ServerResponseEntity delete(@RequestParam Long brandId) { @ApiOperation(value = "更新品牌状态(启用或禁用)", notes = "更新品牌状态(启用或禁用)") public ServerResponseEntity updateBrandStatus(@RequestBody BrandDTO brandDTO) { if (Objects.isNull(brandDTO.getStatus())) { - throw new mall4cloudException("状态不能为空"); + throw new Mall4cloudException("状态不能为空"); } if (Objects.isNull(brandDTO.getBrandId())) { - throw new mall4cloudException("品牌id不能为空"); + throw new Mall4cloudException("品牌id不能为空"); } brandService.updateBrandStatus(brandDTO); return ServerResponseEntity.success(); diff --git a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/AttrServiceImpl.java b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/AttrServiceImpl.java index 79b74139..8ab09155 100644 --- a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/AttrServiceImpl.java +++ b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/AttrServiceImpl.java @@ -7,7 +7,7 @@ import com.mall4j.cloud.common.database.util.PageAdapter; import com.mall4j.cloud.common.database.util.PageUtil; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.security.AuthUserContext; import com.mall4j.cloud.product.constant.AttrType; import com.mall4j.cloud.product.dto.AttrDTO; @@ -58,7 +58,7 @@ public PageVO page(PageDTO pageDTO, AttrDTO attrDTO) { public AttrVO getByAttrId(Long attrId) { AttrVO attrVO = attrMapper.getByAttrId(attrId); if (Objects.isNull(attrVO)) { - throw new mall4cloudException("属性不存在或已删除"); + throw new Mall4cloudException("属性不存在或已删除"); } if (Objects.equals(attrVO.getAttrType(), AttrType.BASIC.value())) { attrVO.setCategories(attrCategoryService.listByAttrId(attrId)); @@ -107,7 +107,7 @@ public void update(Attr attr, List categoryIds) { public void deleteById(Long attrId) { AttrVO dbAttr = getByAttrId(attrId); if (Objects.isNull(dbAttr)) { - throw new mall4cloudException("该属性已删除或不存在"); + throw new Mall4cloudException("该属性已删除或不存在"); } if (Objects.equals(dbAttr.getAttrType(), AttrType.BASIC.value())) { List categoryIds = dbAttr.getCategories().stream().map(CategoryVO::getCategoryId).collect(Collectors.toList()); @@ -126,7 +126,7 @@ public List getAttrsByCategoryIdAndAttrType(Long categoryId) { public List getAttrOfCategoryIdByAttrId(Long attrId) { AttrVO attr = attrMapper.getByAttrId(attrId); if (Objects.isNull(attr)) { - throw new mall4cloudException("属性不存在"); + throw new Mall4cloudException("属性不存在"); } if (CollUtil.isEmpty(attr.getCategories())) { return new ArrayList<>(); diff --git a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/BrandServiceImpl.java b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/BrandServiceImpl.java index bd762ee7..1a5e50bf 100644 --- a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/BrandServiceImpl.java +++ b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/BrandServiceImpl.java @@ -7,7 +7,7 @@ import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.util.PageUtil; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.product.dto.BrandDTO; import com.mall4j.cloud.product.model.Brand; import com.mall4j.cloud.product.mapper.BrandMapper; @@ -65,7 +65,7 @@ public void update(Brand brand, List categoryIds) { @Override public void deleteById(Long brandId) { if (getUseNum(brandId) > 0){ - throw new mall4cloudException("有部分商品在使用该品牌,不能进行删除操作"); + throw new Mall4cloudException("有部分商品在使用该品牌,不能进行删除操作"); } brandMapper.deleteById(brandId); categoryBrandService.deleteByBrandId(brandId); diff --git a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/CategoryServiceImpl.java b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/CategoryServiceImpl.java index 291f12bd..00625026 100644 --- a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/CategoryServiceImpl.java +++ b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/CategoryServiceImpl.java @@ -5,7 +5,7 @@ import com.mall4j.cloud.common.cache.constant.CacheNames; import com.mall4j.cloud.common.constant.Constant; import com.mall4j.cloud.common.constant.StatusEnum; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.security.AuthUserContext; import com.mall4j.cloud.api.product.constant.CategoryLevel; import com.mall4j.cloud.product.dto.CategoryDTO; @@ -74,7 +74,7 @@ public void save(Category category) { public void update(Category category) { CategoryVO dbCategory = getById(category.getCategoryId()); if (Objects.equals(dbCategory.getCategoryId(), category.getParentId())) { - throw new mall4cloudException("分类不能成为本身的上级分类"); + throw new Mall4cloudException("分类不能成为本身的上级分类"); } checkName(category.getCategoryId(), category.getName()); int updateCount = categoryMapper.update(category); @@ -84,7 +84,7 @@ public void update(Category category) { public void deleteById(Long categoryId) { int count = categoryMapper.getCategoryUseNum(categoryId); if (count > 0) { - throw new mall4cloudException("该分类在使用中,不能进行删除操作"); + throw new Mall4cloudException("该分类在使用中,不能进行删除操作"); } categoryMapper.deleteById(categoryId); } @@ -257,7 +257,7 @@ private void setChildCategory(List categories, List chil private void checkName(Long categoryId, String name) { int countByName = categoryMapper.getCountByName(categoryId, name); if (countByName > 0) { - throw new mall4cloudException("分类名已存在,请重新输入"); + throw new Mall4cloudException("分类名已存在,请重新输入"); } } } diff --git a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/SkuStockLockServiceImpl.java b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/SkuStockLockServiceImpl.java index 2980b315..38bffa38 100644 --- a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/SkuStockLockServiceImpl.java +++ b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/SkuStockLockServiceImpl.java @@ -8,7 +8,7 @@ import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.util.PageUtil; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.rocketmq.config.RocketMqConstant; @@ -96,12 +96,12 @@ public ServerResponseEntity lock(List skuStockLocksParam) // 减sku库存 int skuStockUpdateIsSuccess = skuStockMapper.reduceStockByOrder(skuStockLockDTO.getSkuId(), skuStockLockDTO.getCount()); if (skuStockUpdateIsSuccess < 1) { - throw new mall4cloudException(ResponseEnum.NOT_STOCK, skuStockLockDTO.getSkuId()); + throw new Mall4cloudException(ResponseEnum.NOT_STOCK, skuStockLockDTO.getSkuId()); } // 减商品库存 int spuStockUpdateIsSuccess = spuExtensionMapper.reduceStockByOrder(skuStockLockDTO.getSpuId(), skuStockLockDTO.getCount()); if (spuStockUpdateIsSuccess < 1) { - throw new mall4cloudException(ResponseEnum.NOT_STOCK, skuStockLockDTO.getSkuId()); + throw new Mall4cloudException(ResponseEnum.NOT_STOCK, skuStockLockDTO.getSkuId()); } } // 保存库存锁定信息 @@ -111,7 +111,7 @@ public ServerResponseEntity lock(List skuStockLocksParam) SendStatus sendStatus = stockMqTemplate.syncSend(RocketMqConstant.STOCK_UNLOCK_TOPIC, new GenericMessage<>(orderIds), RocketMqConstant.TIMEOUT, RocketMqConstant.CANCEL_ORDER_DELAY_LEVEL + 1).getSendStatus(); if (!Objects.equals(sendStatus,SendStatus.SEND_OK)) { // 消息发不出去就抛异常,发的出去无所谓 - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } return ServerResponseEntity.success(); } @@ -121,7 +121,7 @@ public ServerResponseEntity lock(List skuStockLocksParam) public void unlockStock(List orderIds) { ServerResponseEntity> ordersStatusResponse = orderFeignClient.getOrdersStatus(orderIds); if (!ordersStatusResponse.isSuccess()) { - throw new mall4cloudException(ordersStatusResponse.getMsg()); + throw new Mall4cloudException(ordersStatusResponse.getMsg()); } List orderStatusList = ordersStatusResponse.getData(); diff --git a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/SpuServiceImpl.java b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/SpuServiceImpl.java index 166edb3f..cf15f97d 100644 --- a/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/SpuServiceImpl.java +++ b/mall4cloud-product/src/main/java/com/mall4j/cloud/product/service/impl/SpuServiceImpl.java @@ -15,7 +15,7 @@ import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.util.PageUtil; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.security.AuthUserContext; import com.mall4j.cloud.product.dto.SpuDTO; @@ -119,7 +119,7 @@ public void changeSpuStatus(Long spuId, Integer status) { SpuVO spuVO = spuMapper.getBySpuId(spuId); ServerResponseEntity imgRes = indexImgFeignClient.deleteBySpuId(spuVO.getSpuId(), spuVO.getShopId()); if (!imgRes.isSuccess()) { - throw new mall4cloudException("服务异常"); + throw new Mall4cloudException("服务异常"); } } } @@ -192,7 +192,7 @@ public void update(SpuDTO spuDTO) { public void deleteById(Long spuId) { SpuVO spuVO = getBySpuId(spuId); if(Objects.isNull(spuVO) || Objects.equals(spuVO.getStatus(), StatusEnum.DELETE.value())){ - throw new mall4cloudException("商品不存在或者已被删除!"); + throw new Mall4cloudException("商品不存在或者已被删除!"); } // 删除商品、sku信息(逻辑删除) spuMapper.updateStatusBySpuId(spuId); @@ -200,7 +200,7 @@ public void deleteById(Long spuId) { // 把轮播图中关联了该商品的数据删除 ServerResponseEntity imgRes = indexImgFeignClient.deleteBySpuId(spuId, spuVO.getShopId()); if (!imgRes.isSuccess()) { - throw new mall4cloudException("服务异常"); + throw new Mall4cloudException("服务异常"); } } diff --git a/mall4cloud-rbac/src/main/java/com/mall4j/cloud/rbac/controller/MenuController.java b/mall4cloud-rbac/src/main/java/com/mall4j/cloud/rbac/controller/MenuController.java index c11fdd70..a01f3f57 100644 --- a/mall4cloud-rbac/src/main/java/com/mall4j/cloud/rbac/controller/MenuController.java +++ b/mall4cloud-rbac/src/main/java/com/mall4j/cloud/rbac/controller/MenuController.java @@ -1,7 +1,7 @@ package com.mall4j.cloud.rbac.controller; import com.mall4j.cloud.api.auth.bo.UserInfoInTokenBO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.security.AuthUserContext; import com.mall4j.cloud.common.util.BooleanUtil; @@ -92,7 +92,7 @@ public ServerResponseEntity save(@Valid @RequestBody MenuDTO menuDTO) { private Menu checkAndGenerate(@RequestBody @Valid MenuDTO menuDTO) { UserInfoInTokenBO userInfoInTokenBO = AuthUserContext.get(); if(!Objects.equals(userInfoInTokenBO.getTenantId(),0L)){ - throw new mall4cloudException("无权限操作!"); + throw new Mall4cloudException("无权限操作!"); } Menu menu = mapperFacade.map(menuDTO, Menu.class); menu.setBizType(menuDTO.getSysType()); @@ -115,7 +115,7 @@ public ServerResponseEntity update(@Valid @RequestBody MenuDTO menuDTO) { public ServerResponseEntity delete(@RequestParam("menuId") Long menuId,@RequestParam("sysType") Integer sysType) { UserInfoInTokenBO userInfoInTokenBO = AuthUserContext.get(); if(!Objects.equals(userInfoInTokenBO.getTenantId(),0L)){ - throw new mall4cloudException("无权限操作!"); + throw new Mall4cloudException("无权限操作!"); } sysType = Objects.isNull(sysType) ? userInfoInTokenBO.getSysType():sysType; menuService.deleteById(menuId,sysType); diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/mall4cloudCanalBinLogEventParser.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/Mall4cloudCanalBinLogEventParser.java similarity index 94% rename from mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/mall4cloudCanalBinLogEventParser.java rename to mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/Mall4cloudCanalBinLogEventParser.java index 681746cb..03483d7d 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/mall4cloudCanalBinLogEventParser.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/Mall4cloudCanalBinLogEventParser.java @@ -17,7 +17,7 @@ /** * @author FrozenWatermelon */ -public class mall4cloudCanalBinLogEventParser implements CanalBinLogEventParser { +public class Mall4cloudCanalBinLogEventParser implements CanalBinLogEventParser { private static final Logger log = LoggerFactory.getLogger(DefaultCanalBinLogEventParser.class); @@ -84,10 +84,10 @@ public List> parse(CanalBinLogEvent event, Class kla } } - private mall4cloudCanalBinLogEventParser() { + private Mall4cloudCanalBinLogEventParser() { } - public static mall4cloudCanalBinLogEventParser of() { - return new mall4cloudCanalBinLogEventParser(); + public static Mall4cloudCanalBinLogEventParser of() { + return new Mall4cloudCanalBinLogEventParser(); } } diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/mall4cloudCanalBinlogEventProcessorFactory.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/Mall4cloudCanalBinlogEventProcessorFactory.java similarity index 80% rename from mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/mall4cloudCanalBinlogEventProcessorFactory.java rename to mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/Mall4cloudCanalBinlogEventProcessorFactory.java index 7b106f07..5b019b3a 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/mall4cloudCanalBinlogEventProcessorFactory.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/Mall4cloudCanalBinlogEventProcessorFactory.java @@ -12,7 +12,7 @@ /** * @author FrozenWatermelon */ -public class mall4cloudCanalBinlogEventProcessorFactory implements CanalBinlogEventProcessorFactory { +public class Mall4cloudCanalBinlogEventProcessorFactory implements CanalBinlogEventProcessorFactory { private final ConcurrentMap>> cache = new ConcurrentHashMap<>(16); @@ -29,10 +29,10 @@ public List> get(ModelTable modelTable) { return this.cache.get(modelTable); } - private mall4cloudCanalBinlogEventProcessorFactory() { + private Mall4cloudCanalBinlogEventProcessorFactory() { } - public static mall4cloudCanalBinlogEventProcessorFactory of() { - return new mall4cloudCanalBinlogEventProcessorFactory(); + public static Mall4cloudCanalBinlogEventProcessorFactory of() { + return new Mall4cloudCanalBinlogEventProcessorFactory(); } } diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/mall4cloudCanalGlue.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/Mall4cloudCanalGlue.java similarity index 84% rename from mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/mall4cloudCanalGlue.java rename to mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/Mall4cloudCanalGlue.java index f0d6ca46..f5752f53 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/mall4cloudCanalGlue.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/canal/Mall4cloudCanalGlue.java @@ -13,7 +13,7 @@ /** * @author FrozenWatermelon */ -public class mall4cloudCanalGlue implements CanalGlue { +public class Mall4cloudCanalGlue implements CanalGlue { private final CanalBinlogEventProcessorFactory canalBinlogEventProcessorFactory; @@ -31,11 +31,11 @@ public void process(String content) { } - private mall4cloudCanalGlue(CanalBinlogEventProcessorFactory canalBinlogEventProcessorFactory) { + private Mall4cloudCanalGlue(CanalBinlogEventProcessorFactory canalBinlogEventProcessorFactory) { this.canalBinlogEventProcessorFactory = canalBinlogEventProcessorFactory; } - public static mall4cloudCanalGlue of(CanalBinlogEventProcessorFactory canalBinlogEventProcessorFactory) { - return new mall4cloudCanalGlue(canalBinlogEventProcessorFactory); + public static Mall4cloudCanalGlue of(CanalBinlogEventProcessorFactory canalBinlogEventProcessorFactory) { + return new Mall4cloudCanalGlue(canalBinlogEventProcessorFactory); } } diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/config/CanalGlueAutoConfiguration.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/config/CanalGlueAutoConfiguration.java index 11b38730..4d29d8fd 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/config/CanalGlueAutoConfiguration.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/config/CanalGlueAutoConfiguration.java @@ -6,9 +6,9 @@ import cn.throwx.canal.gule.support.parser.converter.InMemoryCanalFieldConverterFactory; import cn.throwx.canal.gule.support.processor.BaseCanalBinlogEventProcessor; import cn.throwx.canal.gule.support.processor.CanalBinlogEventProcessorFactory; -import com.mall4j.cloud.search.canal.mall4cloudCanalBinLogEventParser; -import com.mall4j.cloud.search.canal.mall4cloudCanalBinlogEventProcessorFactory; -import com.mall4j.cloud.search.canal.mall4cloudCanalGlue; +import com.mall4j.cloud.search.canal.Mall4cloudCanalBinLogEventParser; +import com.mall4j.cloud.search.canal.Mall4cloudCanalBinlogEventProcessorFactory; +import com.mall4j.cloud.search.canal.Mall4cloudCanalGlue; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; @@ -35,7 +35,7 @@ public class CanalGlueAutoConfiguration implements SmartInitializingSingleton, B @Bean @ConditionalOnMissingBean public CanalBinlogEventProcessorFactory canalBinlogEventProcessorFactory() { - return mall4cloudCanalBinlogEventProcessorFactory.of(); + return Mall4cloudCanalBinlogEventProcessorFactory.of(); } @Bean @@ -53,7 +53,7 @@ public CanalFieldConverterFactory canalFieldConverterFactory() { @Bean @ConditionalOnMissingBean public CanalBinLogEventParser canalBinLogEventParser() { - return mall4cloudCanalBinLogEventParser.of(); + return Mall4cloudCanalBinLogEventParser.of(); } @Bean @@ -65,7 +65,7 @@ public ParseResultInterceptorManager parseResultInterceptorManager(ModelTableMet @Bean @Primary public CanalGlue canalGlue(CanalBinlogEventProcessorFactory canalBinlogEventProcessorFactory) { - return mall4cloudCanalGlue.of(canalBinlogEventProcessorFactory); + return Mall4cloudCanalGlue.of(canalBinlogEventProcessorFactory); } @Override diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/OrderCanalListener.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/OrderCanalListener.java index f4e2508c..d54479f7 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/OrderCanalListener.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/OrderCanalListener.java @@ -6,7 +6,7 @@ import cn.throwx.canal.gule.support.processor.ExceptionHandler; import com.mall4j.cloud.api.order.bo.EsOrderBO; import com.mall4j.cloud.api.order.feign.OrderFeignClient; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.util.Json; import com.mall4j.cloud.search.bo.OrderBO; @@ -58,7 +58,7 @@ protected void processInsertInternal(CanalBinLogResult result) { } catch (IOException e) { e.printStackTrace(); log.error(e.toString()); - throw new mall4cloudException("保存es信息异常", e); + throw new Mall4cloudException("保存es信息异常", e); } } @@ -77,14 +77,14 @@ protected void processUpdateInternal(CanalBinLogResult result) { log.info(updateResponse.toString()); } catch (IOException e) { log.error(e.toString()); - throw new mall4cloudException("更新订单es信息异常",e); + throw new Mall4cloudException("更新订单es信息异常",e); } } @Override protected ExceptionHandler exceptionHandler() { return (CanalBinLogEvent event, Throwable throwable) -> { - throw new mall4cloudException("创建索引异常",throwable); + throw new Mall4cloudException("创建索引异常",throwable); }; } } diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/SpuCanalListener.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/SpuCanalListener.java index 3896e753..c3ca93e1 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/SpuCanalListener.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/SpuCanalListener.java @@ -6,7 +6,7 @@ import cn.throwx.canal.gule.support.processor.ExceptionHandler; import com.mall4j.cloud.api.product.bo.EsProductBO; import com.mall4j.cloud.api.product.feign.ProductFeignClient; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.util.Json; import com.mall4j.cloud.search.bo.SpuBO; @@ -48,7 +48,7 @@ protected void processInsertInternal(CanalBinLogResult result) { Long spuId = result.getPrimaryKey(); ServerResponseEntity esProductBO = productFeignClient.loadEsProductBO(spuId); if (!esProductBO.isSuccess()) { - throw new mall4cloudException("创建索引异常"); + throw new Mall4cloudException("创建索引异常"); } IndexRequest request = new IndexRequest(EsIndexEnum.PRODUCT.value()); @@ -60,7 +60,7 @@ protected void processInsertInternal(CanalBinLogResult result) { } catch (IOException e) { log.error(e.toString()); - throw new mall4cloudException("保存es信息异常", e); + throw new Mall4cloudException("保存es信息异常", e); } } @@ -80,14 +80,14 @@ protected void processUpdateInternal(CanalBinLogResult result) { log.info(updateResponse.toString()); } catch (IOException e) { log.error(e.toString()); - throw new mall4cloudException("删除es信息异常",e); + throw new Mall4cloudException("删除es信息异常",e); } } @Override protected ExceptionHandler exceptionHandler() { return (CanalBinLogEvent event, Throwable throwable) -> { - throw new mall4cloudException("创建索引异常",throwable); + throw new Mall4cloudException("创建索引异常",throwable); }; } } diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/SpuExtensionCanalListener.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/SpuExtensionCanalListener.java index eb555acd..3500f260 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/SpuExtensionCanalListener.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/listener/SpuExtensionCanalListener.java @@ -6,7 +6,7 @@ import com.mall4j.cloud.api.product.bo.EsProductBO; import com.mall4j.cloud.common.cache.constant.CacheNames; import com.mall4j.cloud.common.cache.util.CacheManagerUtil; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.util.Json; import com.mall4j.cloud.search.bo.SpuExtensionBO; import com.mall4j.cloud.search.constant.EsIndexEnum; @@ -71,7 +71,7 @@ protected void processUpdateInternal(CanalBinLogResult result) { log.info(updateResponse.toString()); } catch (IOException e) { log.error(e.toString()); - throw new mall4cloudException("更新es信息异常",e); + throw new Mall4cloudException("更新es信息异常",e); } } } diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/OrderSearchManager.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/OrderSearchManager.java index 8da9bc4d..a9928b64 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/OrderSearchManager.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/OrderSearchManager.java @@ -5,7 +5,7 @@ import com.mall4j.cloud.api.vo.EsPageVO; import com.mall4j.cloud.api.vo.search.EsOrderVO; import com.mall4j.cloud.common.dto.OrderSearchDTO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.util.BooleanUtil; import com.mall4j.cloud.common.util.Json; import com.mall4j.cloud.search.constant.EsIndexEnum; @@ -68,7 +68,7 @@ public EsPageVO pageSearchResult(EsPageDTO pageDTO, OrderSearchDTO or result = buildSearchResult(pageDTO, response); } catch (IOException e) { log.error(e.toString()); - throw new mall4cloudException("搜索服务出了点小差,请稍后再试", e); + throw new Mall4cloudException("搜索服务出了点小差,请稍后再试", e); } return result; } diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/ProductSearchManager.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/ProductSearchManager.java index fba38e1c..c94d8cd0 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/ProductSearchManager.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/ProductSearchManager.java @@ -6,7 +6,7 @@ import com.mall4j.cloud.api.vo.*; import com.mall4j.cloud.api.vo.search.*; import com.mall4j.cloud.common.constant.StatusEnum; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.util.BooleanUtil; import com.mall4j.cloud.common.util.Json; import com.mall4j.cloud.search.constant.*; @@ -100,7 +100,7 @@ public List list(ProductSearchDTO productSearchDTO) { spuList = getSpuListByResponse(response.getHits().getHits()); } catch (IOException e) { log.error(e.toString()); - throw new mall4cloudException("搜索服务出了点小差,请稍后再试", e); + throw new Mall4cloudException("搜索服务出了点小差,请稍后再试", e); } return spuList; } @@ -124,7 +124,7 @@ private SearchResponse pageSearchResult(EsPageDTO pageDTO, ProductSearchDTO prod log.debug("搜索返回结果:" + response.toString()); } catch (IOException e) { log.error(e.toString()); - throw new mall4cloudException("搜索服务出了点小差,请稍后再试", e); + throw new Mall4cloudException("搜索服务出了点小差,请稍后再试", e); } return response; } diff --git a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/ProductUpdateManager.java b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/ProductUpdateManager.java index 3f1c7f74..49ebbdfc 100644 --- a/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/ProductUpdateManager.java +++ b/mall4cloud-search/src/main/java/com/mall4j/cloud/search/manager/ProductUpdateManager.java @@ -1,7 +1,7 @@ package com.mall4j.cloud.search.manager; import com.mall4j.cloud.api.product.bo.EsProductBO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.util.Json; import com.mall4j.cloud.search.constant.EsIndexEnum; import org.elasticsearch.action.bulk.BulkRequest; @@ -41,10 +41,10 @@ public void esUpdateSpuBySpuIds(List spuIds, EsProductBO esProductBO) { //更新 BulkResponse bulkResponse = restHighLevelClient.bulk(request, RequestOptions.DEFAULT); if (bulkResponse.hasFailures()) { - throw new mall4cloudException(bulkResponse.buildFailureMessage()); + throw new Mall4cloudException(bulkResponse.buildFailureMessage()); } } catch (Exception e) { - throw new mall4cloudException(e.getMessage()); + throw new Mall4cloudException(e.getMessage()); } } } diff --git a/mall4cloud-user/src/main/java/com/mall4j/cloud/user/controller/app/UserAddrController.java b/mall4cloud-user/src/main/java/com/mall4j/cloud/user/controller/app/UserAddrController.java index 636130af..f55bf3a5 100644 --- a/mall4cloud-user/src/main/java/com/mall4j/cloud/user/controller/app/UserAddrController.java +++ b/mall4cloud-user/src/main/java/com/mall4j/cloud/user/controller/app/UserAddrController.java @@ -1,6 +1,6 @@ package com.mall4j.cloud.user.controller.app; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.order.vo.UserAddrVO; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.response.ServerResponseEntity; @@ -78,11 +78,11 @@ public ServerResponseEntity update(@Valid @RequestBody UserAddrDTO userAdd Long userId = AuthUserContext.get().getUserId(); UserAddrVO dbUserAddr = userAddrService.getUserAddrByUserId(userAddrDTO.getAddrId(), userId); if (dbUserAddr == null) { - throw new mall4cloudException("该地址已被删除"); + throw new Mall4cloudException("该地址已被删除"); } // 默认地址不能修改为普通地址 else if (dbUserAddr.getIsDefault().equals(UserAddr.DEFAULT_ADDR) && userAddrDTO.getIsDefault().equals(UserAddr.NOT_DEFAULT_ADDR)) { - throw new mall4cloudException(ResponseEnum.DATA_ERROR); + throw new Mall4cloudException(ResponseEnum.DATA_ERROR); } UserAddr userAddr = mapperFacade.map(userAddrDTO, UserAddr.class); userAddr.setUserId(userId); @@ -100,9 +100,9 @@ public ServerResponseEntity delete(@RequestParam Long addrId) { Long userId = AuthUserContext.get().getUserId(); UserAddrVO dbUserAddr = userAddrService.getUserAddrByUserId(addrId, userId); if (dbUserAddr == null) { - throw new mall4cloudException("该地址已被删除"); + throw new Mall4cloudException("该地址已被删除"); } else if (dbUserAddr.getIsDefault().equals(UserAddr.DEFAULT_ADDR)) { - throw new mall4cloudException("默认地址不能删除"); + throw new Mall4cloudException("默认地址不能删除"); } userAddrService.deleteUserAddrByUserId(addrId, userId); return ServerResponseEntity.success(); diff --git a/mall4cloud-user/src/main/java/com/mall4j/cloud/user/service/impl/AreaServiceImpl.java b/mall4cloud-user/src/main/java/com/mall4j/cloud/user/service/impl/AreaServiceImpl.java index f0a6c55c..c1df41ac 100644 --- a/mall4cloud-user/src/main/java/com/mall4j/cloud/user/service/impl/AreaServiceImpl.java +++ b/mall4cloud-user/src/main/java/com/mall4j/cloud/user/service/impl/AreaServiceImpl.java @@ -3,7 +3,7 @@ import com.google.common.collect.Lists; import com.mall4j.cloud.api.user.vo.AreaVO; import com.mall4j.cloud.common.cache.constant.CacheNames; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.user.mapper.AreaMapper; import com.mall4j.cloud.user.model.Area; import com.mall4j.cloud.user.service.AreaService; @@ -76,7 +76,7 @@ public void update(Area area) { public void deleteById(Long areaId) { int areaNum = areaMapper.countByAreaId(areaId); if (areaNum > 0) { - throw new mall4cloudException("请先删除子地区"); + throw new Mall4cloudException("请先删除子地区"); } areaMapper.deleteById(areaId); } diff --git a/mall4cloud-user/src/main/java/com/mall4j/cloud/user/service/impl/UserServiceImpl.java b/mall4cloud-user/src/main/java/com/mall4j/cloud/user/service/impl/UserServiceImpl.java index 10abc25a..b47c14f6 100644 --- a/mall4cloud-user/src/main/java/com/mall4j/cloud/user/service/impl/UserServiceImpl.java +++ b/mall4cloud-user/src/main/java/com/mall4j/cloud/user/service/impl/UserServiceImpl.java @@ -11,7 +11,7 @@ import com.mall4j.cloud.common.database.dto.PageDTO; import com.mall4j.cloud.common.database.util.PageUtil; import com.mall4j.cloud.common.database.vo.PageVO; -import com.mall4j.cloud.common.exception.mall4cloudException; +import com.mall4j.cloud.common.exception.Mall4cloudException; import com.mall4j.cloud.common.response.ResponseEnum; import com.mall4j.cloud.common.response.ServerResponseEntity; import com.mall4j.cloud.common.util.IpHelper; @@ -88,7 +88,7 @@ public Long save(UserRegisterDTO param) { ServerResponseEntity segmentIdResponse = segmentFeignClient.getSegmentId(User.DISTRIBUTED_ID_KEY); if (!segmentIdResponse.isSuccess()) { - throw new mall4cloudException(ResponseEnum.EXCEPTION); + throw new Mall4cloudException(ResponseEnum.EXCEPTION); } Long userId = segmentIdResponse.getData(); @@ -107,7 +107,7 @@ public Long save(UserRegisterDTO param) { ServerResponseEntity serverResponse = accountFeignClient.save(authAccountDTO); // 抛异常回滚 if (!serverResponse.isSuccess()) { - throw new mall4cloudException(serverResponse.getMsg()); + throw new Mall4cloudException(serverResponse.getMsg()); } User user = new User(); @@ -124,10 +124,10 @@ public Long save(UserRegisterDTO param) { private void checkRegisterInfo(UserRegisterDTO userRegisterDTO) { ServerResponseEntity responseEntity = accountFeignClient.getByUsernameAndSysType(userRegisterDTO.getUserName(), SysTypeEnum.ORDINARY); if (!responseEntity.isSuccess()) { - throw new mall4cloudException(responseEntity.getMsg()); + throw new Mall4cloudException(responseEntity.getMsg()); } if (Objects.nonNull(responseEntity.getData())) { - throw new mall4cloudException("用户名已存在"); + throw new Mall4cloudException("用户名已存在"); } }