## 一、概述
獲取當前用戶的余額;
## 二、接口
~~~[api]
post:/share/query/balance
*string:rayOauthServerAppId=默認值#頭部參數,應用的appId,聯系廠商獲取
*string:rayOauthServerTimeStamp=默認值#頭部參數,當前時間戳,參考前述算法
*string:rayOauthServerSignature=默認值#頭部參數,簽名,參考前述算法
<<<
success
{
"status": 200,
"code": 200,
"message": "操作成功",
"bizCode": 0,
"timestamp": "1647935343606",
"result": {
"sysStaffAccount": {
"accountBalance": 0,
"totalRechargeAmount": 0,
"totalWithdrawAmount": 0,
"totalChargeAmount": 0
}
}
}
<<<
error
{
"status": 200,
"code": 1006,
"message": "當前請求appId無效,請確認是否存在并啟用",
"infoCode": "log202203221515192df",
"bizCode": 0,
"timestamp": "1647933319987"
}
~~~
## 三、關鍵字段
| 字段名稱 || 說明 |
| --- | --- |---|
|statu||狀態 200:成功|
|code||狀態碼 200:成功|
|message||提示消息|
|bizCode||0|
|timestamp||時間戳|
|result|sysStaffAccount|返回結果|
|| accountBalance | 賬戶余額 |
|| totalRechargeAmount | 累計充值金額 |
|| totalWithdrawAmount | 累計提取金額 |
|| totalChargeAmount | 累計扣款金額 |
## 四、參考代碼
```
Log4jV2Util.initLog4jV2TestEnv();
String hostUrl = "http://{hosturl}";
String apiUrl = "/share/query/balance";
String appId = "ray40c9903c6";
String appSecret = "46bacebf-f63c-41cc-b29c-5812994a5e83";
Map<String, String> paramap = new HashMap();
String result = OauthCaller.call(hostUrl, apiUrl, appId, appSecret, paramap);
Logger logger = LoggerFactory.getLogger(OauthClientTest.class);
logger.warn(result);
```