Skip to content

Latest commit

 

History

History
132 lines (92 loc) · 3.11 KB

用户充值+提现+转账.md

File metadata and controls

132 lines (92 loc) · 3.11 KB

1.普通用户充值

功能描述:用户输入充值金额,提交,跳转支付界面(比如可以是一个二维码),支付成功,alert 充值成功。合约逻辑:用户提出一个充值请求。

需要提交的参数:

用户ID user: test@qqqq.com

充值金额 tokenNum: 150

充值请求的ID rechargeID : recharge4

POST Jason Parameters:

{
  "$class": "org.education.UserRecharge",
  "tokenNum": 100,
  "rechargeID": "recharge1",
  "user": "test@qqqq.com"   
}

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d ' \ 
 { \ 
   "$class": "org.education.UserRecharge", \ 
   "tokenNum": 100, \ 
   "rechargeID": "recharge1", \ 
   "user": "test%40qqqq.com" \ 
 }' 'http://IP:3000/api/UserRecharge'

2.机构用户提现

功能描述:用户输入提现金额,alert 提现成功。合约逻辑:用户提出一个提现请求。

需要提交的参数:

机构用户ID user: ZjuEducation@email.com

充值金额 tokenNum: 150

充值请求的ID rechargeID : recharge4

POST Jason Parameters:

{
  "$class": "org.education.CompanyWithdraw",
  "tokenNum": 1.05,
  "tokenWithdrawID": "Withdraw1",
  "company": "ZjuEducation@email.com"
}

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
   "$class": "org.education.CompanyWithdraw", \ 
   "tokenNum": 1.05, \ 
   "tokenWithdrawID": "Withdraw1", \ 
   "company": "ZjuEducation%40email.com" \ 
 } \ 
 ' 'http://IP:3000/api/CompanyWithdraw'

3.1普通用户向普通用户转账

功能描述:用户输入转账金额、转账地址,提交,alert 转账成功。

需要提交的参数:

用户ID from: test@qqqq.com

转账ID to : test@qqq.com

转账金额 transferNum: 1.05

转账记录的ID transferID: transfer1

POST Jason Parameters:

{
  "$class": "org.education.TokenTransferU_U",
  "transferNum": 1.05,
  "transferID": "transfer1",
  "fromuser": "test@qqqq.com",
  "to": "test@qqq.com"
}

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
   "$class": "org.education.TokenTransferU_U", \ 
   "transferNum": 1.05, \ 
   "transferID": "transfer1", \ 
   "fromuser": "test%40qqqq.com", \ 
   "to": "test%40qqq.com" \ 
 }' 'http://IP:3000/api/TokenTransferU_U'

3.2普通用户向机构用户转账

功能描述:用户输入转账金额、转账地址,提交,alert 转账成功。

需要提交的参数:

用户ID from: test@qqqq.com

转账ID to : ZjuEducation@email.com

转账金额 transferNum: 10.5

转账记录的ID transferID: transfer1

POST Jason Parameters:

{
  "$class": "org.education.TokenTransferU_C",
  "transferNum": 10.5,
  "transferID": "transfer1",
  "fromuser": "test@qqqq.com",
  "to": "ZjuEducation@email.com"
}


curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
   "$class": "org.education.TokenTransferU_C", \ 
   "transferNum": 10.5, \ 
   "transferID": "transfer1", \ 
   "fromuser": "test%40qqqq.com", \ 
   "to": "ZjuEducation%40email.com" \ 
 }' 'http://IP:3000/api/TokenTransferU_C'