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
81843912
Commit
81843912
authored
Oct 11, 2024
by
ml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加接口、逻辑调整
parent
55654328
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
612 additions
and
5 deletions
+612
-5
coinTypeApply.control.ts
src/functional/mvc/control/coinTypeApply.control.ts
+0
-0
cronApply.control.ts
src/functional/mvc/control/cronApply.control.ts
+0
-0
pairApply.control.ts
src/functional/mvc/control/pairApply.control.ts
+0
-0
spotData.control.ts
src/functional/mvc/control/spotData.control.ts
+166
-0
spotData.service.ts
src/functional/mvc/service/spotData.service.ts
+425
-0
index.ts
src/functional/router/v1/index.ts
+12
-4
access-limit.ts
src/setting/access-limit.ts
+9
-1
No files found.
src/functional/mvc/control/coinTypeApply.ts
→
src/functional/mvc/control/coinTypeApply.
control.
ts
View file @
81843912
File moved
src/functional/mvc/control/cronApply.ts
→
src/functional/mvc/control/cronApply.
control.
ts
View file @
81843912
File moved
src/functional/mvc/control/pairApply.ts
→
src/functional/mvc/control/pairApply.
control.
ts
View file @
81843912
File moved
src/functional/mvc/control/spotData.control.ts
0 → 100644
View file @
81843912
import
*
as
cronApplyService
from
"../service/spotData.service"
;
import
{
QueryVO
}
from
"../service/spotData.service"
;
let
{
logger
,
Res3Utils
,
optionalUtils
:
Optional
,
apiAssertUtils
:
ApiAssert
,
datetimeUtils
}
=
require
(
'@madex/ex-js-public'
);
let
isIp
=
require
(
'is-ip'
);
/**
* 运营部-现货-现货数据-新增用户
* @param req
* @param infoVO
*/
export
const
increaseUserList
=
async
(
req
:
any
,
pageVO
:
QueryVO
)
=>
{
let
func_name
=
"spotData.control.increaseUserList"
;
try
{
//初始化查询参数
initParam
(
pageVO
);
let
res
=
await
cronApplyService
.
increaseUserList
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
/**
* 运营部-现货-现货数据-新增用户
* @param req
* @param infoVO
*/
export
const
tradeUserList
=
async
(
req
:
any
,
pageVO
:
QueryVO
)
=>
{
let
func_name
=
"spotData.control.tradeUserList"
;
try
{
//初始化查询参数
initParam
(
pageVO
);
let
res
=
await
cronApplyService
.
tradeUserList
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
/**
* 运营部-现货-现货数据-活跃用户
* @param req
* @param infoVO
*/
export
const
activeUserList
=
async
(
req
:
any
,
pageVO
:
QueryVO
)
=>
{
let
func_name
=
"spotData.control.activeUserList"
;
try
{
//初始化查询参数
initParam
(
pageVO
);
let
res
=
await
cronApplyService
.
activeUserList
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
/**
* 运营部-现货-现货数据-充值额
* @param req
* @param infoVO
*/
export
const
userDepositList
=
async
(
req
:
any
,
pageVO
:
QueryVO
)
=>
{
let
func_name
=
"spotData.control.userDepositList"
;
try
{
//初始化查询参数
initParam
(
pageVO
);
let
res
=
await
cronApplyService
.
userDepositList
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
/**
* 运营部-现货-现货数据-提现额
* @param req
* @param infoVO
*/
export
const
userWithdrawList
=
async
(
req
:
any
,
pageVO
:
QueryVO
)
=>
{
let
func_name
=
"spotData.control.userWithdrawList"
;
try
{
//初始化查询参数
initParam
(
pageVO
);
let
res
=
await
cronApplyService
.
userWithdrawList
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
/**
* 运营部-现货-现货数据-净充值额
* @param req
* @param infoVO
*/
export
const
userDepositAndWithdrawList
=
async
(
req
:
any
,
pageVO
:
QueryVO
)
=>
{
let
func_name
=
"spotData.control.userDepositAndWithdrawList"
;
try
{
//初始化查询参数
initParam
(
pageVO
);
let
res
=
await
cronApplyService
.
userDepositAndWithdrawList
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
/**
* 运营部-现货-现货数据-数据汇总
* @param req
* @param infoVO
*/
export
const
gatherData
=
async
(
req
:
any
,
pageVO
:
QueryVO
)
=>
{
let
func_name
=
"spotData.control.gatherData"
;
try
{
//初始化查询参数
initParam
(
pageVO
);
let
res
=
await
cronApplyService
.
gatherData
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
function
initParam
(
pageVO
:
QueryVO
)
{
pageVO
.
page
=
Optional
.
opt
(
pageVO
,
'page'
,
1
);
pageVO
.
size
=
Optional
.
opt
(
pageVO
,
'size'
,
20
);
let
now
=
new
Date
();
let
today
=
datetimeUtils
.
trim
(
now
,
'd'
);
let
yesterday
=
datetimeUtils
.
sub
(
today
,
datetimeUtils
.
DAY
);
if
(
!
pageVO
.
from_time
)
{
pageVO
.
from_time
=
yesterday
;
}
if
(
!
pageVO
.
to_time
)
{
pageVO
.
to_time
=
today
;
}
}
src/functional/mvc/service/spotData.service.ts
0 → 100644
View file @
81843912
This diff is collapsed.
Click to expand it.
src/functional/router/v1/index.ts
View file @
81843912
...
...
@@ -42,9 +42,10 @@ import * as contractMarketMakerCtrl from "../../mvc/control/contractMarketMaker.
import
*
as
contractLimitTradeCtrl
from
"../../mvc/control/contractLimitTrade.control"
;
import
*
as
contractAgentCtrl
from
"../../mvc/control/contractAgent.control"
;
import
*
as
depositAndWithdrawCtrl
from
"../../mvc/control/depositAndWithdraw.control"
;
import
*
as
coinTypeApplyCtrl
from
"../../mvc/control/coinTypeApply"
;
import
*
as
pairApplyCtrl
from
"../../mvc/control/pairApply"
;
import
*
as
cronApplyCtrl
from
"../../mvc/control/cronApply"
;
import
*
as
coinTypeApplyCtrl
from
"../../mvc/control/coinTypeApply.control"
;
import
*
as
pairApplyCtrl
from
"../../mvc/control/pairApply.control"
;
import
*
as
cronApplyCtrl
from
"../../mvc/control/cronApply.control"
;
import
*
as
spotDataCtrl
from
"../../mvc/control/spotData.control"
;
const
getFunc
=
{
'user/info'
:
userController
.
getUserInfo
,
...
...
@@ -255,7 +256,14 @@ const postFunc = {
//'tech/apply/new/cron/pair/add/hide': cronApplyCtrl.addHide,//TODO:增加隐藏交易对定时器 原来有 is_active is_hide 的逻辑 现在spot_pairs 没有相关字段 ???
'tech/apply/new/cron/coin/add/deposit'
:
cronApplyCtrl
.
addDeposit
,
//增加新币充值定时器
'tech/apply/new/cron/coin/add/withdraw'
:
cronApplyCtrl
.
addWithdraw
,
//增加新币提现定时器
//运营部-现货-现货数据
'operate/spot/data/increase/user/list'
:
spotDataCtrl
.
increaseUserList
,
'operate/spot/data/trade/user/list'
:
spotDataCtrl
.
tradeUserList
,
//TODO
'operate/spot/data/active/user/list'
:
spotDataCtrl
.
activeUserList
,
'operate/spot/data/user/deposit/list'
:
spotDataCtrl
.
userDepositList
,
'operate/spot/data/user/withdraw/list'
:
spotDataCtrl
.
userWithdrawList
,
'operate/spot/data/user/depositAndWithdraw/list'
:
spotDataCtrl
.
userDepositAndWithdrawList
,
'operate/spot/data/user/gatherData'
:
spotDataCtrl
.
gatherData
,
};
// TODO 这里先和 nodejs 的注册路由方式保持一样,后面在调整。
...
...
src/setting/access-limit.ts
View file @
81843912
'use strict'
;
import
*
as
ReqUtils
from
"../utils/req-utils"
;
import
*
as
pairApplyCtrl
from
"../functional/mvc/control/pairApply"
;
import
*
as
pairApplyCtrl
from
"../functional/mvc/control/pairApply
.control
"
;
const
{
Res3Utils
,
...
...
@@ -201,6 +201,14 @@ let cmdWhiteList = {
'tech/apply/new/cron/delete'
:
1
,
'tech/apply/new/cron/coin/add/deposit'
:
1
,
'tech/apply/new/cron/coin/add/withdraw'
:
1
,
//运营部-现货-现货数据
'operate/spot/data/increase/user/list'
:
1
,
'operate/spot/data/trade/user/list'
:
1
,
'operate/spot/data/active/user/list'
:
1
,
'operate/spot/data/user/deposit/list'
:
1
,
'operate/spot/data/user/withdraw/list'
:
1
,
'operate/spot/data/user/depositAndWithdraw/list'
:
1
,
'operate/spot/data/user/gatherData'
:
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