Commit 4f294b97 authored by ml's avatar ml

增加接口、逻辑调整

parent dfed33d2
...@@ -60,5 +60,5 @@ export const ErrorCode = { ...@@ -60,5 +60,5 @@ export const ErrorCode = {
COIN_TYPE_NOT_EXIST:'30056',//指定币种不存在 COIN_TYPE_NOT_EXIST:'30056',//指定币种不存在
PAIR_NOT_EXIST:'30057',//指定币对不存在 PAIR_NOT_EXIST:'30057',//指定币对不存在
LIMIT_ERROR:'30058',//limit参数必须在10-2000之间 LIMIT_ERROR:'30058',//limit参数必须在10-2000之间
ADD_PAIR_TO_CORE_ERR:'30059',//添加交易对提交到撮合失败 ADD_PAIR_TO_CORE_ERR:'30059',//添加币种/交易对提交到撮合失败
} }
import * as service from "../service/coinType.service"; import * as service from "../service/coinType.service";
import { AddParam, ListParam } from "../service/coinType.service"; import { AddParam, ListParam } from "../service/coinType.service";
import { getCurrentUserId } from "../../../utils/aclUserUtils";
let { logger, Res3Utils, optionalUtils: Optional, apiAssertUtils: ApiAssert } = require('@madex/ex-js-public'); let { logger, Res3Utils, optionalUtils: Optional, apiAssertUtils: ApiAssert } = require('@madex/ex-js-public');
let isIp = require('is-ip');
export const list = async (req: any, param: ListParam) => { export const list = async (req: any, param: ListParam) => {
let func_name = "coinTypeCtl.list"; let func_name = "coinTypeCtl.list";
...@@ -26,14 +28,15 @@ export const save = async (req: any, param: AddParam) => { ...@@ -26,14 +28,15 @@ export const save = async (req: any, param: AddParam) => {
ApiAssert.notNull('3000', param.symbol); ApiAssert.notNull('3000', param.symbol);
ApiAssert.notNull('3000', param.name); ApiAssert.notNull('3000', param.name);
ApiAssert.notNull('3000', param.general_name); ApiAssert.notNull('3000', param.general_name);
ApiAssert.isInt('3000', param.is_active); ApiAssert.notNull('3000', param.is_active);
ApiAssert.isInt('3000', param.is_main); ApiAssert.notNull('3000', param.is_main);
ApiAssert.isInt('3000', param.original_decimals); ApiAssert.notNull('3000', param.original_decimals);
ApiAssert.isInt('3000', param.valid_decimals); ApiAssert.notNull('3000', param.valid_decimals);
ApiAssert.isInt('3000', param.deposit_confirm_count); ApiAssert.notNull('3000', param.deposit_confirm_count);
ApiAssert.isInt('3000', param.safe_confirm_count); ApiAssert.notNull('3000', param.safe_confirm_count);
let ip = isIp(req.ip) ? req.ip : '*.*.*.*';
let res = await service.save(param); let currentUserId = await getCurrentUserId(req.cookies.session_id);
let res = await service.save(param, currentUserId, ip);
return Res3Utils.result(res); return Res3Utils.result(res);
} }
catch (e) { catch (e) {
...@@ -42,6 +45,30 @@ export const save = async (req: any, param: AddParam) => { ...@@ -42,6 +45,30 @@ export const save = async (req: any, param: AddParam) => {
} }
}; };
export const update = async (req: any, param: AddParam) => {
let func_name = "coinTypeCtl.update";
let cmd = req.path;
try {
ApiAssert.notNull('3000', param.id);
ApiAssert.notNull('3000', param.symbol);
ApiAssert.notNull('3000', param.name);
ApiAssert.notNull('3000', param.general_name);
ApiAssert.notNull('3000', param.is_active);
ApiAssert.notNull('3000', param.is_main);
ApiAssert.notNull('3000', param.original_decimals);
ApiAssert.notNull('3000', param.valid_decimals);
ApiAssert.notNull('3000', param.deposit_confirm_count);
ApiAssert.notNull('3000', param.safe_confirm_count);
let ip = isIp(req.ip) ? req.ip : '*.*.*.*';
let currentUserId = await getCurrentUserId(req.cookies.session_id);
let res = await service.update(param, currentUserId, ip);
return Res3Utils.result(res);
}
catch (e) {
logger.error(`${func_name} error:${e}`);
return Res3Utils.getErrorResult(e);
}
};
export const pushToCoreSystem = async (req: any, id: any) => { export const pushToCoreSystem = async (req: any, id: any) => {
let func_name = "coinTypeCtl.pushToCoreSystem"; let func_name = "coinTypeCtl.pushToCoreSystem";
...@@ -56,3 +83,18 @@ export const pushToCoreSystem = async (req: any, id: any) => { ...@@ -56,3 +83,18 @@ export const pushToCoreSystem = async (req: any, id: any) => {
return Res3Utils.getErrorResult(e); return Res3Utils.getErrorResult(e);
} }
}; };
export const getAllSubmitSuccess = async (req: any, param: ListParam) => {
let func_name = "coinTypeCtl.getAllSubmitSuccess";
let cmd = req.path;
try {
let res = await service.getAllSubmitSuccess();
return Res3Utils.result(res);
}
catch (e) {
logger.error(`${func_name} error:${e}`);
return Res3Utils.getErrorResult(e);
}
};
import * as contractAgentService from "../service/contractAgent.service";
import { AgentVO, AgentUserVO, AgentPageVO } from "../service/contractAgent.service";
let { logger, Res3Utils, optionalUtils: Optional, apiAssertUtils: ApiAssert, datetimeUtils } = require('@madex/ex-js-public');
import { ErrorCode } from "../../../constant/errorCode";
import { getCurrentUserId } from "../../../utils/aclUserUtils";
let isIp = require('is-ip');
/**
* 金融部-其他管理-合约接单账户配置列表
* @param req
* @param infoVO
*/
export const agentList = async (req: any, pageVO: AgentPageVO) => {
let func_name = "contractAgent.control.agentList";
try {
pageVO.page = Optional.opt(pageVO, 'page', 1);
pageVO.size = Optional.opt(pageVO, 'size', 20);
let res = await contractAgentService.agentList(pageVO);
return Res3Utils.result(res);
}
catch (e) {
logger.error(`${func_name} error:${e}`);
return Res3Utils.getErrorResult(e);
}
};
/**
* 金融部-其他管理-合约接单账户配置
* @param req
* @param authConfigVO
*/
export const agentSet = async (req: any, agentVO: AgentVO) => {
let func_name = "contractAgent.control.agentSet";
try {
let ip = isIp(req.ip) ? req.ip : '*.*.*.*';
let currentUserId = await getCurrentUserId(req.cookies.session_id);
if (!agentVO.adl_type || !agentVO.user_id) {
throw ErrorCode.PARAM_MISS
}
let res = await contractAgentService.agentSet(agentVO, currentUserId, ip);
return Res3Utils.result(res);
}
catch (e) {
logger.error(`${func_name} error:${e}`);
return Res3Utils.getErrorResult(e);
}
};
/**
* 金融部-其他管理-合约接单账户关联列表
* @param req
* @param infoVO
*/
export const agentUserList = async (req: any, pageVO: AgentPageVO) => {
let func_name = "contractAgent.control.agentUserList";
try {
pageVO.page = Optional.opt(pageVO, 'page', 1);
pageVO.size = Optional.opt(pageVO, 'size', 20);
let res = await contractAgentService.agentUserList(pageVO);
return Res3Utils.result(res);
}
catch (e) {
logger.error(`${func_name} error:${e}`);
return Res3Utils.getErrorResult(e);
}
};
/**
* 金融部-其他管理-合约接单账户关联
* @param req
* @param authConfigVO
*/
export const agentUserSet = async (req: any, agentUserVO: AgentUserVO) => {
let func_name = "contractAgent.control.agentUserSet";
try {
let ip = isIp(req.ip) ? req.ip : '*.*.*.*';
let currentUserId = await getCurrentUserId(req.cookies.session_id);
if (!agentUserVO.agent_id || !agentUserVO.user_id) {
throw ErrorCode.PARAM_MISS
}
let res = await contractAgentService.agentUserSet(agentUserVO, currentUserId, ip);
return Res3Utils.result(res);
}
catch (e) {
logger.error(`${func_name} error:${e}`);
return Res3Utils.getErrorResult(e);
}
};
/**
* 金融部-其他管理-合约渠道用户管理列表
* @param req
* @param infoVO
*/
export const agentChannelList = async (req: any, pageVO: AgentPageVO) => {
let func_name = "contractAgent.control.agentChannelList";
try {
pageVO.page = Optional.opt(pageVO, 'page', 1);
pageVO.size = Optional.opt(pageVO, 'size', 20);
let res = await contractAgentService.agentChannelList(pageVO);
return Res3Utils.result(res);
}
catch (e) {
logger.error(`${func_name} error:${e}`);
return Res3Utils.getErrorResult(e);
}
};
/**
* 金融部-其他管理-合约渠道用户管理
* @param req
* @param authConfigVO
*/
export const agentChannelSet = async (req: any, agentUserVO: AgentUserVO) => {
let func_name = "contractAgent.control.agentChannelSet";
try {
let ip = isIp(req.ip) ? req.ip : '*.*.*.*';
let currentUserId = await getCurrentUserId(req.cookies.session_id);
if (!agentUserVO.agent_id || !agentUserVO.user_id) {
throw ErrorCode.PARAM_MISS
}
let res = await contractAgentService.agentChannelSet(agentUserVO, currentUserId, ip);
return Res3Utils.result(res);
}
catch (e) {
logger.error(`${func_name} error:${e}`);
return Res3Utils.getErrorResult(e);
}
};
import * as service from "../service/spotPair.service"; import * as service from "../service/spotPair.service";
import { AddParam, ListParam } from "../service/spotPair.service"; import { AddParam, ListParam } from "../service/spotPair.service";
import { getCurrentUserId } from "../../../utils/aclUserUtils";
let { logger, Res3Utils, optionalUtils: Optional, apiAssertUtils: ApiAssert } = require('@madex/ex-js-public'); let { logger, Res3Utils, optionalUtils: Optional, apiAssertUtils: ApiAssert } = require('@madex/ex-js-public');
let isIp = require('is-ip');
export const list = async (req: any, param: ListParam) => { export const list = async (req: any, param: ListParam) => {
...@@ -31,7 +33,9 @@ export const save = async (req: any, param: AddParam) => { ...@@ -31,7 +33,9 @@ export const save = async (req: any, param: AddParam) => {
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);
let res = await service.save(param); let ip = isIp(req.ip) ? req.ip : '*.*.*.*';
let currentUserId = await getCurrentUserId(req.cookies.session_id);
let res = await service.save(param, currentUserId, ip);
return Res3Utils.result(res); return Res3Utils.result(res);
} }
catch (e) { catch (e) {
...@@ -45,7 +49,9 @@ export const update = async (req: any, param: AddParam) => { ...@@ -45,7 +49,9 @@ export const update = async (req: any, param: AddParam) => {
let cmd = req.path; let cmd = req.path;
try { try {
ApiAssert.notNull('3000', param.id); ApiAssert.notNull('3000', param.id);
let res = await service.update(param); let ip = isIp(req.ip) ? req.ip : '*.*.*.*';
let currentUserId = await getCurrentUserId(req.cookies.session_id);
let res = await service.update(param, currentUserId, ip);
return Res3Utils.result(res); return Res3Utils.result(res);
} }
catch (e) { catch (e) {
......
// @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, addPairToCore } from "../../../utils/coreSystemUtils";
import { ErrorCode } from "../../../constant/errorCode";
import { addOptLog } from "./userOptLog.service";
let { logger, datetimeUtils } = require('@madex/ex-js-public');
export interface ListParam { export interface ListParam {
symbol: string | any; symbol: string | any;
...@@ -9,6 +12,12 @@ export interface ListParam { ...@@ -9,6 +12,12 @@ export interface ListParam {
page: number; page: number;
size: number; size: number;
status?: number
from_time?: Date | any
to_time?: Date | any
} }
export interface AddParam { export interface AddParam {
...@@ -86,6 +95,10 @@ export interface AddParam { ...@@ -86,6 +95,10 @@ export interface AddParam {
is_hidden?: number; is_hidden?: number;
main_status?: number; main_status?: number;
createdAt?: Date | any,
updatedAt?: Date | any,
} }
...@@ -94,6 +107,12 @@ export async function list(param: ListParam) { ...@@ -94,6 +107,12 @@ export async function list(param: ListParam) {
if (param.symbol) { if (param.symbol) {
where["symbol"] = { [ormDB.Op.like]: `%${param.symbol}%` }; where["symbol"] = { [ormDB.Op.like]: `%${param.symbol}%` };
} }
if (param.status || param.status === 0) {
where["main_status"] = param.status
}
if (param.from_time && param.to_time) {
where['createdAt'] = { [ormDB.Op.between]: [param.from_time, param.to_time] }
}
let resList = await coinType.prototype.findAndCount({ let resList = await coinType.prototype.findAndCount({
where: where, where: where,
limit: param.size, limit: param.size,
...@@ -104,18 +123,59 @@ export async function list(param: ListParam) { ...@@ -104,18 +123,59 @@ export async function list(param: ListParam) {
return resList; return resList;
} }
export const save = async (param: AddParam) => { export const save = async (param: AddParam, currentUserId: any, ip: any) => {
let id = param.id; param.updatedAt = new Date();
if (id) { param.createdAt = new Date();
delete param.id let tx;
await coinType.prototype.update(param, { try {
where: { id: id } tx = await ormDB.transaction();
let insertInfo = await coinType.prototype.create(param, {
transaction: tx
});
//TODO:目前方便调试先注释掉,之后正式测试时候需要解开注释
/*//提交到撮合
if (param.is_main) {
let optResult = await addCoin2Core(insertInfo.general_name, insertInfo.id);
if (!optResult) {
throw ErrorCode.ADD_PAIR_TO_CORE_ERR;
}
await coinType.prototype.update({ main_status: 1 }, {
where: {
id: insertInfo.id
}
}) })
}*/
await tx.commit();
}
catch (e) {
logger.error('coinTypeService.save.error:' + e);
if (tx) {
await tx.rollback();
} }
else { throw e;
await coinType.prototype.create(param);
} }
//管理后台操作日志
addOptLog(currentUserId, 0, '币种管理新增', ip, JSON.stringify(param), '币种管理');
return 'ok';
};
export const update = async (param: AddParam, currentUserId: any, ip: any) => {
let id = param.id;
let dbInfo = await coinType.prototype.findOne({
where: {
id: id
},
raw: true
});
if (!dbInfo) {
throw ErrorCode.DATA_NOT_EXIST
}
param.updatedAt = new Date();
await coinType.prototype.update(param, {
where: { id: id }
})
//管理后台操作日志
addOptLog(currentUserId, 0, '币种管理更新', ip, JSON.stringify(param), '币种管理');
return 'ok'; return 'ok';
}; };
...@@ -129,7 +189,7 @@ export const pushToCoreSystem = async (id: any) => { ...@@ -129,7 +189,7 @@ export const pushToCoreSystem = async (id: any) => {
if (cfg) { if (cfg) {
let symbol = cfg.general_name; let symbol = cfg.general_name;
let optResult = await addCoin2Core(symbol,cfg.id); let optResult = await addCoin2Core(symbol, cfg.id);
if (optResult) { if (optResult) {
await coinType.prototype.update({ main_status: 1 }, { await coinType.prototype.update({ main_status: 1 }, {
where: where where: where
...@@ -140,3 +200,13 @@ export const pushToCoreSystem = async (id: any) => { ...@@ -140,3 +200,13 @@ export const pushToCoreSystem = async (id: any) => {
}; };
export async function getAllSubmitSuccess() {
let resList = await coinType.prototype.findAll({
where: {
main_status: 2
},
order: [["id", "desc"]],
raw: true
});
return resList;
}
\ No newline at end of file
import { userApikeyStrict, } from "@madex/ex-ts-dao";
import { ErrorCode } from "../../../constant/errorCode";
import { addOptLog } from "./userOptLog.service";
let _ = require('lodash');
let { logger } = require('@madex/ex-js-public');
let { authCommon: AuthCommon, redisUtilsCommon: RedisClient, } = require('@madex/ex-js-common');
export interface AgentVO {
id?: number,
user_id?: number;
adl_type?: number;
enable?: number;
createdAt?: Date | any,
updatedAt?: Date | any,
}
export interface AgentUserVO {
id?: number,
user_id?: number;
agent_id?: number;
createdAt?: Date | any,
updatedAt?: Date | any,
}
export interface AgentPageVO extends AgentVO, AgentUserVO {
page?: number,
size?: number,
}
export async function agentList(pageVO: AgentPageVO) {
let key = 'contractAgent.service.agentList';
//TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改
let list = await RedisClient.getSync(key);
let res = {
count: list ? list.length : 0,
rows: list ? list : []
}
return res;
}
export async function agentSet(agentVO: AgentVO, currentUserId: any, ip: string | undefined) {
//TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改
agentVO.createdAt = new Date();
agentVO.updatedAt = new Date();
let key = 'contractAgent.service.agentList';
let list = await RedisClient.getSync(key);
if (list) {
agentVO.id = list.length + 1;
list.push(agentVO);
}
else {
agentVO.id = 1;
list = [];
list.push(agentVO);
}
await RedisClient.writeSync(key, list);
//管理后台操作日志
addOptLog(currentUserId, 0, '合约接单账户配置', ip, JSON.stringify(agentVO), '合约接单账户配置');
return 'success';
}
export async function agentUserList(pageVO: AgentPageVO) {
let key = 'contractAgent.service.agentUserList';
//TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改
let list = await RedisClient.getSync(key);
let res = {
count: list ? list.length : 0,
rows: list ? list : []
}
return res;
}
export async function agentUserSet(agentUserVO: AgentUserVO, currentUserId: any, ip: string | undefined) {
//TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改
agentUserVO.createdAt = new Date();
agentUserVO.updatedAt = new Date();
let key = 'contractAgent.service.agentUserList';
let list = await RedisClient.getSync(key);
if (list) {
agentUserVO.id = list.length + 1;
list.push(agentUserVO);
}
else {
agentUserVO.id = 1;
list = [];
list.push(agentUserVO);
}
await RedisClient.writeSync(key, list);
//管理后台操作日志
addOptLog(currentUserId, 0, '合约接单账户关联配置', ip, JSON.stringify(agentUserVO), '合约接单账户关联');
return 'success';
}
export async function agentChannelList(pageVO: AgentPageVO) {
let key = 'contractAgent.service.agentChannelList';
//TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改
let list = await RedisClient.getSync(key);
let res = {
count: list ? list.length : 0,
rows: list ? list : []
}
return res;
}
export async function agentChannelSet(agentUserVO: AgentUserVO, currentUserId: any, ip: string | undefined) {
//TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改
agentUserVO.createdAt = new Date();
agentUserVO.updatedAt = new Date();
let key = 'contractAgent.service.agentChannelList';
let list = await RedisClient.getSync(key);
if (list) {
agentUserVO.id = list.length + 1;
list.push(agentUserVO);
}
else {
agentUserVO.id = 1;
list = [];
list.push(agentUserVO);
}
await RedisClient.writeSync(key, list);
//管理后台操作日志
addOptLog(currentUserId, 0, '合约渠道用户配置', ip, JSON.stringify(agentUserVO), '合约渠道用户管理');
return 'success';
}
...@@ -72,7 +72,7 @@ export async function paramGet(pair: string) { ...@@ -72,7 +72,7 @@ export async function paramGet(pair: string) {
//TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改 //TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改
let key = 'contractMarketMaker.service.paramGet'; let key = 'contractMarketMaker.service.paramGet';
let map = await RedisClient.getSync(key); let map = await RedisClient.getSync(key);
let res = map ? map[pair] : "" let res = map && map[pair] ? map[pair] : ""
return res; return res;
} }
......
import { userApikeyStrict, } from "@madex/ex-ts-dao";
import { ErrorCode } from "../../../constant/errorCode";
import { addOptLog } from "./userOptLog.service"; import { addOptLog } from "./userOptLog.service";
...@@ -71,7 +69,7 @@ export async function paramGet(pair: string) { ...@@ -71,7 +69,7 @@ export async function paramGet(pair: string) {
//TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改 //TODO:目前在缓存里 方便调试 后期撮合搞定之后再修改
let key = 'spotMarketMaker.service.paramGet'; let key = 'spotMarketMaker.service.paramGet';
let map = await RedisClient.getSync(key); let map = await RedisClient.getSync(key);
let res = map ? map[pair] : "" let res = map && map[pair] ? map[pair] : ""
return res; return res;
} }
......
...@@ -3,6 +3,7 @@ import { spotPairs, madSpotOrmDB, coinType } from "@madex/ex-ts-dao"; ...@@ -3,6 +3,7 @@ import { spotPairs, madSpotOrmDB, coinType } from "@madex/ex-ts-dao";
import { NUMBER } from "sequelize"; 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";
let { logger, datetimeUtils } = require('@madex/ex-js-public'); let { logger, datetimeUtils } = require('@madex/ex-js-public');
...@@ -76,7 +77,7 @@ export async function list(param: ListParam) { ...@@ -76,7 +77,7 @@ export async function list(param: ListParam) {
return resList; return resList;
} }
export const save = async (param: AddParam) => { export const save = async (param: AddParam, currentUserId: any, ip: any) => {
param.updatedAt = new Date(); param.updatedAt = new Date();
param.createdAt = new Date(); param.createdAt = new Date();
let tx; let tx;
...@@ -86,7 +87,8 @@ export const save = async (param: AddParam) => { ...@@ -86,7 +87,8 @@ export const save = async (param: AddParam) => {
let insertInfo = await spotPairs.prototype.create(param, { let insertInfo = await spotPairs.prototype.create(param, {
transaction: tx transaction: tx
}); });
//提交到撮合 //TODO:目前方便调试先注释掉,之后正式测试时候需要解开注释
/*//提交到撮合
let symbol = insertInfo.symbol; let symbol = insertInfo.symbol;
let sps = symbol.split("_"); let sps = symbol.split("_");
let base = sps[0]; let base = sps[0];
...@@ -108,7 +110,7 @@ export const save = async (param: AddParam) => { ...@@ -108,7 +110,7 @@ export const save = async (param: AddParam) => {
id: insertInfo.id id: insertInfo.id
}, },
transaction: tx transaction: tx
}); });*/
await tx.commit(); await tx.commit();
} }
catch (e) { catch (e) {
...@@ -118,11 +120,13 @@ export const save = async (param: AddParam) => { ...@@ -118,11 +120,13 @@ export const save = async (param: AddParam) => {
} }
throw e; throw e;
} }
//管理后台操作日志
addOptLog(currentUserId, 0, '交易对配置新增', ip, JSON.stringify(param), '交易对配置');
return 'ok'; return 'ok';
}; };
export const update = async (param: AddParam) => { export const update = async (param: AddParam, currentUserId: any, ip: any) => {
let dbInfo = await spotPairs.prototype.findOne({ let dbInfo = await spotPairs.prototype.findOne({
where: { where: {
id: param.id id: param.id
...@@ -148,6 +152,8 @@ export const update = async (param: AddParam) => { ...@@ -148,6 +152,8 @@ export const update = async (param: AddParam) => {
id: Number(param.id) id: Number(param.id)
} }
}); });
//管理后台操作日志
addOptLog(currentUserId, 0, '交易对配置更新', ip, JSON.stringify(param), '交易对配置');
return 'ok'; return 'ok';
}; };
......
...@@ -40,13 +40,14 @@ import * as contractPairCtrl from "../../mvc/control/contractPair.control"; ...@@ -40,13 +40,14 @@ import * as contractPairCtrl from "../../mvc/control/contractPair.control";
import * as spotMarketMakerCtrl from "../../mvc/control/spotMarketMaker.control"; import * as spotMarketMakerCtrl from "../../mvc/control/spotMarketMaker.control";
import * as contractMarketMakerCtrl from "../../mvc/control/contractMarketMaker.control"; import * as contractMarketMakerCtrl from "../../mvc/control/contractMarketMaker.control";
import * as contractLimitTradeCtrl from "../../mvc/control/contractLimitTrade.control"; import * as contractLimitTradeCtrl from "../../mvc/control/contractLimitTrade.control";
import * as contractAgentCtrl from "../../mvc/control/contractAgent.control";
const getFunc = { const getFunc = {
'user/info': userController.getUserInfo, 'user/info': userController.getUserInfo,
}; };
const postFunc = { const postFunc = {
//技术部-国际化管理 //技术部-其他管理-国际化管理
'i18n/info/list': i18nCtrl.list, 'i18n/info/list': i18nCtrl.list,
'i18n/info/add': i18nCtrl.add, 'i18n/info/add': i18nCtrl.add,
'i18n/info/update': i18nCtrl.update, 'i18n/info/update': i18nCtrl.update,
...@@ -59,10 +60,12 @@ const postFunc = { ...@@ -59,10 +60,12 @@ const postFunc = {
'spotPair/list': spotPairCtrl.list, 'spotPair/list': spotPairCtrl.list,
'spotPair/pushToCoreSystem': spotPairCtrl.pushToCoreSystem, 'spotPair/pushToCoreSystem': spotPairCtrl.pushToCoreSystem,
'spotPair/getAllSubmitSuccess': spotPairCtrl.getAllSubmitSuccess, 'spotPair/getAllSubmitSuccess': spotPairCtrl.getAllSubmitSuccess,
//运营部-其他管理-币种管理
'coinType/save': coinTypeCtrl.save, 'coinType/save': coinTypeCtrl.save,
'coinType/update': coinTypeCtrl.update,
'coinType/list': coinTypeCtrl.list, 'coinType/list': coinTypeCtrl.list,
'coinType/pushToCoreSystem': coinTypeCtrl.pushToCoreSystem, 'coinType/pushToCoreSystem': coinTypeCtrl.pushToCoreSystem,
'coinType/getAllSubmitSuccess': coinTypeCtrl.getAllSubmitSuccess,
//权限管理 - 我的权限 //权限管理 - 我的权限
'user/getInfo': userOptCtrl.getInfo, 'user/getInfo': userOptCtrl.getInfo,
...@@ -107,13 +110,13 @@ const postFunc = { ...@@ -107,13 +110,13 @@ const postFunc = {
'user/bind/totp/confirm': userOptCtrl.bindTotpConfirm, 'user/bind/totp/confirm': userOptCtrl.bindTotpConfirm,
'user/auth/reset/totp': userAuthConfigCtrl.resetTotp, 'user/auth/reset/totp': userAuthConfigCtrl.resetTotp,
//运营部-热门交易对搜索 //运营部-其他管理-热门交易对搜索
'hot/pair/config/list': hotPairConfigCtrl.list, 'hot/pair/config/list': hotPairConfigCtrl.list,
'hot/pair/config/add': hotPairConfigCtrl.add, 'hot/pair/config/add': hotPairConfigCtrl.add,
'hot/pair/config/update': hotPairConfigCtrl.update, 'hot/pair/config/update': hotPairConfigCtrl.update,
'hot/pair/config/del': hotPairConfigCtrl.del, 'hot/pair/config/del': hotPairConfigCtrl.del,
//运营部-消息通知 //运营部-其他管理-消息通知
'notice/list': noticeCtrl.list, 'notice/list': noticeCtrl.list,
'notice/add': noticeCtrl.add, 'notice/add': noticeCtrl.add,
'notice/update': noticeCtrl.update, 'notice/update': noticeCtrl.update,
...@@ -138,7 +141,7 @@ const postFunc = { ...@@ -138,7 +141,7 @@ const postFunc = {
'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 用户管理 ->成交记录
//运营部-资源位管理 //运营部-现货-资源位管理
'link/useful/list': usefulLinkCtrl.list,//链接记录列表 'link/useful/list': usefulLinkCtrl.list,//链接记录列表
'link/useful/add': usefulLinkCtrl.add,//添加链接记录 'link/useful/add': usefulLinkCtrl.add,//添加链接记录
'link/useful/delete': usefulLinkCtrl.del,//删除链接记录 'link/useful/delete': usefulLinkCtrl.del,//删除链接记录
...@@ -154,7 +157,7 @@ const postFunc = { ...@@ -154,7 +157,7 @@ const postFunc = {
'mUser/subscribe/mail/detail': mUserSubscribeCtrl.mailDetail,//发送详情 'mUser/subscribe/mail/detail': mUserSubscribeCtrl.mailDetail,//发送详情
'mUser/subscribe/mail/send/group': mUserSubscribeCtrl.maiSendGroup,//群发邮件 'mUser/subscribe/mail/send/group': mUserSubscribeCtrl.maiSendGroup,//群发邮件
//运营部-费率管理-普通用户手续费 //运营部-现货-费率管理-普通用户手续费
'mUser/fee/setting/list': commonUserFeeSettingCtrl.list,//普通用户手续费列表 'mUser/fee/setting/list': commonUserFeeSettingCtrl.list,//普通用户手续费列表
'mUser/fee/setting/add': commonUserFeeSettingCtrl.add,//新增普通用户手续费 'mUser/fee/setting/add': commonUserFeeSettingCtrl.add,//新增普通用户手续费
'mUser/fee/setting/update': commonUserFeeSettingCtrl.update,//修改普通用户手续费 'mUser/fee/setting/update': commonUserFeeSettingCtrl.update,//修改普通用户手续费
...@@ -207,6 +210,15 @@ const postFunc = { ...@@ -207,6 +210,15 @@ const postFunc = {
//金融部-其他管理-合约限制交易配置 //金融部-其他管理-合约限制交易配置
'fiance/other/contract/limit/trade/set': contractLimitTradeCtrl.set, 'fiance/other/contract/limit/trade/set': contractLimitTradeCtrl.set,
'fiance/other/contract/limit/trade/list': contractLimitTradeCtrl.list, 'fiance/other/contract/limit/trade/list': contractLimitTradeCtrl.list,
//金融部-其他管理-合约接单账户配置(代理商)
'fiance/other/contract/agent/set': contractAgentCtrl.agentSet,
'fiance/other/contract/agent/list': contractAgentCtrl.agentList,
//金融部-其他管理-合约接单账户关联(代理用户)
'fiance/other/contract/agent/user/set': contractAgentCtrl.agentUserSet,
'fiance/other/contract/agent/user/list': contractAgentCtrl.agentUserList,
//金融部-其他管理-合约渠道用户管理(代理商渠道)
'fiance/other/contract/agent/channel/set': contractAgentCtrl.agentChannelSet,
'fiance/other/contract/agent/channel/list': contractAgentCtrl.agentChannelList,
}; };
// TODO 这里先和 nodejs 的注册路由方式保持一样,后面在调整。 // TODO 这里先和 nodejs 的注册路由方式保持一样,后面在调整。
......
...@@ -8,7 +8,7 @@ const { ...@@ -8,7 +8,7 @@ const {
let cmdWhiteList = { let cmdWhiteList = {
//技术部-国际化管理 //技术部-其他管理-国际化管理
'i18n/info/list': 1, 'i18n/info/list': 1,
'i18n/info/add': 1, 'i18n/info/add': 1,
'i18n/info/update': 1, 'i18n/info/update': 1,
...@@ -21,10 +21,12 @@ let cmdWhiteList = { ...@@ -21,10 +21,12 @@ let cmdWhiteList = {
'spotPair/list': 1, 'spotPair/list': 1,
'spotPair/pushToCoreSystem': 1, 'spotPair/pushToCoreSystem': 1,
'spotPair/getAllSubmitSuccess': 1, 'spotPair/getAllSubmitSuccess': 1,
//运营部-其他管理-币种管理
'coinType/save': 1, 'coinType/save': 1,
'coinType/update': 1,
'coinType/list': 1, 'coinType/list': 1,
'coinType/pushToCoreSystem': 1, 'coinType/pushToCoreSystem': 1,
'coinType/getAllSubmitSuccess': 1,
//权限管理 - 我的权限 //权限管理 - 我的权限
'user/getInfo': 1, 'user/getInfo': 1,
...@@ -67,12 +69,12 @@ let cmdWhiteList = { ...@@ -67,12 +69,12 @@ let cmdWhiteList = {
'user/bind/totp/confirm': 1, 'user/bind/totp/confirm': 1,
'user/auth/reset/totp': 1, 'user/auth/reset/totp': 1,
//运营部-热门交易对搜索 //运营部-其他管理-热门交易对搜索
'hot/pair/config/list': 1, 'hot/pair/config/list': 1,
'hot/pair/config/add': 1, 'hot/pair/config/add': 1,
'hot/pair/config/update': 1, 'hot/pair/config/update': 1,
'hot/pair/config/del': 1, 'hot/pair/config/del': 1,
//运营部-消息通知 //运营部-其他管理-消息通知
'notice/list': 1, 'notice/list': 1,
'notice/add': 1, 'notice/add': 1,
'notice/update': 1, 'notice/update': 1,
...@@ -94,7 +96,7 @@ let cmdWhiteList = { ...@@ -94,7 +96,7 @@ let cmdWhiteList = {
'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,
//运营部-资源位管理 //运营部-现货-资源位管理
'link/useful/list': 1, 'link/useful/list': 1,
'link/useful/add': 1, 'link/useful/add': 1,
'link/useful/delete': 1, 'link/useful/delete': 1,
...@@ -108,7 +110,7 @@ let cmdWhiteList = { ...@@ -108,7 +110,7 @@ let cmdWhiteList = {
'mUser/subscribe/mail/send': 1, 'mUser/subscribe/mail/send': 1,
'mUser/subscribe/mail/detail': 1, 'mUser/subscribe/mail/detail': 1,
'mUser/subscribe/mail/send/group': 1, 'mUser/subscribe/mail/send/group': 1,
//运营部-费率管理-普通用户手续费 //运营部-现货-费率管理-普通用户手续费
'mUser/fee/setting/list': 1, 'mUser/fee/setting/list': 1,
'mUser/fee/setting/add': 1, 'mUser/fee/setting/add': 1,
'mUser/fee/setting/update': 1, 'mUser/fee/setting/update': 1,
...@@ -160,6 +162,15 @@ let cmdWhiteList = { ...@@ -160,6 +162,15 @@ let cmdWhiteList = {
//金融部-其他管理-合约限制交易配置 //金融部-其他管理-合约限制交易配置
'fiance/other/contract/limit/trade/set': 1, 'fiance/other/contract/limit/trade/set': 1,
'fiance/other/contract/limit/trade/list': 1, 'fiance/other/contract/limit/trade/list': 1,
//金融部-其他管理-合约接单账户配置(代理商)
'fiance/other/contract/agent/set': 1,
'fiance/other/contract/agent/list': 1,
//金融部-其他管理-合约接单账户关联(代理用户)
'fiance/other/contract/agent/user/set': 1,
'fiance/other/contract/agent/user/list': 1,
//金融部-其他管理-合约渠道用户管理(代理商渠道)
'fiance/other/contract/agent/channel/set': 1,
'fiance/other/contract/agent/channel/list': 1,
}; };
......
...@@ -16,6 +16,7 @@ const ExcludeApi = { ...@@ -16,6 +16,7 @@ const ExcludeApi = {
"user/login/confirm": 1, "user/login/confirm": 1,
"mUser/fee/vip/level/list": 1, "mUser/fee/vip/level/list": 1,
"spotPair/getAllSubmitSuccess": 1, "spotPair/getAllSubmitSuccess": 1,
"coinType/getAllSubmitSuccess": 1,
'acl/role/getAll': 1, 'acl/role/getAll': 1,
'position/allList': 1, 'position/allList': 1,
'department/allList': 1, 'department/allList': 1,
......
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