智慧菇城红包
红包领取
服务 ID | zjrcuoip.rps.rpm.rcvrps |
---|
VERSION | 1.0.0 |
服务详细描述
领取红包指派发红包方派发出红包后,红包领取方接受红包管理系统推送的红包消息通知,按照红包管理系统提前设置好的领取规则获取红包的过程。
示例代码
ActivityHbReceiveDemo.java
@Service
public class ActivityHbReceiveDemo {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void execute() {
INetTools netTools = NetToolsHttpFactory.getHttpInstance();
OipReqBean oipReqBean = new OipReqBean();
oipReqBean.setAppId("应用id");
oipReqBean.setDlpId("开发者id");
oipReqBean.setProdId("产品id");
oipReqBean.setMethod("zjrcuoip.rps.rpm.rcvrps");
oipReqBean.setVersion("1.0.0");
SimpleDateFormat sfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
oipReqBean.setTimestamp(sfs.format(new Date()));
NetReqConfBean netReqConfBean = new NetReqConfBean();
netReqConfBean.setAppPrivateKey("应用私钥");
netReqConfBean.setNetUrl("请求地址");
netReqConfBean.setPublicKey("开发者公钥");
Date d=new Date();
SimpleDateFormat sf=new SimpleDateFormat("yyyyMMddHHmmss");
Map map =new HashMap();
map.put("rpcode", "123456");
map.put("sender", "123456");
map.put("openId", "999999999");
String bizContent = JSON.toJSONString(map);
oipReqBean.setBizContent(bizContent);
OipRspBean oipRspBean = netTools.execute(oipReqBean, netReqConfBean);
if (oipRspBean.isSuccess()) {
String bizJson = oipRspBean.getBizContent();
if (StringUtils.isNotBlank(bizJson)) {
Map bizData = JSON.parseObject(bizJson, Map.class);
System.out.println(bizData);
}
}
}
}
公共报文
[点击查看公共报文]
业务输入项
序号 | key | 数据项名称 | 类型 | 长度 | 是否必输 | 数据项说明 |
---|
1 | rpcode | 红包编号 | String | 21 | 是 | |
2 | sender | 发送用户 ID | String | 14 | 是 | |
3 | openId | 用户 openId | String | 32 | 是 | |
4 | acctno | 客户帐号 | String | 32 | 否 | |
5 | acctnm | 客户名称 | String | 200 | 否 | |
业务输出项
序号 | key | 数据项名称 | 类型 | 长度 | 是否非空 | 数据项说明 |
---|
1 | traamt | 领取金额 | Decimal | (17,2) | | |
响应码