Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OTWebSocketHub
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
李福茂
OTWebSocketHub
Commits
272fe64d
Commit
272fe64d
authored
Jun 09, 2021
by
Maodashu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复websocket成交记录解析bug
parent
b5d1fec8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
WebSocketService.cs
OTWebSocket.API/Services/WebSocketService.cs
+4
-4
No files found.
OTWebSocket.API/Services/WebSocketService.cs
View file @
272fe64d
...
...
@@ -159,13 +159,13 @@ namespace OTWebSocket.API.Services
liveOrder
.
OTUpdateTimestamp
=
orderJson
[
"exchange_update"
].
ToObject
<
DateTime
>().
ToUniversalTime
();
liveOrder
.
UpdateTimestamp
=
Timestamp
.
Now
;
liveOrder
.
Status
=
orderJson
[
"status"
].
ToString
();
if
(
orderJson
[
"last_trans"
]
!=
null
)
if
(
orderJson
[
"last_trans"
]
!=
null
&&
orderJson
[
"last_trans"
].
HasValues
)
{
string
tid
=
orderJson
[
"last_trans"
][
"exchange_tid"
].
ToString
();
OTDealInfo
dealInfo
=
new
OTDealInfo
();
dealInfo
.
Id
=
tid
;
dealInfo
.
TradeTime
=
orderJson
[
"last_trans"
][
"dealt_time"
].
ToObject
<
DateTime
>()
.
ToUniversalTime
()
;
dealInfo
.
DealtAmount
=
orderJson
[
"last_trans"
][
"
acc
ount"
].
ToObject
<
decimal
>();
dealInfo
.
TradeTime
=
orderJson
[
"last_trans"
][
"dealt_time"
].
ToObject
<
DateTime
>();
dealInfo
.
DealtAmount
=
orderJson
[
"last_trans"
][
"
dealt_am
ount"
].
ToObject
<
decimal
>();
dealInfo
.
DealtPrice
=
orderJson
[
"last_trans"
][
"dealt_price"
].
ToObject
<
decimal
>();
dealInfo
.
DealtVolume
=
dealInfo
.
DealtAmount
*
dealInfo
.
DealtPrice
;
dealInfo
.
Commission
=
orderJson
[
"last_trans"
][
"commission"
].
ToObject
<
decimal
>();
...
...
@@ -176,7 +176,7 @@ namespace OTWebSocket.API.Services
liveOrder
.
Deals
.
Add
(
dealInfo
);
}
}
liveOrder
.
Comment
=
"WS更新成功"
;
//
liveOrder.Comment = "WS更新成功";
_logger
.
Debug
(
$"更新redis缓存
{
JObject
.
FromObject
(
liveOrder
)}
"
);
_redisService
.
SetLiveOrder
(
liveOrder
);
...
...
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