xufenglei
2017-12-19 409696535bdc86f09b57582a355087a2120cb74c
src/main/java/com/moral/common/aop/ControllerAOP.java
@@ -13,6 +13,7 @@
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import com.moral.common.bean.AppData;
import com.moral.common.bean.ResultBean;
import com.moral.common.exception.BusinessException;
import com.moral.common.exception.ValidateException;
@@ -63,14 +64,14 @@
      if (type instanceof ParameterizedType) {
         Type rawType = ((ParameterizedType) type).getRawType();
         if (rawType == ResultBean.class) {
            ResultBean<?> resultBean = new ResultBean(ResultBean.FAIL);
            resultBean.setMessage(message);
            return resultBean;
         if (rawType == AppData.class) {
            return new AppData(message,AppData.FAIL);
         } else if (rawType == ResultBean.class) {
            return new ResultBean(message,ResultBean.FAIL);
         } else if (rawType == Map.class) {
            Map<String, Object> result = new HashMap<String, Object>();
            result.put("msg",message);
            return result;
            Map<String, Object> resultMap = new HashMap<String, Object>();
            resultMap.put("msg", message);
            return resultMap;
         }
      }
      return null;