Commit d3ca566eafa6fac343b7664c37d73b49de116a23
1 parent
9b270e1266
Exists in
master
and in
6 other branches
服务同步
Showing 1 changed file with 3 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SyncDataController.java
View file @
d3ca566
| ... | ... | @@ -4,7 +4,6 @@ |
| 4 | 4 | import com.lyms.platform.common.base.BaseController; |
| 5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 6 | import com.lyms.platform.common.pojo.SyncDataModel; |
| 7 | -import com.lyms.platform.common.result.BaseListResponse; | |
| 8 | 7 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | 8 | import com.lyms.platform.common.utils.Config; |
| 10 | 9 | import com.lyms.platform.common.utils.ExceptionUtils; |
| 11 | 10 | |
| 12 | 11 | |
| ... | ... | @@ -87,18 +86,18 @@ |
| 87 | 86 | @RequestParam(value = "method", required = true) String method |
| 88 | 87 | ) { |
| 89 | 88 | //返回值 |
| 90 | - BaseListResponse baseResponse = null; | |
| 89 | + BaseResponse baseResponse = new BaseResponse(); | |
| 91 | 90 | try { |
| 92 | 91 | System.out.println("数据同步开始:action:" + action + ",method:" + method+",synForm:"+synForm); |
| 93 | 92 | WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext(); |
| 94 | 93 | |
| 95 | 94 | if(StringUtils.isNotEmpty(synForm)){//如果有参数 |
| 96 | 95 | Method mh = ReflectionUtils.findMethod(webApplicationContext.getBean(action).getClass(), method, new Class[]{String.class}); |
| 97 | - baseResponse = (BaseListResponse) ReflectionUtils.invokeMethod(mh, webApplicationContext.getBean(action), synForm); | |
| 96 | + baseResponse = (BaseResponse) ReflectionUtils.invokeMethod(mh, webApplicationContext.getBean(action), synForm); | |
| 98 | 97 | }else{//无参数 |
| 99 | 98 | Method mh = ReflectionUtils.findMethod(webApplicationContext.getBean(action).getClass(), method, null); |
| 100 | 99 | if(mh!=null){ |
| 101 | - baseResponse = (BaseListResponse) ReflectionUtils.invokeMethod(mh, webApplicationContext.getBean(action), null); | |
| 100 | + baseResponse = (BaseResponse) ReflectionUtils.invokeMethod(mh, webApplicationContext.getBean(action), null); | |
| 102 | 101 | }else{ |
| 103 | 102 | baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); |
| 104 | 103 | baseResponse.setErrormsg("没有找到:"+action+",中的:"+method+"方法!请确认传入参数"); |