51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
|
import {
|
||
|
APIRequest,
|
||
|
APIResponse,
|
||
|
APIEncoder,
|
||
|
APIDecoder,
|
||
|
ParameterUtil
|
||
|
} from '@ucap-webmessenger/api';
|
||
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||
|
import { CategoryType } from '../types/category.type';
|
||
|
import { ContentType } from '../types/content.type';
|
||
|
|
||
|
export interface SendCopyRequest extends APIRequest {
|
||
|
userSeq: number;
|
||
|
deviceType: DeviceType;
|
||
|
tokenKey: string;
|
||
|
userName: string;
|
||
|
msgId: number;
|
||
|
category: CategoryType;
|
||
|
title: string;
|
||
|
titleYn: boolean;
|
||
|
listOrder: ContentType[];
|
||
|
reservationTime: string;
|
||
|
smsYn: boolean;
|
||
|
|
||
|
textContent: { text: string }[];
|
||
|
recvUserList: { userSeq: number; userName: string }[];
|
||
|
}
|
||
|
|
||
|
export interface SendCopyResponse extends APIResponse {
|
||
|
responseCode: string;
|
||
|
responseMsg: string;
|
||
|
}
|
||
|
|
||
|
const SendCopyEncodeMap = {};
|
||
|
|
||
|
export const encodeSendCopy: APIEncoder<SendCopyRequest> = (
|
||
|
req: SendCopyRequest
|
||
|
) => {
|
||
|
return ParameterUtil.encode(SendCopyEncodeMap, req);
|
||
|
};
|
||
|
|
||
|
export const decodeSendCopy: APIDecoder<SendCopyResponse> = (res: any) => {
|
||
|
return {
|
||
|
statusCode: res.StatusCode,
|
||
|
errorMessage: res.ErrorMessage,
|
||
|
|
||
|
responseCode: res.responseCode,
|
||
|
responseMsg: res.responseMsg
|
||
|
} as SendCopyResponse;
|
||
|
};
|