@@ -0,0 +1,1054 @@
+package ocean.aop;%0A%0Aimport org.aspectj.lang.ProceedingJoinPoint;%0Aimport org.aspectj.lang.annotation.Around;%0Aimport org.aspectj.lang.annotation.Aspect;%0Aimport org.springframework.core.annotation.Order;%0Aimport org.springframework.stereotype.Service;%0Aimport org.springframework.web.bind.annotation.ResponseBody;%0A%0Aimport java.util.HashMap;%0A%0A/**%0A * Created by ocean on 2015/11/10.%0A * %E7%B5%B1%E4%B8%80%E5%9B%9E%E5%82%B3%E6%AC%84%E4%BD%8D%E8%AE%93%E5%89%8D%E7%AB%AF%E4%BF%B1%E6%9C%89%E5%88%A4%E6%96%B7%E4%BE%9D%E6%93%9A%0A */%0A%0A@Aspect%0A@Service%0A@Order(1)%0Apublic class ResponseProxy %7B%0A%0A    @Around(value=%22@annotation(responseBody)%22)%0A    public Object executed(ProceedingJoinPoint pjp, ResponseBody responseBody)%7B%0A        HashMap%3CString, Object%3E result =  new HashMap%3CString, Object%3E();%0A        try %7B%0A            result.put(%22success%22, true);%0A            result.put(%22result%22 , pjp.proceed());%0A        %7Dcatch (Throwable error)%7B%0A            //do log%0A            //log library println%0A            result.put(%22success%22, false);%0A            result.put(%22result%22 , null);%0A            result.put(%22error%22  , error.getMessage());%0A        %7Dfinally %7B%0A            return result;%0A        %7D%0A    %7D%0A%0A%7D%0A

返回規範。