import { httpRequest } from '@/services/http'
import { HttpRequest } from '@/services/http/interface'

/**
 * 首页统计数据
 */
export function homeData(params: HttpRequest<{ req: Ermcp.HomeDataReq, rsp: Ermcp.HomeDataRsp }>) {
    return httpRequest('/Guangzuan/HomeData', 'get', params);
}

/**
 * 获取服务器时间
 */
export function getServerTime(params: HttpRequest<{ rsp: string }>) {
    return httpRequest('/Common/GetServerTime', 'get', params);
}

/**
 * 查询交易端列表头信息
 */
export function queryTableDefine(params: HttpRequest<{ req: Ermcp.TableDefineReq, rsp: Ermcp.TableDefineRsp[] }>) {
    return httpRequest('/Common/QueryTableDefine', 'get', params);
}

/**
 * 查询所有枚举信息
 */
export function queryAllEnums(params: HttpRequest<{ req: Ermcp.EnumReq, rsp: Ermcp.EnumRsp[] }>) {
    return httpRequest('/Common/GetAllEnums', 'get', params);
}

/**
 * 获取菜单表数据
 */
export function queryNewFuncmenu(params: HttpRequest<{ req: Ermcp.NewFuncmenuReq, rsp: Ermcp.NewFuncmenuRsp[] }>) {
    return httpRequest('/Common/FindNewFuncmenu', 'get', params);
}

/**
 * 插入菜单表数据
 */
export function insertNewFuncmenu(params: HttpRequest<{ req: Partial<Ermcp.NewFuncmenuRsp> }>) {
    return httpRequest('/Common/InsertNewFuncmenu', 'post', params);
}

/**
 * 更新菜单表数据
 */
export function updateNewFuncmenu(params: HttpRequest<{ req: Partial<Ermcp.NewFuncmenuRsp> }>) {
    return httpRequest('/Common/UpdateNewFuncmenu', 'put', params);
}

/**
 * 删除菜单表数据
 */
export function deleteNewFuncmenu(params: HttpRequest<{ req: Partial<Ermcp.NewFuncmenuRsp> }>) {
    return httpRequest('/Common/DeleteNewFuncmenu', 'delete', params);
}

/**
 * 查询汇率信息
 */
export function queryRates(params: HttpRequest<{ req: Ermcp.RatesReq, rsp: Ermcp.RatesRsp[] }>) {
    return httpRequest('/Common/QueryRates', 'get', params);
}

/**
 * 通知公告系统消息查询
 */
export function queryNotice(params: HttpRequest<{ req: Ermcp.NoticeReq, rsp: Ermcp.NoticeRsp[] }>) {
    return httpRequest('/Common/QueryNotice', 'get', params);
}

/**
 * 通知公告设置已读
 */
export function postNoticeReaded(params: HttpRequest<{ req: Ermcp.NoticeReadedReq }>) {
    return httpRequest('/Common/NoticeReaded', 'post', params);
}

/**
 * 获取数据库错误信息
 */
export function queryErrorInfos(params: HttpRequest<{ req: Ermcp.ErrorInfosReq, rsp: Ermcp.ErrorInfosRsp[] }>) {
    return httpRequest('/Common/QueryErrorInfos', 'get', params);
}