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
d41ae882
Commit
d41ae882
authored
Oct 16, 2024
by
ml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上交易对申请逻辑调整、增加接口、部分逻辑接口调整
parent
17c356ce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
356 additions
and
184 deletions
+356
-184
errorCode.ts
src/constant/errorCode.ts
+1
-0
contractPair.control.ts
src/functional/mvc/control/contractPair.control.ts
+10
-2
mUserAssets.control.ts
src/functional/mvc/control/mUserAssets.control.ts
+48
-0
pairApply.control.ts
src/functional/mvc/control/pairApply.control.ts
+14
-28
appVersion.service.ts
src/functional/mvc/service/appVersion.service.ts
+2
-0
coinType.service.ts
src/functional/mvc/service/coinType.service.ts
+1
-1
contractPair.service.ts
src/functional/mvc/service/contractPair.service.ts
+4
-0
cronApply.service.ts
src/functional/mvc/service/cronApply.service.ts
+0
-1
depositAndWithdraw.service.ts
src/functional/mvc/service/depositAndWithdraw.service.ts
+1
-1
mUserAssets.service.ts
src/functional/mvc/service/mUserAssets.service.ts
+38
-1
pairApply.service.ts
src/functional/mvc/service/pairApply.service.ts
+189
-146
spotPair.service.ts
src/functional/mvc/service/spotPair.service.ts
+5
-0
index.ts
src/functional/router/v1/index.ts
+4
-2
access-limit.ts
src/setting/access-limit.ts
+4
-2
coinTypeUtils.ts
src/utils/coinTypeUtils.ts
+35
-0
No files found.
src/constant/errorCode.ts
View file @
d41ae882
...
@@ -75,4 +75,5 @@ export const ErrorCode = {
...
@@ -75,4 +75,5 @@ export const ErrorCode = {
NO_TRIGGER_DEL
:
'30071'
,
//只有未触发的任务可以删除
NO_TRIGGER_DEL
:
'30071'
,
//只有未触发的任务可以删除
EXIST_ACTIVE_PAIR
:
'30072'
,
//已存在生效或即将生效的该交易对费率配置
EXIST_ACTIVE_PAIR
:
'30072'
,
//已存在生效或即将生效的该交易对费率配置
FEE_EX_OR_DEL
:
'30073'
,
//费率设置已过期或已删除,不可以修改
FEE_EX_OR_DEL
:
'30073'
,
//费率设置已过期或已删除,不可以修改
PAIR_FORMAT_ERR
:
'30074'
,
//交易对格式错误
}
}
src/functional/mvc/control/contractPair.control.ts
View file @
d41ae882
...
@@ -25,14 +25,22 @@ export const save = async (req: any, param: AddParam) => {
...
@@ -25,14 +25,22 @@ export const save = async (req: any, param: AddParam) => {
let
func_name
=
"contactPairCtl.save"
;
let
func_name
=
"contactPairCtl.save"
;
let
cmd
=
req
.
path
;
let
cmd
=
req
.
path
;
try
{
try
{
ApiAssert
.
notNull
(
'3000'
,
param
.
base
);
ApiAssert
.
notNull
(
'3000'
,
param
.
quote
);
ApiAssert
.
notNull
(
'3000'
,
param
.
symbol
);
ApiAssert
.
notNull
(
'3000'
,
param
.
symbol
);
ApiAssert
.
notNull
(
'3000'
,
param
.
name
);
ApiAssert
.
notNull
(
'3000'
,
param
.
name
);
ApiAssert
.
notNull
(
'3000'
,
param
.
index
);
ApiAssert
.
notNull
(
'3000'
,
param
.
settlement_asset
);
ApiAssert
.
notNull
(
'3000'
,
param
.
price_scale
);
ApiAssert
.
notNull
(
'3000'
,
param
.
price_scale
);
ApiAssert
.
notNull
(
'3000'
,
param
.
quantity_scale
);
ApiAssert
.
notNull
(
'3000'
,
param
.
quantity_scale
);
ApiAssert
.
notNull
(
'3000'
,
param
.
maker_fee
);
ApiAssert
.
notNull
(
'3000'
,
param
.
maker_fee
);
ApiAssert
.
notNull
(
'3000'
,
param
.
taker_fee
);
ApiAssert
.
notNull
(
'3000'
,
param
.
taker_fee
);
ApiAssert
.
notNull
(
'3000'
,
param
.
default_initial_margin
);
ApiAssert
.
notNull
(
'3000'
,
param
.
base_initial_margin
);
ApiAssert
.
notNull
(
'3000'
,
param
.
base_maintenance_margin
);
ApiAssert
.
notNull
(
'3000'
,
param
.
base_interest
);
ApiAssert
.
notNull
(
'3000'
,
param
.
quote_interest
);
ApiAssert
.
notNull
(
'3000'
,
param
.
impact_notional
);
ApiAssert
.
notNull
(
'3000'
,
param
.
base_risk_limit
);
ApiAssert
.
notNull
(
'3000'
,
param
.
risk_limit_step
);
let
ip
=
isIp
(
req
.
ip
)
?
req
.
ip
:
'*.*.*.*'
;
let
ip
=
isIp
(
req
.
ip
)
?
req
.
ip
:
'*.*.*.*'
;
let
currentUserId
=
await
getCurrentUserId
(
req
.
cookies
.
session_id
);
let
currentUserId
=
await
getCurrentUserId
(
req
.
cookies
.
session_id
);
let
res
=
await
service
.
save
(
param
,
currentUserId
,
ip
);
let
res
=
await
service
.
save
(
param
,
currentUserId
,
ip
);
...
...
src/functional/mvc/control/mUserAssets.control.ts
View file @
d41ae882
...
@@ -70,3 +70,51 @@ export const tradeAssetsDetail = async (req: any, queryVO: QueryVO) => {
...
@@ -70,3 +70,51 @@ export const tradeAssetsDetail = async (req: any, queryVO: QueryVO) => {
}
}
};
};
/**
* 充值记录
* @param req
* @param infoVO
*/
export
const
depositList
=
async
(
req
:
any
,
queryVO
:
QueryVO
)
=>
{
let
func_name
=
"mUserAssetsCtrl.depositList"
;
try
{
queryVO
.
page
=
Optional
.
opt
(
queryVO
,
'page'
,
1
);
queryVO
.
size
=
Optional
.
opt
(
queryVO
,
'size'
,
20
);
if
(
!
queryVO
.
user_id
){
throw
ErrorCode
.
PARAM_MISS
}
let
res
=
await
mUserAssetsService
.
depositList
(
queryVO
.
user_id
,
Number
(
queryVO
.
page
),
Number
(
queryVO
.
size
));
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
,
queryVO
:
QueryVO
)
=>
{
let
func_name
=
"mUserAssetsCtrl.withdrawList"
;
try
{
queryVO
.
page
=
Optional
.
opt
(
queryVO
,
'page'
,
1
);
queryVO
.
size
=
Optional
.
opt
(
queryVO
,
'size'
,
20
);
if
(
!
queryVO
.
user_id
){
throw
ErrorCode
.
PARAM_MISS
}
let
res
=
await
mUserAssetsService
.
withdrawList
(
queryVO
.
user_id
,
Number
(
queryVO
.
page
),
Number
(
queryVO
.
size
));
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
src/functional/mvc/control/pairApply.control.ts
View file @
d41ae882
...
@@ -46,25 +46,6 @@ export const listed = async (req: any, pageVO: PairApplyPageVO) => {
...
@@ -46,25 +46,6 @@ export const listed = async (req: any, pageVO: PairApplyPageVO) => {
}
}
};
};
/**
* 技术部-交易上下线管理-已有交易区列表
* @param req
* @param infoVO
*/
export
const
tradeAreaList
=
async
(
req
:
any
,
pageVO
:
PairApplyPageVO
)
=>
{
let
func_name
=
"pairApply.control.tradeAreaList"
;
try
{
pageVO
.
page
=
Optional
.
opt
(
pageVO
,
'page'
,
1
);
pageVO
.
size
=
Optional
.
opt
(
pageVO
,
'size'
,
20
);
let
res
=
await
pairApplyService
.
tradeAreaList
(
pageVO
);
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
/**
/**
* 技术部-交易上下线管理-申请上新交易对
* 技术部-交易上下线管理-申请上新交易对
* @param req
* @param req
...
@@ -201,18 +182,23 @@ export const review = async (req: any, pairApplyVO: PairApplyVO) => {
...
@@ -201,18 +182,23 @@ export const review = async (req: any, pairApplyVO: PairApplyVO) => {
async
function
paramValid
(
pairApplyVO
:
PairApplyVO
)
{
async
function
paramValid
(
pairApplyVO
:
PairApplyVO
)
{
if
(
!
pairApplyVO
.
coin_symbol
||
!
pairApplyVO
.
currency_
symbol
if
(
!
pairApplyVO
.
type
||
!
pairApplyVO
.
symbol
||
!
pairApplyVO
.
decimal
||
!
pairApplyVO
.
qtyPrecision
||
!
pairApplyVO
.
name
||
!
pairApplyVO
.
price_scale
||
!
pairApplyVO
.
weight
||
!
pairApplyVO
.
baseMinValu
e
||
!
pairApplyVO
.
quantity_scale
||
!
pairApplyVO
.
maker_fe
e
||
!
pairApplyVO
.
quoteMinValu
e
)
{
||
!
pairApplyVO
.
taker_fe
e
)
{
throw
ErrorCode
.
PARAM_MISS
;
throw
ErrorCode
.
PARAM_MISS
;
}
}
if
(
!
pairApplyVO
.
pair_type
)
{
//申请上合约交易对
pairApplyVO
.
pair_type
=
0
if
(
pairApplyVO
.
type
==
2
)
{
}
if
(
!
pairApplyVO
.
settlement_asset
||
!
pairApplyVO
.
default_initial_margin
if
(
!
pairApplyVO
.
area_id
)
{
||
!
pairApplyVO
.
base_initial_margin
||
!
pairApplyVO
.
base_maintenance_margin
pairApplyVO
.
area_id
=
0
||
!
pairApplyVO
.
base_interest
||
!
pairApplyVO
.
quote_interest
||
!
pairApplyVO
.
impact_notional
||
!
pairApplyVO
.
base_risk_limit
||
!
pairApplyVO
.
risk_limit_step
)
{
throw
ErrorCode
.
PARAM_MISS
;
}
}
}
if
(
!
pairApplyVO
.
business_area_id
)
{
if
(
!
pairApplyVO
.
business_area_id
)
{
pairApplyVO
.
business_area_id
=
0
pairApplyVO
.
business_area_id
=
0
}
}
...
...
src/functional/mvc/service/appVersion.service.ts
View file @
d41ae882
...
@@ -24,6 +24,8 @@ export interface AppVersionVO {
...
@@ -24,6 +24,8 @@ export interface AppVersionVO {
comment_en
?:
string
;
comment_en
?:
string
;
comment_ja
?:
string
;
platform
?:
number
,
platform
?:
number
,
grayscale_value
?:
number
,
grayscale_value
?:
number
,
...
...
src/functional/mvc/service/coinType.service.ts
View file @
d41ae882
// @madex/ex-ts-dao 是 ts 的 dao, 代码在 bitbucket/ex-js-dao 的 ts 分支上
// @madex/ex-ts-dao 是 ts 的 dao, 代码在 bitbucket/ex-js-dao 的 ts 分支上
import
{
coinType
,
ormDB
,
spotPairs
}
from
"@madex/ex-ts-dao"
;
import
{
coinType
,
ormDB
,
spotPairs
}
from
"@madex/ex-ts-dao"
;
import
{
addCoin2Core
,
addPairToCore
}
from
"../../../utils/coreSystemUtils"
;
import
{
addCoin2Core
}
from
"../../../utils/coreSystemUtils"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
addOptLog
}
from
"./userOptLog.service"
;
import
{
addOptLog
}
from
"./userOptLog.service"
;
...
...
src/functional/mvc/service/contractPair.service.ts
View file @
d41ae882
...
@@ -4,6 +4,7 @@ import { NUMBER } from "sequelize";
...
@@ -4,6 +4,7 @@ import { NUMBER } from "sequelize";
import
{
addPairToCore
}
from
"../../../utils/coreSystemUtils"
;
import
{
addPairToCore
}
from
"../../../utils/coreSystemUtils"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
addOptLog
}
from
"./userOptLog.service"
;
import
{
addOptLog
}
from
"./userOptLog.service"
;
import
{
checkPairInCoinType
}
from
"../../../utils/coinTypeUtils"
;
let
{
logger
,
datetimeUtils
}
=
require
(
'@madex/ex-js-public'
);
let
{
logger
,
datetimeUtils
}
=
require
(
'@madex/ex-js-public'
);
...
@@ -109,6 +110,9 @@ export async function list(param: ListParam) {
...
@@ -109,6 +110,9 @@ export async function list(param: ListParam) {
}
}
export
const
save
=
async
(
param
:
AddParam
,
currentUserId
:
any
,
ip
:
any
)
=>
{
export
const
save
=
async
(
param
:
AddParam
,
currentUserId
:
any
,
ip
:
any
)
=>
{
//检查交易对中的币种是否存在于coin_type 中
await
checkPairInCoinType
(
String
(
param
.
symbol
));
param
.
updatedAt
=
new
Date
();
param
.
updatedAt
=
new
Date
();
param
.
createdAt
=
new
Date
();
param
.
createdAt
=
new
Date
();
let
dbInfo
=
await
contractPairs
.
prototype
.
findOne
({
let
dbInfo
=
await
contractPairs
.
prototype
.
findOne
({
...
...
src/functional/mvc/service/cronApply.service.ts
View file @
d41ae882
import
{
exPairApply
,
coinType
,
ormDB
,
systemTrigger
,
spotPairs
,
exTradeArea
,
exBusinessAreaRouter
}
from
"@madex/ex-ts-dao"
;
import
{
exPairApply
,
coinType
,
ormDB
,
systemTrigger
,
spotPairs
,
exTradeArea
,
exBusinessAreaRouter
}
from
"@madex/ex-ts-dao"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
addOptLog
}
from
"./userOptLog.service"
;
import
{
addOptLog
}
from
"./userOptLog.service"
;
import
{
addCoin2Core
,
addPairToCore
}
from
"../../../utils/coreSystemUtils"
;
import
{
PAIR_APPLY_STATUS
}
from
"../../../constant/pairApplyConst"
;
import
{
PAIR_APPLY_STATUS
}
from
"../../../constant/pairApplyConst"
;
...
...
src/functional/mvc/service/depositAndWithdraw.service.ts
View file @
d41ae882
...
@@ -102,7 +102,7 @@ export async function withdrawList(pageVO: QueryVO) {
...
@@ -102,7 +102,7 @@ export async function withdrawList(pageVO: QueryVO) {
return
resList
;
return
resList
;
}
}
async
function
dealReturnData
(
resList
:
any
)
{
export
async
function
dealReturnData
(
resList
:
any
)
{
if
(
resList
.
rows
.
length
)
{
if
(
resList
.
rows
.
length
)
{
let
usdtTickerMap
=
{};
let
usdtTickerMap
=
{};
for
(
let
item
of
resList
.
rows
)
{
for
(
let
item
of
resList
.
rows
)
{
...
...
src/functional/mvc/service/mUserAssets.service.ts
View file @
d41ae882
import
{
ormDB
,
mainUserAsset
}
from
"@madex/ex-ts-dao"
;
import
{
ormDB
,
mainUserAsset
,
coinTx
,
coinWithdraw
}
from
"@madex/ex-ts-dao"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
BigNumber
from
"bignumber.js"
;
import
BigNumber
from
"bignumber.js"
;
import
{
any
}
from
"async"
;
import
{
any
}
from
"async"
;
import
{
getUserAccountFromCore
}
from
"../../../utils/coreSystemUtils"
;
import
{
getUserAccountFromCore
}
from
"../../../utils/coreSystemUtils"
;
import
{
dealReturnData
}
from
"./depositAndWithdraw.service"
;
let
_
=
require
(
'lodash'
);
let
_
=
require
(
'lodash'
);
...
@@ -288,6 +289,42 @@ export async function tradeAssetByUids(uids: number[]) {
...
@@ -288,6 +289,42 @@ export async function tradeAssetByUids(uids: number[]) {
}
}
export
async
function
depositList
(
user_id
:
number
,
page
:
number
,
size
:
number
)
{
let
where
=
{
user_id
:
user_id
};
let
resList
=
await
coinTx
.
prototype
.
findAndCount
({
where
:
where
,
limit
:
size
,
offset
:
(
Number
(
page
)
-
1
)
*
Number
(
size
),
order
:
[[
"createdAt"
,
"desc"
]],
raw
:
true
});
await
dealReturnData
(
resList
);
return
resList
;
}
export
async
function
withdrawList
(
user_id
:
number
,
page
:
number
,
size
:
number
)
{
let
where
=
{
user_id
:
user_id
};
let
resList
=
await
coinWithdraw
.
prototype
.
findAndCount
({
where
:
where
,
limit
:
size
,
offset
:
(
Number
(
page
)
-
1
)
*
Number
(
size
),
order
:
[[
"createdAt"
,
"desc"
]],
raw
:
true
});
await
dealReturnData
(
resList
);
return
resList
;
}
...
...
src/functional/mvc/service/pairApply.service.ts
View file @
d41ae882
This diff is collapsed.
Click to expand it.
src/functional/mvc/service/spotPair.service.ts
View file @
d41ae882
...
@@ -4,6 +4,7 @@ import { NUMBER } from "sequelize";
...
@@ -4,6 +4,7 @@ import { NUMBER } from "sequelize";
import
{
addPairToCore
}
from
"../../../utils/coreSystemUtils"
;
import
{
addPairToCore
}
from
"../../../utils/coreSystemUtils"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
ErrorCode
}
from
"../../../constant/errorCode"
;
import
{
addOptLog
}
from
"./userOptLog.service"
;
import
{
addOptLog
}
from
"./userOptLog.service"
;
import
{
checkPairInCoinType
}
from
"../../../utils/coinTypeUtils"
;
let
{
logger
,
datetimeUtils
}
=
require
(
'@madex/ex-js-public'
);
let
{
logger
,
datetimeUtils
}
=
require
(
'@madex/ex-js-public'
);
...
@@ -86,6 +87,10 @@ export async function list(param: ListParam) {
...
@@ -86,6 +87,10 @@ export async function list(param: ListParam) {
}
}
export
const
save
=
async
(
param
:
AddParam
,
currentUserId
:
any
,
ip
:
any
)
=>
{
export
const
save
=
async
(
param
:
AddParam
,
currentUserId
:
any
,
ip
:
any
)
=>
{
//检查交易对中的币种是否存在于coin_type 中
await
checkPairInCoinType
(
String
(
param
.
symbol
));
param
.
updatedAt
=
new
Date
();
param
.
updatedAt
=
new
Date
();
param
.
createdAt
=
new
Date
();
param
.
createdAt
=
new
Date
();
let
dbInfo
=
await
spotPairs
.
prototype
.
findOne
({
let
dbInfo
=
await
spotPairs
.
prototype
.
findOne
({
...
...
src/functional/router/v1/index.ts
View file @
d41ae882
...
@@ -149,6 +149,8 @@ const postFunc = {
...
@@ -149,6 +149,8 @@ const postFunc = {
'mUser/manage/walletAsset/detail'
:
mUserAssetsCtrl
.
walletAssetDetail
,
//Madex 用户管理 ->钱包账户资产详情
'mUser/manage/walletAsset/detail'
:
mUserAssetsCtrl
.
walletAssetDetail
,
//Madex 用户管理 ->钱包账户资产详情
'mUser/manage/asset/distribution'
:
mUserAssetsCtrl
.
assetDistribution
,
//Madex 用户管理 ->资产分布
'mUser/manage/asset/distribution'
:
mUserAssetsCtrl
.
assetDistribution
,
//Madex 用户管理 ->资产分布
'mUser/manage/tradeAsset/detail'
:
mUserAssetsCtrl
.
tradeAssetsDetail
,
//Madex 用户管理 ->交易账户资产详情
'mUser/manage/tradeAsset/detail'
:
mUserAssetsCtrl
.
tradeAssetsDetail
,
//Madex 用户管理 ->交易账户资产详情
'mUser/manage/deposit/list'
:
mUserAssetsCtrl
.
depositList
,
//Madex 用户管理 -> 充值记录
'mUser/manage/withdraw/list'
:
mUserAssetsCtrl
.
withdrawList
,
//Madex 用户管理 -> 提现记录
'mUser/manage/order/pending/list'
:
orderPendingAndHistoryCtrl
.
pendingList
,
//Madex 用户管理 ->当前委托
'mUser/manage/order/pending/list'
:
orderPendingAndHistoryCtrl
.
pendingList
,
//Madex 用户管理 ->当前委托
'mUser/manage/order/history/list'
:
orderPendingAndHistoryCtrl
.
historyList
,
//Madex 用户管理 ->历史委托
'mUser/manage/order/history/list'
:
orderPendingAndHistoryCtrl
.
historyList
,
//Madex 用户管理 ->历史委托
'mUser/manage/order/detail/list'
:
orderPendingAndHistoryCtrl
.
detailList
,
//Madex 用户管理 ->成交记录
'mUser/manage/order/detail/list'
:
orderPendingAndHistoryCtrl
.
detailList
,
//Madex 用户管理 ->成交记录
...
@@ -251,8 +253,8 @@ const postFunc = {
...
@@ -251,8 +253,8 @@ const postFunc = {
'tech/apply/new/pair/apply/review'
:
pairApplyCtrl
.
review
,
//审核申请上新交易对
'tech/apply/new/pair/apply/review'
:
pairApplyCtrl
.
review
,
//审核申请上新交易对
'tech/apply/new/pair/apply/rewrite'
:
pairApplyCtrl
.
rewrite
,
//驳回申请上新交易对
'tech/apply/new/pair/apply/rewrite'
:
pairApplyCtrl
.
rewrite
,
//驳回申请上新交易对
'tech/apply/new/pair/apply/cancel'
:
pairApplyCtrl
.
cancel
,
//管理员取消申请上新交易对
'tech/apply/new/pair/apply/cancel'
:
pairApplyCtrl
.
cancel
,
//管理员取消申请上新交易对
'tech/apply/new/pair/trade/area/list'
:
pairApplyCtrl
.
tradeAreaList
,
//已有交易区列表
//
'tech/apply/new/pair/trade/area/list': pairApplyCtrl.tradeAreaList,//已有交易区列表
'tech/apply/new/pair/listed'
:
pairApplyCtrl
.
listed
,
//已有交易对列表
//
'tech/apply/new/pair/listed': pairApplyCtrl.listed,//已有交易对列表
//技术部-交易上下线管理-申请审核定时器
//技术部-交易上下线管理-申请审核定时器
'tech/apply/new/cron/list'
:
cronApplyCtrl
.
list
,
//审核上币定时器信息列表
'tech/apply/new/cron/list'
:
cronApplyCtrl
.
list
,
//审核上币定时器信息列表
'tech/apply/new/cron/delete'
:
cronApplyCtrl
.
del
,
//删除审核上币定时器
'tech/apply/new/cron/delete'
:
cronApplyCtrl
.
del
,
//删除审核上币定时器
...
...
src/setting/access-limit.ts
View file @
d41ae882
...
@@ -100,6 +100,8 @@ let cmdWhiteList = {
...
@@ -100,6 +100,8 @@ let cmdWhiteList = {
'mUser/manage/walletAsset/detail'
:
1
,
'mUser/manage/walletAsset/detail'
:
1
,
'mUser/manage/asset/distribution'
:
1
,
'mUser/manage/asset/distribution'
:
1
,
'mUser/manage/tradeAsset/detail'
:
1
,
'mUser/manage/tradeAsset/detail'
:
1
,
'mUser/manage/deposit/list'
:
1
,
'mUser/manage/withdraw/list'
:
1
,
'mUser/manage/order/pending/list'
:
1
,
'mUser/manage/order/pending/list'
:
1
,
'mUser/manage/order/history/list'
:
1
,
'mUser/manage/order/history/list'
:
1
,
'mUser/manage/order/detail/list'
:
1
,
'mUser/manage/order/detail/list'
:
1
,
...
@@ -196,8 +198,8 @@ let cmdWhiteList = {
...
@@ -196,8 +198,8 @@ let cmdWhiteList = {
'tech/apply/new/pair/apply/review'
:
1
,
'tech/apply/new/pair/apply/review'
:
1
,
'tech/apply/new/pair/apply/rewrite'
:
1
,
'tech/apply/new/pair/apply/rewrite'
:
1
,
'tech/apply/new/pair/apply/cancel'
:
1
,
'tech/apply/new/pair/apply/cancel'
:
1
,
'tech/apply/new/pair/trade/area/list'
:
1
,
//
'tech/apply/new/pair/trade/area/list': 1,
'tech/apply/new/pair/listed'
:
1
,
//
'tech/apply/new/pair/listed': 1,
//技术部-交易上下线管理-申请审核定时器
//技术部-交易上下线管理-申请审核定时器
'tech/apply/new/cron/list'
:
1
,
'tech/apply/new/cron/list'
:
1
,
'tech/apply/new/cron/delete'
:
1
,
'tech/apply/new/cron/delete'
:
1
,
...
...
src/utils/coinTypeUtils.ts
0 → 100644
View file @
d41ae882
import
{
ErrorCode
}
from
"../constant/errorCode"
;
import
{
coinType
}
from
"@madex/ex-ts-dao"
;
/**
* 检查交易对中的币种是否存在于coin_type 中
* @param pair
*/
export
const
checkPairInCoinType
=
async
function
(
pair
:
string
)
{
if
(
!
pair
)
{
throw
ErrorCode
.
PARAM_MISS
;
}
let
coin_symbol
=
pair
.
split
(
'_'
)[
0
];
let
currency_symbol
=
pair
.
split
(
'_'
)[
1
];
if
(
!
coin_symbol
||
!
currency_symbol
)
{
throw
ErrorCode
.
PAIR_FORMAT_ERR
;
}
let
dbSymbolTask
=
coinType
.
prototype
.
findOne
({
where
:
{
symbol
:
coin_symbol
},
raw
:
true
});
let
dbCurrencyTask
=
coinType
.
prototype
.
findOne
({
where
:
{
symbol
:
currency_symbol
},
raw
:
true
});
let
[
dbSymbol
,
dbCurrency
]
=
await
Promise
.
all
([
dbSymbolTask
,
dbCurrencyTask
]);
if
(
!
dbSymbol
)
{
throw
ErrorCode
.
COIN_DATA_NOT_EXIST
;
}
if
(
!
dbCurrency
)
{
throw
ErrorCode
.
CURRENT_COIN_DATA_NOT_EXIST
;
}
}
\ 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