41 lines
1.1 KiB
TypeScript
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);
|
|
};
|