2020-03-04 11:26:03 +09:00

41 lines
1.1 KiB
TypeScript

import { DeviceType } from '@ucap-webmessenger/core';
import {
APIRequest,
APIEncoder,
ParameterUtil,
APIFormDataEncoder
} from '@ucap-webmessenger/api';
import { FileDownloadItem } from '../../../../ucap-webmessenger-api/src/lib/models/file-download-item';
export interface EventDownloadRequest extends APIRequest {
userSeq: number;
deviceType: DeviceType;
token: string;
roomSeq: string;
}
const eventDownloadEncodeMap = {
userSeq: 'userSeq',
deviceType: 'deviceType',
token: 'tokenKey',
roomSeq: 'roomSeq'
};
export const encodeEventDownload: APIEncoder<EventDownloadRequest> = (
req: EventDownloadRequest
) => {
const extraParams: any = {};
extraParams.roomSeq = Number(req.roomSeq);
return ParameterUtil.encode(eventDownloadEncodeMap, req, extraParams);
};
export const encodeFormDataEventDownload: APIFormDataEncoder<EventDownloadRequest> = (
req: EventDownloadRequest
) => {
const extraParams: any = {};
extraParams.roomSeq = Number(req.roomSeq);
return ParameterUtil.encodeFormData(eventDownloadEncodeMap, req, extraParams);
};