Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
8bed813d
Commit
8bed813d
authored
Jul 22, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into 'master'
资产 See merge request
!351
parents
ecb1e9ba
e43a249e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
TrusteeShipService.php
common/service/trusteeship/TrusteeShipService.php
+5
-0
AssetController.php
wallet/controllers/AssetController.php
+53
-0
No files found.
common/service/trusteeship/TrusteeShipService.php
View file @
8bed813d
...
@@ -158,4 +158,9 @@ class TrusteeShipService
...
@@ -158,4 +158,9 @@ class TrusteeShipService
return
$this
->
send
(
"POST"
,
$uri
,
$params
);
return
$this
->
send
(
"POST"
,
$uri
,
$params
);
}
}
public
function
handleAsset
(
$uri
,
$method
,
$params
)
{
return
$this
->
send
(
$method
,
$uri
,
$params
);
}
}
}
wallet/controllers/AssetController.php
0 → 100644
View file @
8bed813d
<?php
namespace
wallet\controllers
;
use
Yii
;
use
yii\helpers\ArrayHelper
;
use
wallet\base\BaseController
;
use
common\models\psources\CoinPlatform
;
use
common\models\psources\CoinCurrency
;
use
common\models\psources\CoinSupportedCurrency
;
use
common\service\trusteeship\TrusteeShipService
;
class
AssetController
extends
BaseController
{
public
function
actionIndex
()
{
$current_platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
if
(
1
===
$current_platform_id
)
{
$platform_id
=
Yii
::
$app
->
request
->
get
(
'platform_id'
,
1
);
$platform_id
=
empty
(
$platform_id
)
?
1
:
$platform_id
;
}
else
{
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
}
if
(
!
isset
(
Yii
::
$app
->
params
[
'trusteeship'
][
'node_'
.
$platform_id
]))
{
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'此钱包节点尚未开通'
];
}
$node_params
=
Yii
::
$app
->
params
[
'trusteeship'
][
'node_'
.
$platform_id
];
$uri
=
Yii
::
$app
->
request
->
post
(
'uri'
,
''
);
$method
=
Yii
::
$app
->
request
->
post
(
'method'
,
'GET'
);
$params
=
Yii
::
$app
->
request
->
post
(
'params'
,
''
);
$time
=
time
();
$appKey
=
isset
(
$node_params
[
'appKey'
])
?
$node_params
[
'appKey'
]
:
null
;
$appSecret
=
isset
(
$node_params
[
'appSecret'
])
?
$node_params
[
'appSecret'
]
:
null
;
$signature
=
self
::
getSign
(
$params
,
$appKey
,
$appSecret
,
$time
);
$headers
=
[
'FZM-Wallet-Signature'
=>
$signature
,
'FZM-Wallet-Timestamp'
=>
$time
,
'FZM-Wallet-AppKey'
=>
$appKey
,
'FZM-Wallet-AppIp'
=>
Yii
::
$app
->
request
->
userIP
];
$service
=
new
TrusteeShipService
(
$node_params
,
$headers
);
$result
=
$service
->
handleAsset
(
$uri
,
$method
,
$params
);
if
(
200
!==
$result
[
'code'
])
{
return
[
'code'
=>
$result
[
'code'
],
'data'
=>
[],
'msg'
=>
$result
[
'msg'
]];
}
return
[
'code'
=>
1
,
'data'
=>
$result
[
'msg'
],
'msg'
=>
'success'
];
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment