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
cbf218eb
Commit
cbf218eb
authored
Aug 22, 2024
by
1486327116
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format
parent
7871c64b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
spotPair.service.ts
src/functional/mvc/service/spotPair.service.ts
+24
-13
No files found.
src/functional/mvc/service/spotPair.service.ts
View file @
cbf218eb
...
@@ -5,19 +5,29 @@ import { NUMBER } from "sequelize";
...
@@ -5,19 +5,29 @@ import { NUMBER } from "sequelize";
export
interface
ListParam
{
export
interface
ListParam
{
symbol
:
string
|
any
;
symbol
:
string
|
any
;
page
:
number
;
page
:
number
;
size
:
number
;
size
:
number
;
}
}
export
interface
AddParam
{
export
interface
AddParam
{
id
:
any
;
id
:
any
;
base
:
string
;
quote
:
string
;
base
:
string
;
symbol
:
string
;
name
:
string
;
quote
:
string
;
price_scale
:
number
;
quantity_scale
:
number
;
symbol
:
string
;
maker_fee
:
string
;
name
:
string
;
price_scale
:
number
;
quantity_scale
:
number
;
maker_fee
:
string
;
taker_fee
:
string
;
taker_fee
:
string
;
}
}
...
@@ -25,7 +35,7 @@ export interface AddParam {
...
@@ -25,7 +35,7 @@ export interface AddParam {
export
async
function
list
(
param
:
ListParam
)
{
export
async
function
list
(
param
:
ListParam
)
{
let
where
=
{};
let
where
=
{};
if
(
param
.
symbol
)
{
if
(
param
.
symbol
)
{
where
[
"symbol"
]
=
{
[
ormDB
.
Op
.
like
]:
`%
${
param
.
symbol
}
%`
};
where
[
"symbol"
]
=
{
[
ormDB
.
Op
.
like
]:
`%
${
param
.
symbol
}
%`
};
}
}
let
resList
=
await
spotPairs
.
prototype
.
findAndCount
({
let
resList
=
await
spotPairs
.
prototype
.
findAndCount
({
where
:
where
,
where
:
where
,
...
@@ -41,18 +51,19 @@ export const save = async (param: AddParam) => {
...
@@ -41,18 +51,19 @@ export const save = async (param: AddParam) => {
let
id
=
param
.
id
;
let
id
=
param
.
id
;
if
(
id
)
{
if
(
id
)
{
delete
param
.
id
delete
param
.
id
await
spotPairs
.
prototype
.
update
(
param
,{
await
spotPairs
.
prototype
.
update
(
param
,
{
where
:
{
id
:
id
}
where
:
{
id
:
id
}
})
})
}
else
{
}
else
{
await
spotPairs
.
prototype
.
create
(
param
);
await
spotPairs
.
prototype
.
create
(
param
);
}
}
return
'ok'
;
return
'ok'
;
};
};
export
const
pushToCoreSystem
=
async
(
id
:
any
)
=>
{
export
const
pushToCoreSystem
=
async
(
id
:
any
)
=>
{
await
spotPairs
.
prototype
.
update
({
status
:
1
},
{
await
spotPairs
.
prototype
.
update
({
status
:
1
},
{
where
:
{
id
:
id
,
status
:
0
}
where
:
{
id
:
id
,
status
:
0
}
})
})
return
'ok'
;
return
'ok'
;
};
};
...
...
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