Skip to content

Commit

Permalink
java
Browse files Browse the repository at this point in the history
  • Loading branch information
peng.zhang committed Dec 1, 2018
1 parent 3b3319b commit eaa37be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,15 @@ public class WhaleexConstant {
/**
* REST API base URL.
*/
public static final String API_BASE_URL = "trade.stg.whaleex.com.cn";
// public static final String API_BASE_URL = "127.0.0.1:8888";

public static final String API_BASE_URL = "api.whaleex.com";
public static final String BUSINESS_URL_PREFIX ="https://"+API_BASE_URL+"/BUSINESS";
public static final String UAA_URL_PREFIX ="https://"+API_BASE_URL+"/UAA";

public static final String EX_EOSACCOUNT ="whaleexchang";

public static final String EX_ACCOUNT ="whaleex12345";

public static final String USER_EOSACCOUNT="yyyyyyyyyycc";
public static final String EX_ACCOUNT ="whaleextrust";
public static final String API_KEY = "APIKey";


/**
* HTTP Header to be used for API-KEY authentication.
*/
public static final String API_KEY = "APIKey";
public static final String USER_EOSACCOUNT="your_eosaccount";


}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ApiServiceTest {
// 登录获取access token
@Test
public void testLogin() throws IOException {
final String cn = apiService.getUserToken("15838261714", "qweqwe123", "CN");
final String cn = apiService.getUserToken("", "", "");
System.out.println(cn);

}
Expand All @@ -34,22 +34,22 @@ public void testGenKeyPair() throws IOException {
// 向服务器注册公钥
@Test
public void testRegisterPk() throws IOException {
String token="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJDTjo6MTU4MzgyNjE3MTQiLCJncm91cElkIjoxLCJpc0FkbWluIjpmYWxzZSwiYnlQYXNzd29yZCI6dHJ1ZSwiaGFzUGFzc3dvcmQiOnRydWUsInR5cGUiOiJsb2dpbiIsImNsaWVudF9pZCI6ImNsaWVudCIsImF1ZCI6WyJvYXV0aDItcmVzb3VyY2UiXSwicGhvbmUiOiIxNTgzODI2MTcxNCIsImNvdW50cnlDb2RlIjoiQ04iLCJzY29wZSI6WyJhbGwiXSwiaWQiOjIxLCJleHAiOjE1NDM1MTM1OTQsImp0aSI6IjhhNzhjYTczLWZhNTYtNDMzYi1hYjdjLWZkMTE0MGM5MDhlMCJ9.dJvS2-vHr-ewr9kanrxthUGmHE9TC49QWDK8WrNJvj5BJ11jAuIwk6VJ02kf4XQBYYTRkvrr8unmHg05F9U_IYKX9iRxn154F61nnS7RqmaH-GSYvrK3-L0Lz1aDnHJgGZVCCBQ8wSSNmEyE_1CcI_bBJI9e_GOQ9yXXPIE7ZJoJ-AqbcVvG_C3bvxIXGVm4Y5wRkC_nxplK0YDWg4dURydOhpMS2CJLY9jsETFibhqxZO9APT7m3QopCt8oTeZl-osCzEaFmBdc6xQO4poxY7GUxz1yjCqpl4pmF12s8ar0_eM9RRcjofcoO-1QtOQCZiPQ5NvuwimOaeuvDcgdMQ";
String token="";
apiService.registerPK(token,StoreUtils.getStorePublicKey());
}

// 检查公钥绑定状态
@Test
public void testChectPk() throws IOException {
String token="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJDTjo6MTU4MzgyNjE3MTQiLCJncm91cElkIjoxLCJpc0FkbWluIjpmYWxzZSwiYnlQYXNzd29yZCI6dHJ1ZSwiaGFzUGFzc3dvcmQiOnRydWUsInR5cGUiOiJsb2dpbiIsImNsaWVudF9pZCI6ImNsaWVudCIsImF1ZCI6WyJvYXV0aDItcmVzb3VyY2UiXSwicGhvbmUiOiIxNTgzODI2MTcxNCIsImNvdW50cnlDb2RlIjoiQ04iLCJzY29wZSI6WyJhbGwiXSwiaWQiOjIxLCJleHAiOjE1NDM1MDE0MTcsImp0aSI6IjA1YzIzMDY5LTQ0NGEtNDU2MS1hOWJmLTBlMTBmYTI2MWVlNCJ9.nU9cm0zjTi3NmnMZ7FkpnNuOxw82V5ObPNfQERV7j2Qpz0ymqgViip7n-LlSZ2XmEYb5RxLbAtacloAGopyKaPj-sw8BP0tQ3VhN80vZPmJFSulwgKmwxcGZxuQDiJzjU1qRyA8ziUARdf7j6yu08v8VnJ7Iw9bDuWGUj184rfb9owg1ILMT6nQu20lyeQm2RpEYwsYcbTdVbe6XKM1sGpECx4qDA9S-LzR1IK5PutqVL_9p9JMSjGvgoQg74V2wri2gMF7iLQQcNYk592enYcza85IzyboygrVHxbqc9LUqMu3aoIoj8hcurByMTxyo33bnQLeZa9suknd3ToP2hQ";
String token="";
CommonResponse<PublicKeyResponse> response = apiService.checkPkBindStatus(token, StoreUtils.getStorePublicKey());
System.out.println(response.getResult());
}

// 生成API key
@Test
public void testGenAPIKey() throws IOException {
String token="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJDTjo6MTU4MzgyNjE3MTQiLCJncm91cElkIjoxLCJpc0FkbWluIjpmYWxzZSwiYnlQYXNzd29yZCI6dHJ1ZSwiaGFzUGFzc3dvcmQiOnRydWUsInR5cGUiOiJsb2dpbiIsImNsaWVudF9pZCI6ImNsaWVudCIsImF1ZCI6WyJvYXV0aDItcmVzb3VyY2UiXSwicGhvbmUiOiIxNTgzODI2MTcxNCIsImNvdW50cnlDb2RlIjoiQ04iLCJzY29wZSI6WyJhbGwiXSwiaWQiOjIxLCJleHAiOjE1NDM1MDE0MTcsImp0aSI6IjA1YzIzMDY5LTQ0NGEtNDU2MS1hOWJmLTBlMTBmYTI2MWVlNCJ9.nU9cm0zjTi3NmnMZ7FkpnNuOxw82V5ObPNfQERV7j2Qpz0ymqgViip7n-LlSZ2XmEYb5RxLbAtacloAGopyKaPj-sw8BP0tQ3VhN80vZPmJFSulwgKmwxcGZxuQDiJzjU1qRyA8ziUARdf7j6yu08v8VnJ7Iw9bDuWGUj184rfb9owg1ILMT6nQu20lyeQm2RpEYwsYcbTdVbe6XKM1sGpECx4qDA9S-LzR1IK5PutqVL_9p9JMSjGvgoQg74V2wri2gMF7iLQQcNYk592enYcza85IzyboygrVHxbqc9LUqMu3aoIoj8hcurByMTxyo33bnQLeZa9suknd3ToP2hQ";
String token="";
String apiKey = apiService.generateApiKey(token).getResult().toString();
StoreUtils.storeAPIKey(apiKey);
}
Expand Down

0 comments on commit eaa37be

Please sign in to comment.