|
|
|
@ -11,7 +11,10 @@ import com.engine.organization.util.HrmI18nUtil;
|
|
|
|
|
import com.engine.organization.util.LogAspect;
|
|
|
|
|
import com.engine.organization.util.OrganizationAssert;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.weaverboot.frame.ioc.anno.classAnno.WeaIocService;
|
|
|
|
|
//import com.weaverboot.frame.ioc.anno.classAnno.WeaIocReplaceComponent;
|
|
|
|
|
//import com.weaverboot.frame.ioc.anno.classAnno.WeaIocService;
|
|
|
|
|
//import com.weaverboot.frame.ioc.anno.methodAnno.WeaReplaceAfter;
|
|
|
|
|
//import com.weaverboot.frame.ioc.handler.replace.weaReplaceParam.impl.WeaAfterReplaceParam;
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -22,7 +25,8 @@ import java.util.List;
|
|
|
|
|
* @Date 2022/4/27
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
**/
|
|
|
|
|
@WeaIocService
|
|
|
|
|
//@WeaIocService
|
|
|
|
|
//@WeaIocReplaceComponent("demoService") //如不标注名称,则按类的全路径注入
|
|
|
|
|
public class DemoServiceImpl extends Service implements DemoService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -31,15 +35,32 @@ public class DemoServiceImpl extends Service implements DemoService {
|
|
|
|
|
@Log(operateType = OperateTypeEnum.ADD,operateDesc = "测试自定义日志")
|
|
|
|
|
public List<Demo> list(String name) {
|
|
|
|
|
|
|
|
|
|
OrganizationAssert.notNull(name,HrmI18nUtil.getI18nLabel(34721,"参数不能为空") );
|
|
|
|
|
OrganizationAssert.notNull(name, HrmI18nUtil.getI18nLabel(34721, "参数不能为空"));
|
|
|
|
|
List<Demo> demos = MapperProxyFactory.getProxy(DemoMapper.class).listAll();
|
|
|
|
|
|
|
|
|
|
//操作日志记录
|
|
|
|
|
Method method = new Object(){}.getClass().getEnclosingMethod();
|
|
|
|
|
Method method = new Object() {
|
|
|
|
|
}.getClass().getEnclosingMethod();
|
|
|
|
|
LoggerContext loggerContext = LoggerContext.builder().operatorId(user.getUID()).operatorName(user.getLastname()).build();
|
|
|
|
|
LogAspect logAspect = new LogAspect(DemoServiceImpl.class,method,loggerContext);
|
|
|
|
|
LogAspect logAspect = new LogAspect(DemoServiceImpl.class, method, loggerContext);
|
|
|
|
|
logAspect.start();
|
|
|
|
|
|
|
|
|
|
return demos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//这个是接口后置方法,大概的用法跟前置方法差不多,稍有差别
|
|
|
|
|
//注解名称为WeaReplaceAfter
|
|
|
|
|
//返回类型必须为String
|
|
|
|
|
//参数叫WeaAfterReplaceParam,这个类前四个参数跟前置方法的那个相同,不同的是多了一个叫data的String,这个是那个接口执行完返回的报文
|
|
|
|
|
//@WeaReplaceAfter(value = "/api/bs/hrmorganization/scheme/updateForbiddenTagById",order = 1)
|
|
|
|
|
// public void after(WeaAfterReplaceParam weaAfterReplaceParam){
|
|
|
|
|
//
|
|
|
|
|
// String data = weaAfterReplaceParam.getData();//这个就是接口执行完的报文
|
|
|
|
|
// System.out.println(data);
|
|
|
|
|
// //日志记录
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|