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
d2175372
Commit
d2175372
authored
Dec 12, 2024
by
1486327116
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4b01948f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
1 deletion
+54
-1
coinAndPairSetting.ts
cron/task/coinAndPairSetting.ts
+1
-1
coinType.control.ts
src/functional/mvc/control/coinType.control.ts
+14
-0
coinType.service.ts
src/functional/mvc/service/coinType.service.ts
+34
-0
index.ts
src/functional/router/v1/index.ts
+2
-0
access-limit.ts
src/setting/access-limit.ts
+1
-0
login-filter.ts
src/setting/login-filter.ts
+2
-0
No files found.
cron/task/coinAndPairSetting.ts
View file @
d2175372
...
...
@@ -87,7 +87,7 @@ const syncCoin = async () => {
main_status
:
2
,
asset_id
:
cfg
[
"id"
],
},
{
where
:
{
id
,
main_status
:
1
}
where
:
{
general_name
:
symbol
}
// 同名币的一块更新了
});
logger
.
info
(
symbol
,
"sync config success"
)
}
...
...
src/functional/mvc/control/coinType.control.ts
View file @
d2175372
...
...
@@ -21,6 +21,20 @@ export const list = async (req: any, param: ListParam) => {
}
};
export
const
chainList
=
async
(
req
:
any
,
param
:
ListParam
)
=>
{
let
func_name
=
"coinTypeCtl.chainList"
;
let
cmd
=
req
.
path
;
try
{
let
res
=
await
service
.
chainList
();
return
Res3Utils
.
result
(
res
);
}
catch
(
e
)
{
logger
.
error
(
`
${
func_name
}
error:
${
e
}
`
);
return
Res3Utils
.
getErrorResult
(
e
);
}
};
export
const
save
=
async
(
req
:
any
,
param
:
AddParam
)
=>
{
let
func_name
=
"coinTypeCtl.save"
;
let
cmd
=
req
.
path
;
...
...
src/functional/mvc/service/coinType.service.ts
View file @
d2175372
...
...
@@ -25,6 +25,8 @@ export interface AddParam {
symbol
:
string
;
asset_id
:
number
;
is_active
:
number
;
is_main
:
number
;
...
...
@@ -127,12 +129,44 @@ export async function list(param: ListParam) {
return
resList
;
}
export
async
function
chainList
()
{
let
resList
=
await
coinType
.
prototype
.
findAll
({
attributes
:[
'chain_type'
],
where
:
{
is_main
:
1
},
raw
:
true
});
let
chains
:
any
[]
=
[];
for
(
let
item
of
resList
)
{
let
chainType
=
item
.
chain_type
;
chains
.
push
(
chainType
)
}
return
chains
;
}
export
const
save
=
async
(
param
:
AddParam
,
currentUserId
:
any
,
ip
:
any
)
=>
{
if
(
!
param
.
weight
)
{
param
.
weight
=
0
;
}
param
.
updatedAt
=
new
Date
();
param
.
createdAt
=
new
Date
();
let
general_name
=
param
.
general_name
;
let
exist
=
await
coinType
.
prototype
.
findOne
({
// 同名币判断
where
:
{
is_main
:
1
,
general_name
:
general_name
,
},
raw
:
true
});
if
(
exist
)
{
param
.
is_main
=
0
;
param
.
asset_id
=
0
;
}
else
{
param
.
is_main
=
1
;
param
.
asset_id
=
exist
.
asset_id
;
param
.
main_status
=
exist
.
main_status
;
}
await
coinType
.
prototype
.
create
(
param
);
//管理后台操作日志
addOptLog
(
currentUserId
,
0
,
'币种管理新增'
,
ip
,
JSON
.
stringify
(
param
),
'币种管理'
);
...
...
src/functional/router/v1/index.ts
View file @
d2175372
...
...
@@ -82,6 +82,8 @@ const postFunc = {
'coinType/getAllSubmitSuccess'
:
coinTypeCtrl
.
getAllSubmitSuccess
,
'coinType/audit'
:
coinTypeCtrl
.
audit
,
'coinType/mixinCoinList'
:
coinTypeCtrl
.
mixinCoinList
,
'coinType/chainList'
:
coinTypeCtrl
.
chainList
,
//权限管理 - 我的权限
'user/getInfo'
:
userOptCtrl
.
getInfo
,
...
...
src/setting/access-limit.ts
View file @
d2175372
...
...
@@ -32,6 +32,7 @@ let cmdWhiteList = {
'coinType/save'
:
1
,
'coinType/update'
:
1
,
'coinType/list'
:
1
,
'coinType/chainList'
:
1
,
'coinType/pushToCoreSystem'
:
1
,
'coinType/getAllSubmitSuccess'
:
1
,
'coinType/audit'
:
1
,
...
...
src/setting/login-filter.ts
View file @
d2175372
...
...
@@ -23,6 +23,8 @@ const ExcludeApi = {
'department/allList'
:
1
,
'operate/other/business/area/list'
:
1
,
'coinType/mixinCoinList'
:
1
,
'coinType/chainList'
:
1
,
};
//管理员需要强制绑定,该位置做特殊处理
const
AdminExcludeApi
=
{
...
...
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