Commit cbf218eb authored by 1486327116's avatar 1486327116

format

parent 7871c64b
...@@ -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';
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment