mouzt / mzt-biz-log

支持Springboot,基于注解的可使用变量、可以自定义函数的通用操作日志组件
Apache License 2.0
2.06k stars 483 forks source link

方法上支持多注解 #98

Closed wulangcode closed 1 year ago

wulangcode commented 2 years ago

支持方法多注解的事。

    @LogRecord(
            success = "{{#order.purchaseName}}下了一个订单,购买商品 下单逻辑",
            type = LogRecordType.ORDER, bizNo = "{{#order.orderNo}}")
    @LogRecord(
            subType = "MANAGER_VIEW",
            success = "{{#order.purchaseName}}下了一个订单,购买商品 扣库存逻辑",
            type = LogRecordType.ORDER, bizNo = "{{#order.orderNo}}")
    public boolean createOrder_interface(Order order) {
        log.info("【创建订单】orderNo={}", order.getOrderNo());
        // db insert order
        Order order1 = new Order();
        order1.setProductName("内部变量测试");
        LogRecordContext.putVariable("innerOrder", order1);
        return true;
    }

可以完成一个方法多个操作的场景

Originally posted by @wulangcode in https://github.com/mouzt/mzt-biz-log/issues/95#issuecomment-1274270689

mouzt commented 1 year ago

3.0.3