
package com.jeelowcode.module.biz.demo.test;


import com.jeelowcode.core.framework.config.aspect.enhance.model.EnhanceContext;
import com.jeelowcode.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
import org.springframework.stereotype.Component;

/**
 * @author JX
 * @create 2024-08-13 11:42
 * @dedescription: 环绕增强测试
 */

@Component("demoAroundAdvicePlugin")
public class DemoAroundAdvicePlugin  implements AroundAdvicePlugin {


    @Override
    public void beforeExecute(EnhanceContext enhanceContext) {
//
//        System.out.println("----------------------------------------------------------beforeExecute----------------------------------------------------------");
//        EnhanceResult result = new EnhanceResult();
//        result.setExitFlag(false);
//        enhanceContext.setResult(result);
    }

    @Override
    public void afterExecute(EnhanceContext enhanceContext) {
//        System.out.println("----------------------------------------------------------afterExecute----------------------------------------------------------");
//        List<Map<String, Object>> records = enhanceContext.getResult().getRecords();
//        records.forEach(record -> {
//            record.replace("name", FuncBase.getMap2Str(record, "name")+"_after_enhance");
//        });
    }
}
