Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Third.Chinaerdos.V4.5
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
陶然
Kivii.Third.Chinaerdos.V4.5
Commits
e74f2fd7
Commit
e74f2fd7
authored
Jan 09, 2025
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
540887cc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
14 deletions
+20
-14
ErdosBase.cs
Src/Entities/ErdosBase.cs
+10
-10
OrderExtension.cs
Src/Extensions/OrderExtension.cs
+2
-2
OrderRequest.cs
Src/Requests/OrderRequest.cs
+8
-2
No files found.
Src/Entities/ErdosBase.cs
View file @
e74f2fd7
...
@@ -74,15 +74,15 @@ namespace Kivii.Third.Chinaerdos.Entities
...
@@ -74,15 +74,15 @@ namespace Kivii.Third.Chinaerdos.Entities
public
object
OnPullThirdReport
()
public
object
OnPullThirdReport
()
{
{
//throw new Exception("请使用三六一专用拉取订单接口!");
//throw new Exception("请使用三六一专用拉取订单接口!");
#
region
设置缓存
1
分钟内不能连续请求
//
#region 设置缓存1分钟内不能连续请求
var
cache
=
KiviiContext
.
GetCacheClient
();
//
var cache = KiviiContext.GetCacheClient();
var
cacheKey
=
KiviiContext
.
GetUrnKey
(
$"
{
typeof
(
ErdosOrder
).
FullName
}
.PullOrder:LockedOneMinute"
);
//
var cacheKey = KiviiContext.GetUrnKey($"{typeof(ErdosOrder).FullName}.PullOrder:LockedOneMinute");
var
cacheValue
=
cache
.
Get
<
string
>(
cacheKey
);
//
var cacheValue = cache.Get<string>(cacheKey);
if
(!
cacheValue
.
IsNullOrEmpty
())
//
if (!cacheValue.IsNullOrEmpty())
{
//
{
throw
new
Exception
(
cacheValue
);
//
throw new Exception(cacheValue);
}
//
}
#
endregion
//
#endregion
var
rtns
=
new
RestfulQueryResponse
<
ThirdReportOrder
>();
var
rtns
=
new
RestfulQueryResponse
<
ThirdReportOrder
>();
...
@@ -91,7 +91,7 @@ namespace Kivii.Third.Chinaerdos.Entities
...
@@ -91,7 +91,7 @@ namespace Kivii.Third.Chinaerdos.Entities
DateTime
maxTranslateTime
=
conn
.
Scalar
<
ThirdReportOrder
,
DateTime
>(
o
=>
Sql
.
Max
(
o
.
OperateTime
),
p
=>
p
.
ThirdType
==
typeof
(
ErdosOrder
).
FullName
);
DateTime
maxTranslateTime
=
conn
.
Scalar
<
ThirdReportOrder
,
DateTime
>(
o
=>
Sql
.
Max
(
o
.
OperateTime
),
p
=>
p
.
ThirdType
==
typeof
(
ErdosOrder
).
FullName
);
//DateTime maxTranslateTime = conn.Scalar<ThirdReportOrder, DateTime>(o => Sql.Max(o.OperateTime));
//DateTime maxTranslateTime = conn.Scalar<ThirdReportOrder, DateTime>(o => Sql.Max(o.OperateTime));
var
response
=
client
.
PullOrders
(
Configs
.
_token
,
Configs
.
_secret
,
maxTranslateTime
);
var
response
=
client
.
PullOrders
(
Configs
.
_token
,
Configs
.
_secret
,
maxTranslateTime
);
cache
.
Set
(
cacheKey
,
"一分钟内不可多次查询!"
,
TimeSpan
.
FromMinutes
(
1
));
//
cache.Set(cacheKey, "一分钟内不可多次查询!", TimeSpan.FromMinutes(1));
(
response
.
code
!=
200
).
ThrowIfTrue
(
response
.
message
);
(
response
.
code
!=
200
).
ThrowIfTrue
(
response
.
message
);
rtns
.
Results
=
new
List
<
ThirdReportOrder
>();
rtns
.
Results
=
new
List
<
ThirdReportOrder
>();
...
...
Src/Extensions/OrderExtension.cs
View file @
e74f2fd7
...
@@ -38,8 +38,8 @@ namespace Kivii.Third.Chinaerdos.Extensions
...
@@ -38,8 +38,8 @@ namespace Kivii.Third.Chinaerdos.Extensions
getWtsListRequest
.
signature
=
signature
;
getWtsListRequest
.
signature
=
signature
;
getWtsListRequest
.
timestamp
=
timeStamp
;
getWtsListRequest
.
timestamp
=
timeStamp
;
getWtsListRequest
.
length
=
length
;
getWtsListRequest
.
length
=
length
;
if
(
beginTime
!=
null
&&
beginTime
.
Value
!=
DateTime
.
MinValue
)
getWtsListRequest
.
beginTime
=
beginTime
.
Value
;
if
(
beginTime
!=
null
&&
beginTime
.
Value
!=
DateTime
.
MinValue
)
getWtsListRequest
.
beginTime
=
beginTime
.
Value
.
ToString
(
"yyyy-MM-dd"
)
;
if
(
endTime
!=
null
&&
endTime
.
Value
!=
DateTime
.
MinValue
)
getWtsListRequest
.
endTime
=
endTime
.
Value
;
if
(
endTime
!=
null
&&
endTime
.
Value
!=
DateTime
.
MinValue
)
getWtsListRequest
.
endTime
=
endTime
.
Value
.
ToString
(
"yyyy-MM-dd"
)
;
var
response
=
_client
.
Get
(
getWtsListRequest
);
var
response
=
_client
.
Get
(
getWtsListRequest
);
return
response
;
return
response
;
...
...
Src/Requests/OrderRequest.cs
View file @
e74f2fd7
...
@@ -43,16 +43,22 @@ namespace Kivii.Third.Chinaerdos.Requests
...
@@ -43,16 +43,22 @@ namespace Kivii.Third.Chinaerdos.Requests
public
string
timestamp
{
get
;
set
;
}
public
string
timestamp
{
get
;
set
;
}
[
ApiMember
(
Description
=
"时间(从)可填"
)]
[
ApiMember
(
Description
=
"时间(从)可填"
)]
public
DateTime
?
beginTime
{
get
;
set
;
}
public
string
beginTime
{
get
;
set
;
}
[
ApiMember
(
Description
=
"时间(到)可填"
)]
[
ApiMember
(
Description
=
"时间(到)可填"
)]
public
DateTime
?
endTime
{
get
;
set
;
}
public
string
endTime
{
get
;
set
;
}
[
ApiMember
(
Description
=
"返回记录数(可填,默认为10)"
)]
[
ApiMember
(
Description
=
"返回记录数(可填,默认为10)"
)]
public
int
length
{
get
;
set
;
}
public
int
length
{
get
;
set
;
}
[
ApiMember
(
Description
=
"记录偏移量(可填,默认为0)"
)]
[
ApiMember
(
Description
=
"记录偏移量(可填,默认为0)"
)]
public
int
start
{
get
;
set
;
}
public
int
start
{
get
;
set
;
}
/// <summary>
/// 0-草稿,5-品牌待审,10-发送,20-接收,40-取消,100-已完成。默认进行中:10
/// </summary>
[
ApiMember
(
Description
=
"0-草稿,5-品牌待审,10-发送,20-接收,40-取消,100-已完成。默认进行中:10"
)]
public
int
status
{
get
;
set
;
}
}
}
/// <summary>
/// <summary>
...
...
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