Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
ts-api-demo
Project
Project
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
wmvm
ts-api-demo
Commits
fcf4263f
Commit
fcf4263f
authored
Sep 27, 2024
by
ml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加接口、逻辑调整
parent
0f027491
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
159 additions
and
0 deletions
+159
-0
contractLimitTrade.control.ts
src/functional/mvc/control/contractLimitTrade.control.ts
+4
-0
depositAndWithdraw.control.ts
src/functional/mvc/control/depositAndWithdraw.control.ts
+46
-0
depositAndWithdraw.service.ts
src/functional/mvc/service/depositAndWithdraw.service.ts
+100
-0
index.ts
src/functional/router/v1/index.ts
+5
-0
access-limit.ts
src/setting/access-limit.ts
+4
-0
No files found.
src/functional/mvc/control/contractLimitTrade.control.ts
View file @
fcf4263f
...
@@ -45,6 +45,7 @@ export const list = async (req: any, limitTradeVO: LimitTradeVO) => {
...
@@ -45,6 +45,7 @@ export const list = async (req: any, limitTradeVO: LimitTradeVO) => {
let
status
=
limitTradeVO
.
status
;
let
status
=
limitTradeVO
.
status
;
let
pair
=
limitTradeVO
.
pair
;
let
pair
=
limitTradeVO
.
pair
;
let
userId
=
limitTradeVO
.
user_id
;
let
userId
=
limitTradeVO
.
user_id
;
let
type
=
limitTradeVO
.
type
;
if
(
pair
)
{
if
(
pair
)
{
list
=
list
.
filter
(
item
=>
item
.
pair
==
pair
);
list
=
list
.
filter
(
item
=>
item
.
pair
==
pair
);
...
@@ -55,6 +56,9 @@ export const list = async (req: any, limitTradeVO: LimitTradeVO) => {
...
@@ -55,6 +56,9 @@ export const list = async (req: any, limitTradeVO: LimitTradeVO) => {
if
(
userId
||
userId
===
0
)
{
if
(
userId
||
userId
===
0
)
{
list
=
list
.
filter
(
item
=>
item
.
user_id
==
userId
);
list
=
list
.
filter
(
item
=>
item
.
user_id
==
userId
);
}
}
if
(
type
)
{
list
=
list
.
filter
(
item
=>
item
.
type
==
type
);
}
return
Res3Utils
.
result
(
list
);
return
Res3Utils
.
result
(
list
);
}
}
catch
(
e
)
{
catch
(
e
)
{
...
...
src/functional/mvc/control/depositAndWithdraw.control.ts
0 → 100644
View file @
fcf4263f
import
*
as
depositAndWithdrawService
from
"../service/depositAndWithdraw.service"
;
import
{
QueryVO
}
from
"../service/depositAndWithdraw.service"
;
let
{
logger
,
Res3Utils
,
optionalUtils
:
Optional
,
apiAssertUtils
:
ApiAssert
,
datetimeUtils
}
=
require
(
'@madex/ex-js-public'
);
/**
* 客服部-资金管理-充值列表
* @param req
* @param infoVO
*/
export
const
depositList
=
async
(
req
:
any
,
pageVO
:
QueryVO
)
=>
{
let
func_name
=
"depositAndWithdraw.control.depositList"
;
try
{
pageVO
.
page
=
Optional
.
opt
(
pageVO
,
'page'
,
1
);
pageVO
.
size
=
Optional
.
opt
(
pageVO
,
'size'
,
20
);
let
res
=
await
depositAndWithdrawService
.
depositList
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
/**
* 客服部-资金管理-提现列表
* @param req
* @param infoVO
*/
export
const
withdrawList
=
async
(
req
:
any
,
pageVO
:
QueryVO
)
=>
{
let
func_name
=
"depositAndWithdraw.control.withdrawList"
;
try
{
pageVO
.
page
=
Optional
.
opt
(
pageVO
,
'page'
,
1
);
pageVO
.
size
=
Optional
.
opt
(
pageVO
,
'size'
,
20
);
let
res
=
await
depositAndWithdrawService
.
withdrawList
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
src/functional/mvc/service/depositAndWithdraw.service.ts
0 → 100644
View file @
fcf4263f
import
{
coinTx
,
coinWithdraw
,
ormDB
}
from
"@madex/ex-ts-dao"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
addOptLog
}
from
"./userOptLog.service"
;
let
_
=
require
(
'lodash'
);
let
{
logger
}
=
require
(
'@madex/ex-js-public'
);
export
interface
QueryVO
{
page
?:
number
,
size
?:
number
,
status
?:
number
;
condition
?:
string
;
from_time
?:
Date
|
any
,
to_time
?:
Date
|
any
,
}
export
async
function
depositList
(
pageVO
:
QueryVO
)
{
let
where
=
{};
if
(
pageVO
.
condition
)
{
let
or
=
{
to
:
pageVO
.
condition
,
tx_id
:
pageVO
.
condition
,
coin_symbol
:
pageVO
.
condition
,
}
if
(
!
isNaN
(
Number
(
pageVO
.
condition
)))
{
or
[
'user_id'
]
=
Number
(
pageVO
.
condition
)
}
where
[
ormDB
.
Op
.
or
]
=
or
;
}
if
(
pageVO
.
status
||
pageVO
.
status
===
0
)
{
if
(
pageVO
.
status
===
1
)
{
where
[
'status'
]
=
{
[
ormDB
.
Op
.
gt
]:
0
}
}
else
{
where
[
'status'
]
=
pageVO
.
status
}
}
if
(
pageVO
.
from_time
&&
pageVO
.
to_time
)
{
where
[
'createdAt'
]
=
{
[
ormDB
.
Op
.
between
]:
[
pageVO
.
from_time
,
pageVO
.
to_time
]
}
}
let
resList
=
await
coinTx
.
prototype
.
findAndCount
({
where
:
where
,
limit
:
pageVO
.
size
,
offset
:
(
Number
(
pageVO
.
page
)
-
1
)
*
Number
(
pageVO
.
size
),
order
:
[[
"createdAt"
,
"desc"
]],
raw
:
true
});
return
resList
;
}
export
async
function
withdrawList
(
pageVO
:
QueryVO
)
{
let
where
=
{};
if
(
pageVO
.
condition
)
{
let
or
=
{
to_address
:
pageVO
.
condition
,
tx_id
:
pageVO
.
condition
,
coin_symbol
:
pageVO
.
condition
,
}
if
(
!
isNaN
(
Number
(
pageVO
.
condition
)))
{
or
[
'user_id'
]
=
Number
(
pageVO
.
condition
)
}
where
[
ormDB
.
Op
.
or
]
=
or
}
if
(
pageVO
.
status
||
pageVO
.
status
===
0
)
{
if
(
pageVO
.
status
===
-
1
)
{
where
[
'status'
]
=
{
[
ormDB
.
Op
.
lt
]:
0
}
}
else
{
where
[
'status'
]
=
pageVO
.
status
}
}
if
(
pageVO
.
from_time
&&
pageVO
.
to_time
)
{
where
[
'createdAt'
]
=
{
[
ormDB
.
Op
.
between
]:
[
pageVO
.
from_time
,
pageVO
.
to_time
]
}
}
let
resList
=
await
coinWithdraw
.
prototype
.
findAndCount
({
where
:
where
,
limit
:
pageVO
.
size
,
offset
:
(
Number
(
pageVO
.
page
)
-
1
)
*
Number
(
pageVO
.
size
),
order
:
[[
"createdAt"
,
"desc"
]],
raw
:
true
});
return
resList
;
}
src/functional/router/v1/index.ts
View file @
fcf4263f
...
@@ -41,6 +41,7 @@ import * as spotMarketMakerCtrl from "../../mvc/control/spotMarketMaker.control"
...
@@ -41,6 +41,7 @@ import * as spotMarketMakerCtrl from "../../mvc/control/spotMarketMaker.control"
import
*
as
contractMarketMakerCtrl
from
"../../mvc/control/contractMarketMaker.control"
;
import
*
as
contractMarketMakerCtrl
from
"../../mvc/control/contractMarketMaker.control"
;
import
*
as
contractLimitTradeCtrl
from
"../../mvc/control/contractLimitTrade.control"
;
import
*
as
contractLimitTradeCtrl
from
"../../mvc/control/contractLimitTrade.control"
;
import
*
as
contractAgentCtrl
from
"../../mvc/control/contractAgent.control"
;
import
*
as
contractAgentCtrl
from
"../../mvc/control/contractAgent.control"
;
import
*
as
depositAndWithdrawCtrl
from
"../../mvc/control/depositAndWithdraw.control"
;
const
getFunc
=
{
const
getFunc
=
{
'user/info'
:
userController
.
getUserInfo
,
'user/info'
:
userController
.
getUserInfo
,
...
@@ -219,6 +220,10 @@ const postFunc = {
...
@@ -219,6 +220,10 @@ const postFunc = {
//金融部-其他管理-合约渠道用户管理(代理商渠道)
//金融部-其他管理-合约渠道用户管理(代理商渠道)
'fiance/other/contract/agent/channel/set'
:
contractAgentCtrl
.
agentChannelSet
,
'fiance/other/contract/agent/channel/set'
:
contractAgentCtrl
.
agentChannelSet
,
'fiance/other/contract/agent/channel/list'
:
contractAgentCtrl
.
agentChannelList
,
'fiance/other/contract/agent/channel/list'
:
contractAgentCtrl
.
agentChannelList
,
//客服部-资金管理-充值管理
'custom/fund/deposit/record/list'
:
depositAndWithdrawCtrl
.
depositList
,
//客服部-资金管理-提现管理
'custom/fund/withdraw/record/list'
:
depositAndWithdrawCtrl
.
withdrawList
,
};
};
// TODO 这里先和 nodejs 的注册路由方式保持一样,后面在调整。
// TODO 这里先和 nodejs 的注册路由方式保持一样,后面在调整。
...
...
src/setting/access-limit.ts
View file @
fcf4263f
...
@@ -171,6 +171,10 @@ let cmdWhiteList = {
...
@@ -171,6 +171,10 @@ let cmdWhiteList = {
//金融部-其他管理-合约渠道用户管理(代理商渠道)
//金融部-其他管理-合约渠道用户管理(代理商渠道)
'fiance/other/contract/agent/channel/set'
:
1
,
'fiance/other/contract/agent/channel/set'
:
1
,
'fiance/other/contract/agent/channel/list'
:
1
,
'fiance/other/contract/agent/channel/list'
:
1
,
//客服部-资金管理-充值管理
'custom/fund/deposit/record/list'
:
1
,
//客服部-资金管理-提现管理
'custom/fund/withdraw/record/list'
:
1
,
};
};
...
...
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