Commit 75afab1f86c00f4e465ea6fd94de7fbd66bb5a5b
1 parent
3f33ca2d
售后日志优化
Showing
5 changed files
with
16 additions
and
23 deletions
yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/aftersale/AfterSaleOperateTypeEnum.java
| 1 | 1 | package cn.iocoder.yudao.module.trade.enums.aftersale; |
| 2 | 2 | |
| 3 | +import lombok.Getter; | |
| 4 | +import lombok.RequiredArgsConstructor; | |
| 5 | + | |
| 3 | 6 | /** |
| 4 | 7 | * 售后操作类型的枚举 |
| 5 | 8 | * |
| 6 | 9 | * @author 陈賝 |
| 7 | 10 | * @since 2023/6/13 13:53 |
| 8 | 11 | */ |
| 9 | -// TODO @chenchen:可以 lombok 简化构造方法,和 get 方法 | |
| 12 | +@RequiredArgsConstructor | |
| 13 | +@Getter | |
| 10 | 14 | public enum AfterSaleOperateTypeEnum { |
| 11 | 15 | |
| 12 | 16 | /** |
| 13 | 17 | * 用户申请 |
| 14 | 18 | */ |
| 15 | - APPLY("用户申请"), | |
| 19 | + APPLY(0, "用户申请"), | |
| 16 | 20 | ; |
| 17 | 21 | |
| 22 | + // 类型 | |
| 23 | + private final Integer type; | |
| 24 | + // 描述 | |
| 18 | 25 | private final String description; |
| 19 | 26 | |
| 20 | - AfterSaleOperateTypeEnum(String description) { | |
| 21 | - this.description = description; | |
| 22 | - } | |
| 23 | - | |
| 24 | 27 | public String description() { |
| 25 | 28 | return description; |
| 26 | 29 | } | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/aftersale/TradeAfterSaleLogDO.java
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/config/AfterSaleLogConfiguration.java renamed to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/config/AfterSaleConfiguration.java
| ... | ... | @@ -4,15 +4,14 @@ import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.aop.AfterSaleLo |
| 4 | 4 | import org.springframework.context.annotation.Bean; |
| 5 | 5 | import org.springframework.context.annotation.Configuration; |
| 6 | 6 | |
| 7 | -// TODO @chenchen:改成 aftersale 好点哈; | |
| 8 | 7 | /** |
| 9 | - * trade 模块的 afterSaleLog 组件的 Configuration | |
| 8 | + * trade 模块的 afterSale 组件的 Configuration | |
| 10 | 9 | * |
| 11 | 10 | * @author 陈賝 |
| 12 | 11 | * @since 2023/6/18 11:09 |
| 13 | 12 | */ |
| 14 | 13 | @Configuration(proxyBeanMethods = false) |
| 15 | -public class AfterSaleLogConfiguration { | |
| 14 | +public class AfterSaleConfiguration { | |
| 16 | 15 | |
| 17 | 16 | @Bean |
| 18 | 17 | public AfterSaleLogAspect afterSaleLogAspect() { | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersalelog/core/aop/AfterSaleLogAspect.java
| ... | ... | @@ -31,12 +31,13 @@ import static java.util.Arrays.asList; |
| 31 | 31 | @Aspect |
| 32 | 32 | public class AfterSaleLogAspect { |
| 33 | 33 | |
| 34 | + private final static String OPERATE_TYPE = "operateType"; | |
| 35 | + private final static String ID = "id"; | |
| 36 | + private final static String CONTENT = "content"; | |
| 37 | + | |
| 34 | 38 | @Resource |
| 35 | 39 | private AfterSaleLogService afterSaleLogService; |
| 36 | 40 | |
| 37 | - // TODO chenchen: 这个分 3 行把; | |
| 38 | - private final static String OPERATE_TYPE = "operateType", ID = "id", CONTENT = "content"; | |
| 39 | - | |
| 40 | 41 | /** |
| 41 | 42 | * 切面存入日志 |
| 42 | 43 | */ | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/aftersale/TradeAfterSaleServiceImpl.java
| ... | ... | @@ -398,14 +398,6 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa |
| 398 | 398 | this.createLog(logDTO); |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | - // TODO @CHENCHEN:这个注释,写在接口就好了,补充重复写哈;@date 应该是 @since | |
| 402 | - /** | |
| 403 | - * 日志记录 | |
| 404 | - * | |
| 405 | - * @param logDTO 日志记录 | |
| 406 | - * @author 陈賝 | |
| 407 | - * @date 2023/6/12 14:18 | |
| 408 | - */ | |
| 409 | 401 | @Override |
| 410 | 402 | @Async |
| 411 | 403 | public void createLog(TradeAfterSaleLogCreateReqDTO logDTO) { |
| ... | ... | @@ -417,8 +409,7 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa |
| 417 | 409 | .setOperateType(logDTO.getOperateType()) |
| 418 | 410 | .setContent(logDTO.getContent()); |
| 419 | 411 | tradeAfterSaleLogMapper.insert(afterSaleLog); |
| 420 | - // TODO @CHENCHEN:代码排版哈;空格要正确 | |
| 421 | - }catch (Exception exception){ | |
| 412 | + } catch (Exception exception) { | |
| 422 | 413 | log.error("[createLog][request({}) 日志记录错误]", toJsonString(logDTO), exception); |
| 423 | 414 | } |
| 424 | 415 | } | ... | ... |