Commit 8fa694a05c2bdce05e3b8a5f3ef9a5193944df65
1 parent
1dbd344e
init: 47项目迁移
Showing
11 changed files
with
30 additions
and
28 deletions
src/main/java/com/order/erp/common/constant/ServerResult.java
... | ... | @@ -18,11 +18,11 @@ public class ServerResult<T> implements Serializable { |
18 | 18 | /** |
19 | 19 | * 返回的状态码 |
20 | 20 | */ |
21 | - private int result = com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorCode(); | |
21 | + private int result = ServerResultCode.SUCCESS.getErrorCode(); | |
22 | 22 | /** |
23 | 23 | * 返回的消息 |
24 | 24 | */ |
25 | - private String message = com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorDesc(); | |
25 | + private String message = ServerResultCode.SUCCESS.getErrorDesc(); | |
26 | 26 | /** |
27 | 27 | * 返回的数据实体 |
28 | 28 | */ |
... | ... | @@ -56,7 +56,7 @@ public class ServerResult<T> implements Serializable { |
56 | 56 | return this; |
57 | 57 | } |
58 | 58 | |
59 | - public ServerResult setResult(com.canrd.shop.common.constant.ServerResultCode serverResultCode) { | |
59 | + public ServerResult setResult(ServerResultCode serverResultCode) { | |
60 | 60 | this.result = serverResultCode.getErrorCode(); |
61 | 61 | this.message = serverResultCode.getErrorDesc(); |
62 | 62 | return this; |
... | ... | @@ -88,21 +88,21 @@ public class ServerResult<T> implements Serializable { |
88 | 88 | |
89 | 89 | public static <T> ServerResult<T> success() { |
90 | 90 | return new ServerResult() |
91 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.SUCCESS) | |
92 | - .setMessage(com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorDesc()) | |
93 | - .setData(defaultResult(com.canrd.shop.common.constant.ServerResultCode.SUCCESS)); | |
91 | + .setResult(ServerResultCode.SUCCESS) | |
92 | + .setMessage(ServerResultCode.SUCCESS.getErrorDesc()) | |
93 | + .setData(defaultResult(ServerResultCode.SUCCESS)); | |
94 | 94 | } |
95 | 95 | |
96 | 96 | public static <T> ServerResult<T> success(T data) { |
97 | 97 | return new ServerResult() |
98 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.SUCCESS) | |
99 | - .setMessage(com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorDesc()) | |
98 | + .setResult(ServerResultCode.SUCCESS) | |
99 | + .setMessage(ServerResultCode.SUCCESS.getErrorDesc()) | |
100 | 100 | .setData(data); |
101 | 101 | } |
102 | 102 | |
103 | 103 | public static <T> ServerResult<T> success(T data, String message) { |
104 | 104 | return new ServerResult() |
105 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.SUCCESS) | |
105 | + .setResult(ServerResultCode.SUCCESS) | |
106 | 106 | .setMessage(message) |
107 | 107 | .setData(data); |
108 | 108 | } |
... | ... | @@ -114,7 +114,7 @@ public class ServerResult<T> implements Serializable { |
114 | 114 | */ |
115 | 115 | public static <T> ServerResult<T> fail(String message) { |
116 | 116 | return new ServerResult() |
117 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.FAIL) | |
117 | + .setResult(ServerResultCode.FAIL) | |
118 | 118 | .setMessage(message) |
119 | 119 | .setData(defaultResult(Constant.RESULT_FAIL)); |
120 | 120 | } |
... | ... | @@ -126,7 +126,7 @@ public class ServerResult<T> implements Serializable { |
126 | 126 | * @param <T> |
127 | 127 | * @return |
128 | 128 | */ |
129 | - public static <T> ServerResult<T> fail(T data, com.canrd.shop.common.constant.ServerResultCode serverResultCode) { | |
129 | + public static <T> ServerResult<T> fail(T data, ServerResultCode serverResultCode) { | |
130 | 130 | return new ServerResult() |
131 | 131 | .setData(data) |
132 | 132 | .setResult(serverResultCode) |
... | ... | @@ -152,7 +152,7 @@ public class ServerResult<T> implements Serializable { |
152 | 152 | * @author dengbin |
153 | 153 | * @date 2020/9/12 |
154 | 154 | */ |
155 | - public static <T> ServerResult<T> fail(com.canrd.shop.common.constant.ServerResultCode serverResultCode, String msg) { | |
155 | + public static <T> ServerResult<T> fail(ServerResultCode serverResultCode, String msg) { | |
156 | 156 | return new ServerResult() |
157 | 157 | .setResult(serverResultCode) |
158 | 158 | .setMessage(msg) |
... | ... | @@ -165,7 +165,7 @@ public class ServerResult<T> implements Serializable { |
165 | 165 | * @author dengbin |
166 | 166 | * @date 2020/9/12 |
167 | 167 | */ |
168 | - public static <T> ServerResult<T> fail(com.canrd.shop.common.constant.ServerResultCode serverResultCode) { | |
168 | + public static <T> ServerResult<T> fail(ServerResultCode serverResultCode) { | |
169 | 169 | return new ServerResult() |
170 | 170 | .setResult(serverResultCode) |
171 | 171 | .setMessage(serverResultCode.getErrorDesc()) |
... | ... | @@ -188,8 +188,8 @@ public class ServerResult<T> implements Serializable { |
188 | 188 | |
189 | 189 | public static <T> ServerResult<T> fail() { |
190 | 190 | return new ServerResult() |
191 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.FAIL.getErrorCode()) | |
192 | - .setMessage(com.canrd.shop.common.constant.ServerResultCode.FAIL.getErrorDesc()) | |
191 | + .setResult(ServerResultCode.FAIL.getErrorCode()) | |
192 | + .setMessage(ServerResultCode.FAIL.getErrorDesc()) | |
193 | 193 | .setData(defaultResult(Constant.RESULT_FAIL)); |
194 | 194 | } |
195 | 195 | |
... | ... | @@ -199,7 +199,7 @@ public class ServerResult<T> implements Serializable { |
199 | 199 | * @author dengbin |
200 | 200 | * @date 2020/9/12 |
201 | 201 | */ |
202 | - public ServerResult failEnum(com.canrd.shop.common.constant.ServerResultCode serverResultCode) { | |
202 | + public ServerResult failEnum(ServerResultCode serverResultCode) { | |
203 | 203 | setResult(serverResultCode); |
204 | 204 | setMessage(serverResultCode.getErrorDesc()); |
205 | 205 | return this; |
... | ... | @@ -218,7 +218,7 @@ public class ServerResult<T> implements Serializable { |
218 | 218 | * @return 结果 ture or false |
219 | 219 | */ |
220 | 220 | public boolean checkSuccess() { |
221 | - return result == com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorCode(); | |
221 | + return result == ServerResultCode.SUCCESS.getErrorCode(); | |
222 | 222 | } |
223 | 223 | |
224 | 224 | public boolean checkNotSuccess() { | ... | ... |
src/main/java/com/order/erp/common/excel4j/ExcelValidator.java
1 | 1 | package com.order.erp.common.excel4j; |
2 | 2 | |
3 | 3 | import com.order.erp.common.constant.Constant; |
4 | +import com.order.erp.common.constant.ServerResultCode; | |
4 | 5 | import com.order.erp.common.exception.BusinessException; |
5 | 6 | import com.order.erp.common.utils.StringUtils; |
6 | 7 | import lombok.extern.slf4j.Slf4j; |
... | ... | @@ -30,7 +31,7 @@ public class ExcelValidator { |
30 | 31 | Set<ConstraintViolation<T>> set = validator.validate(obj, Default.class); |
31 | 32 | String err = collectError(set); |
32 | 33 | if (StringUtils.isNotBlank(err)){ |
33 | - throw new BusinessException(com.canrd.shop.common.constant.ServerResultCode.ILLEGAL_ARGUMENT.getErrorCode(),err); | |
34 | + throw new BusinessException(ServerResultCode.ILLEGAL_ARGUMENT.getErrorCode(),err); | |
34 | 35 | } |
35 | 36 | } |
36 | 37 | ... | ... |
src/main/java/com/order/erp/common/exception/BusinessException.java
1 | 1 | package com.order.erp.common.exception; |
2 | 2 | |
3 | -import com.canrd.shop.common.constant.ServerResultCode; | |
4 | 3 | import com.order.erp.common.constant.ServerResult; |
4 | +import com.order.erp.common.constant.ServerResultCode; | |
5 | 5 | import lombok.Getter; |
6 | 6 | import lombok.Setter; |
7 | 7 | import lombok.extern.slf4j.Slf4j; | ... | ... |
src/main/java/com/order/erp/common/exception/BusinessExceptionHandlerAdvice.java
1 | 1 | package com.order.erp.common.exception; |
2 | 2 | |
3 | -import com.canrd.shop.common.constant.ServerResultCode; | |
3 | +import com.order.erp.common.constant.ServerResultCode; | |
4 | 4 | import com.order.erp.common.constant.ServerResult; |
5 | 5 | import org.springframework.core.annotation.Order; |
6 | 6 | import org.springframework.http.HttpStatus; | ... | ... |
src/main/java/com/order/erp/common/exception/handler/GlobalExceptionHandler.java
1 | 1 | package com.order.erp.common.exception.handler; |
2 | 2 | |
3 | 3 | |
4 | -import com.canrd.shop.common.constant.ServerResultCode; | |
4 | +import com.order.erp.common.constant.ServerResultCode; | |
5 | 5 | import com.order.erp.common.constant.ServerResult; |
6 | 6 | import com.order.erp.common.exception.BusinessException; |
7 | 7 | import com.order.erp.common.exception.EntityExistException; | ... | ... |
src/main/java/com/order/erp/common/utils/ImgCaptchaUtils.java
1 | 1 | package com.order.erp.common.utils; |
2 | 2 | |
3 | 3 | import cn.hutool.core.util.IdUtil; |
4 | +import com.order.erp.common.constant.ServerResultCode; | |
4 | 5 | import com.order.erp.common.exception.BusinessException; |
5 | 6 | import com.order.erp.security.config.SecurityProperties; |
6 | 7 | import lombok.extern.slf4j.Slf4j; |
... | ... | @@ -34,10 +35,10 @@ public class ImgCaptchaUtils { |
34 | 35 | // 清除验证码 |
35 | 36 | redisUtil.delete(imgCaptchaUuid); |
36 | 37 | if (StringUtils.isBlank(code)) { |
37 | - throw new BusinessException(com.canrd.shop.common.constant.ServerResultCode.IMG_CAPTCHA_EXPIRE_ERROR); | |
38 | + throw new BusinessException(ServerResultCode.IMG_CAPTCHA_EXPIRE_ERROR); | |
38 | 39 | } |
39 | 40 | if (StringUtils.isBlank(imgCaptchaCode) || !imgCaptchaCode.equalsIgnoreCase(code)) { |
40 | - throw new BusinessException(com.canrd.shop.common.constant.ServerResultCode.IMG_CAPTCHA_ERROR); | |
41 | + throw new BusinessException(ServerResultCode.IMG_CAPTCHA_ERROR); | |
41 | 42 | } |
42 | 43 | } |
43 | 44 | ... | ... |
src/main/java/com/order/erp/common/utils/SecurityUtils.java
1 | 1 | package com.order.erp.common.utils; |
2 | 2 | |
3 | 3 | import cn.hutool.json.JSONObject; |
4 | -import com.canrd.shop.common.constant.ServerResultCode; | |
4 | +import com.order.erp.common.constant.ServerResultCode; | |
5 | 5 | import com.order.erp.common.exception.BusinessException; |
6 | 6 | import org.springframework.security.core.context.SecurityContextHolder; |
7 | 7 | import org.springframework.security.core.userdetails.UserDetails; | ... | ... |
src/main/java/com/order/erp/common/utils/SmsUtils.java
... | ... | @@ -7,7 +7,7 @@ import com.aliyuncs.DefaultAcsClient; |
7 | 7 | import com.aliyuncs.IAcsClient; |
8 | 8 | import com.aliyuncs.http.MethodType; |
9 | 9 | import com.aliyuncs.profile.DefaultProfile; |
10 | -import com.canrd.shop.common.constant.ServerResultCode; | |
10 | +import com.order.erp.common.constant.ServerResultCode; | |
11 | 11 | import com.google.common.collect.Maps; |
12 | 12 | import com.order.erp.common.constant.Constant; |
13 | 13 | import com.order.erp.common.constant.ServerResult; | ... | ... |
src/main/java/com/order/erp/service/admin/impl/AdminUserServiceImpl.java
... | ... | @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
9 | 9 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
10 | 10 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
11 | 11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
12 | -import com.canrd.shop.common.constant.ServerResultCode; | |
12 | +import com.order.erp.common.constant.ServerResultCode; | |
13 | 13 | import com.order.erp.common.constant.Constant; |
14 | 14 | import com.order.erp.common.constant.ServerResult; |
15 | 15 | import com.order.erp.common.exception.BusinessException; | ... | ... |
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
... | ... | @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
10 | 10 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
11 | 11 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
12 | 12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
13 | -import com.canrd.shop.common.constant.ServerResultCode; | |
13 | +import com.order.erp.common.constant.ServerResultCode; | |
14 | 14 | import com.order.erp.common.constant.Constant; |
15 | 15 | import com.order.erp.common.constant.ServerResult; |
16 | 16 | import com.order.erp.common.excel4j.ExcelUtils; | ... | ... |
src/main/java/com/order/erp/service/order/impl/OrderFieldLockApplyServiceImpl.java
... | ... | @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
10 | 10 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
11 | 11 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
12 | 12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
13 | -import com.canrd.shop.common.constant.ServerResultCode; | |
13 | +import com.order.erp.common.constant.ServerResultCode; | |
14 | 14 | import com.order.erp.common.constant.Constant; |
15 | 15 | import com.order.erp.common.constant.ServerResult; |
16 | 16 | import com.order.erp.common.exception.BusinessException; | ... | ... |