1.创建许可与订单
接口地址:
/api/customer/createandorder.do
接口参数:(将参数挂载URL上)
参数名 | 是否必须 | 类型 | 描述 |
---|---|---|---|
timestamp | 是 | String | 当前时间,例如:Long.toString(new Date().getTime()) |
signature | 是 | String | 数据签名 |
eid | 是 | String | EID |
user | 是 | String | 许可平台的用户名,请联系管理员获取用户名 |
platform | 是 | String | 所属平台 |
name | 是 | String | EID管理员姓名 |
contactPhone | 是 | String | 手机号 |
edition | 是 | String | 版本,可选值: |
userLimited | 是 | String | 用户数 |
creatorUid | 是 | String | 许可创建者UID,可任意填写 |
creatorName | 是 | String | 许可创建姓名,可任意填写 |
数据签名示例代码
protected String generateSignature(String timestamp) throws Exception{ String token = "xxx"; String data = String.format("%s#%s", timestamp, token); Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(token.getBytes(), "HmacSHA256")); String result = Base64.encodeBase64String(mac.doFinal(data.getBytes("utf-8"))); return StringUtils.remove(result, "\r\n"); }
2.下载许可