| | |
| | | import com.java110.core.cache.Java110RedisConfig; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.context.SecureInvocation; |
| | | import com.java110.core.factory.CallApiServiceFactory; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.http.HttpMethod; |
| | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | throw new IllegalArgumentException(responseEntity.getBody()); |
| | | } |
| | | return new ResultVo(responseEntity.getStatusCode() == HttpStatus.OK ? ResultVo.CODE_OK : ResultVo.CODE_ERROR, responseEntity.getBody()); |
| | | |
| | | if(!StringUtil.isJsonObject(responseEntity.getBody())){ |
| | | //return new ResultVo(responseEntity.getStatusCode() == HttpStatus.OK ? ResultVo.CODE_OK : ResultVo.CODE_ERROR, responseEntity.getBody()); |
| | | throw new IllegalArgumentException(responseEntity.getBody()); |
| | | } |
| | | |
| | | JSONObject paramJson = JSONObject.parseObject(responseEntity.getBody()); |
| | | if(paramJson.containsKey("code") && paramJson.getIntValue("code") != 0){ |
| | | throw new IllegalArgumentException(paramJson.getString("msg")); |
| | | } |
| | | |
| | | return new ResultVo(responseEntity.getStatusCode() == HttpStatus.OK ? ResultVo.CODE_OK : ResultVo.CODE_ERROR, responseEntity.getBody(),responseEntity.getBody()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if(paramOut.containsKey("code") && ResultVo.CODE_OK != paramOut.getIntValue("code")){ |
| | | throw new IllegalArgumentException(paramOut.getString("msg")); |
| | | } |
| | | return new ResultVo(responseEntity.getStatusCode() == HttpStatus.OK ? ResultVo.CODE_OK : ResultVo.CODE_ERROR, responseEntity.getBody()); |
| | | return new ResultVo(paramOut.getIntValue("code"), paramOut.getString("msg"), paramOut.get("data")); |
| | | } |
| | | |
| | | @Override |