| | |
| | |
|
| | | try {
|
| | | result = pjp.proceed();
|
| | | log.info(pjp.getSignature() + "use time:" + (System.currentTimeMillis() - startTime));
|
| | | // log.info(pjp.getSignature() + "use time:" + (System.currentTimeMillis() - startTime));
|
| | | } catch (Throwable e) {
|
| | | result = handlerException(pjp, e);
|
| | | }
|
| | |
| | | Method currentMethod = target.getClass().getMethod(msig.getName(), msig.getParameterTypes());
|
| | | Type type = currentMethod.getGenericReturnType();
|
| | | String message = e.getMessage();
|
| | | Map<String, Object> resultMap = new HashMap<String, Object>();
|
| | | if (e instanceof BusinessException) {
|
| | | log.error(e.getMessage());
|
| | | resultMap.put("msg", message);
|
| | | } else if (e instanceof ValidateException) {
|
| | | } else {
|
| | | log.error(pjp.getSignature() + " error: " + e.toString(), e);
|
| | |
| | | } else if (type == ResultBean.class) {
|
| | | return new ResultBean(e);
|
| | | } else if (type == Map.class) {
|
| | | Map<String, Object> resultMap = new HashMap<String, Object>();
|
| | | resultMap.put("msg", message);
|
| | | return resultMap;
|
| | | } else if (type == Void.TYPE) {
|