Commit cbf218eb authored by 1486327116's avatar 1486327116

format

parent 7871c64b
......@@ -5,19 +5,29 @@ import { NUMBER } from "sequelize";
export interface ListParam {
symbol: string | any;
page: number;
size: number;
}
export interface AddParam {
id: any;
base:string;
quote:string;
symbol:string;
name:string;
price_scale:number;
quantity_scale:number;
maker_fee:string;
base: string;
quote: string;
symbol: string;
name: string;
price_scale: number;
quantity_scale: number;
maker_fee: string;
taker_fee: string;
}
......@@ -25,7 +35,7 @@ export interface AddParam {
export async function list(param: ListParam) {
let where = {};
if (param.symbol) {
where["symbol"]= { [ormDB.Op.like]: `%${param.symbol}%` };
where["symbol"] = { [ormDB.Op.like]: `%${param.symbol}%` };
}
let resList = await spotPairs.prototype.findAndCount({
where: where,
......@@ -41,18 +51,19 @@ export const save = async (param: AddParam) => {
let id = param.id;
if (id) {
delete param.id
await spotPairs.prototype.update(param,{
where:{id:id}
await spotPairs.prototype.update(param, {
where: { id: id }
})
}else {
}
else {
await spotPairs.prototype.create(param);
}
return 'ok';
};
export const pushToCoreSystem = async (id: any) => {
await spotPairs.prototype.update({ status:1 },{
where:{id:id,status:0}
await spotPairs.prototype.update({ status: 1 }, {
where: { id: id, status: 0 }
})
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