| 1234567891011121314151617181920212223242526272829303132333435363738 |
- import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
- import APP from "@/services";
- import {Callback} from "@/utils/websocket";
- import {DeliveryGoodsApplyReq} from "@/services/proto/delivery/interface";
- /**
- * 现货品种申请请求
- * @param param DeliveryGoodsApplyReq
- */
- export const addDeliveryGoodsApply = (param: DeliveryGoodsApplyReq): Promise<any> => {
- return new Promise((resolve, reject) => {
- const req = {
- version: "3.2",
- };
- const params = {
- protobufName: 'DeliveryGoodsApplyReq',
- funCodeName: 'DeliveryGoodsApplyReq',
- reqParams: Object.assign(req, param),
- msgHeadParams: {
- AccountID: param.accountid,
- MarketID: 18,
- GoodsID: 0,
- }
- };
- const package50 = buildProtoReq50(params);
- APP.sendTradingServer(package50, undefined, {
- onSuccess: (res) => {
- const { isSuccess, result } = parseProtoRsp50(res, 'DelUserReceiveInfoRsp');
- if (isSuccess) {
- resolve(result);
- } else {
- reject(result);
- }
- },
- onFail: (err) => reject(err.message),
- } as Callback);
- });
- }
|