| 
															
																@ -3,8 +3,11 @@ package com.yihu.iot.aop; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.alibaba.fastjson.JSON; 
															 | 
															
															 | 
															
																import com.alibaba.fastjson.JSON; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.alibaba.fastjson.JSONObject; 
															 | 
															
															 | 
															
																import com.alibaba.fastjson.JSONObject; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.google.common.collect.Lists; 
															 | 
															
															 | 
															
																import com.google.common.collect.Lists; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.iot.dao.gateway.GcTokenDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.iot.service.platform.IotInterfaceLogService; 
															 | 
															
															 | 
															
																import com.yihu.iot.service.platform.IotInterfaceLogService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.iot.service.useragent.UserAgent; 
															 | 
															
															 | 
															
																import com.yihu.iot.service.useragent.UserAgent; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.iot.gateway.GcToken; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import org.apache.commons.lang.StringUtils; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.aspectj.lang.ProceedingJoinPoint; 
															 | 
															
															 | 
															
																import org.aspectj.lang.ProceedingJoinPoint; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.aspectj.lang.annotation.Around; 
															 | 
															
															 | 
															
																import org.aspectj.lang.annotation.Around; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.aspectj.lang.annotation.Aspect; 
															 | 
															
															 | 
															
																import org.aspectj.lang.annotation.Aspect; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -40,6 +43,8 @@ public class IntefaceLogRequiredAOP { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private UserAgent userAgent; 
															 | 
															
															 | 
															
																    private UserAgent userAgent; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private IotInterfaceLogService iotInterfaceLogService; 
															 | 
															
															 | 
															
																    private IotInterfaceLogService iotInterfaceLogService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    private GcTokenDao gcTokenDaoDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    //Controller层切点路径 
															 | 
															
															 | 
															
																    //Controller层切点路径 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Pointcut("execution(* com.yihu.iot..*.*(..))") 
															 | 
															
															 | 
															
																    @Pointcut("execution(* com.yihu.iot..*.*(..))") 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -68,7 +73,14 @@ public class IntefaceLogRequiredAOP { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            Integer state = responseJson.getInteger("status")==200?1:0; 
															 | 
															
															 | 
															
																            Integer state = responseJson.getInteger("status")==200?1:0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            Map<String,String> paramsMap = getMehtodParam(request); 
															 | 
															
															 | 
															
																            Map<String,String> paramsMap = getMehtodParam(request); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            try { 
															 | 
															
															 | 
															
																            try { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                iotInterfaceLogService.saveLog(paramsMap.get("appId"),params,deleteSensitiveContent, request,state,method.getName()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                String appid = paramsMap.get("appId"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                if(StringUtils.isEmpty(appid)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    //如果没有传appid,则从token中取 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    String accesstoken = request.getHeader("accesstoken"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    GcToken gcToken = gcTokenDaoDao.findByToken(accesstoken); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    appid = gcToken.getAppid(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                iotInterfaceLogService.saveLog(appid,params,deleteSensitiveContent, request,state,method.getName()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            }catch (Exception e){ 
															 | 
															
															 | 
															
																            }catch (Exception e){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                e.printStackTrace(); 
															 | 
															
															 | 
															
																                e.printStackTrace(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 |