| | |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | public static <T> T getForApi(String appId, T param, String serviceCode, Class<T> t,String userId) { |
| | | |
| | | IPageData pd = PageData.newInstance().builder(userId, "未知", "", "", "", "", "", "", appId); |
| | | |
| | | List<T> list = getForApis(pd, param, serviceCode, t); |
| | | if (list != null && list.size() > 0) { |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | * |
| | | * @param param 传入对象 |
| | | * @param serviceCode 服务编码 |
| | | * @param t 返回类 |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | public static <T> T postForApi(String appId, T param, String serviceCode, Class<T> t, String userId) { |
| | | |
| | | IPageData pd = PageData.newInstance().builder(userId, "未知", "", "", "", "", "", "", appId); |
| | |
| | | } |
| | | |
| | | JSONObject resultVo = JSONObject.parseObject(responseEntity.getBody()); |
| | | |
| | | if (ResultVo.CODE_MACHINE_OK != resultVo.getInteger("code")) { |
| | | throw new SMOException(resultVo.getString("msg")); |
| | | Object bObj = null; |
| | | if(resultVo.containsKey("code")){ |
| | | if (ResultVo.CODE_MACHINE_OK != resultVo.getInteger("code")) { |
| | | throw new SMOException(resultVo.getString("msg")); |
| | | } |
| | | bObj = resultVo.get("data"); |
| | | }else{ |
| | | bObj = resultVo; |
| | | } |
| | | |
| | | Object bObj = resultVo.get("data"); |
| | | |
| | | JSONArray datas = null; |
| | | if (bObj instanceof JSONObject) { |
| | | datas = new JSONArray(); |
| | |
| | | |
| | | JSONObject resultVo = JSONObject.parseObject(responseEntity.getBody()); |
| | | |
| | | if (!"0".equals(resultVo.getString("code"))) { |
| | | throw new SMOException(resultVo.getString("msg")); |
| | | Object bObj = null; |
| | | if(resultVo.containsKey("code")){ |
| | | if (ResultVo.CODE_MACHINE_OK != resultVo.getInteger("code")) { |
| | | throw new SMOException(resultVo.getString("msg")); |
| | | } |
| | | bObj = resultVo.get("data"); |
| | | }else{ |
| | | bObj = resultVo; |
| | | } |
| | | |
| | | Object bObj = resultVo.get("data"); |
| | | JSONArray datas = null; |
| | | if (bObj instanceof JSONObject) { |
| | | datas = new JSONArray(); |