| | 114 | 1、接口地址 |
| | 115 | |
| | 116 | 测试环境接口:http://192.168.74.8:1218/?name=httpsqs_master&opt=put |
| | 117 | |
| | 118 | 正式环境接口:http://queue.pconline.com.cn:1218/?name=httpsqs_master&opt=put |
| | 119 | |
| | 120 | 2、newsfeed 方法说明: |
| | 121 | {{{ |
| | 122 | public boolean newsfeed(long accountId,long typeId, Map<String,Object> contents){ |
| | 123 | |
| | 124 | if (accountId <= 0 || typeId <= 0 |
| | 125 | || contents == null || contents.isEmpty() |
| | 126 | || ucServer ==null || queueServer.length() == 0) { |
| | 127 | return false; |
| | 128 | } |
| | 129 | |
| | 130 | String jsonContent = cacheParser.unparse(contents); |
| | 131 | |
| | 132 | Map<String,Object> msg = new HashMap<String,Object>(4); |
| | 133 | msg.put("act","create"); |
| | 134 | msg.put("accountId", accountId); |
| | 135 | msg.put("typeId", typeId); |
| | 136 | msg.put("content", jsonContent); |
| | 137 | |
| | 138 | Map<String,Object> dataMap = new HashMap<String,Object>(3); |
| | 139 | dataMap.put("appName", "bip"); |
| | 140 | dataMap.put("actionType", "createNewsfeed"); |
| | 141 | dataMap.put("msg", msg); |
| | 142 | |
| | 143 | String data = cacheParser.unparse(dataMap); |
| | 144 | Map<String,Object> params = new HashMap<String,Object>(1); |
| | 145 | params.put("data", data); |
| | 146 | |
| | 147 | try { |
| | 148 | JsonResult json = post(queueServer, params); |
| | 149 | return json.getCode()==0; |
| | 150 | } catch (Exception e) { |
| | 151 | JsonResult json = new JsonResult(); |
| | 152 | json.setMessage(-1, e.getMessage());e.printStackTrace(); |
| | 153 | return false; |
| | 154 | } |
| | 155 | } |
| | 156 | }}} |
| | 157 | sysnotice 方法说明 |
| | 158 | {{{ |
| | 159 | public int sysnotice(long senderId,long accountId,long typeId, Map<String,Object> contents){ |
| | 160 | |
| | 161 | if (accountId <= 0 || typeId <= 0 |
| | 162 | || contents == null || contents.isEmpty() |
| | 163 | || queueServer ==null || queueServer.length() == 0) { |
| | 164 | return -1; |
| | 165 | } |
| | 166 | |
| | 167 | String jsonContent = cacheParser.unparse(contents); |
| | 168 | |
| | 169 | Map<String,Object> msg = new HashMap<String,Object>(3); |
| | 170 | msg.put("act","create"); |
| | 171 | msg.put("accountId", accountId); |
| | 172 | msg.put("typeId", typeId); |
| | 173 | msg.put("content", jsonContent); |
| | 174 | msg.put("senderId", senderId); |
| | 175 | |
| | 176 | Map<String,Object> dataMap = new HashMap<String,Object>(2); |
| | 177 | dataMap.put("appName", "bip"); |
| | 178 | dataMap.put("actionType", "createSysnotice"); |
| | 179 | dataMap.put("msg", msg); |
| | 180 | |
| | 181 | String data = cacheParser.unparse(dataMap); |
| | 182 | Map<String,Object> params = new HashMap<String,Object>(3); |
| | 183 | params.put("data", data); |
| | 184 | |
| | 185 | try { |
| | 186 | JsonResult json = post(queueServer, params); |
| | 187 | return json.getCode(); |
| | 188 | } catch (Exception e) { |
| | 189 | JsonResult json = new JsonResult(); |
| | 190 | json.setMessage(-1, e.getMessage()); |
| | 191 | return -1; |
| | 192 | } |
| | 193 | } |
| | 194 | }}} |