쪽지 interface 수정.
// JSON 객체를 raw body 에 실어보내는 로직으로 구현.
This commit is contained in:
parent
08331aadc0
commit
6550c419a1
|
@ -1,9 +1,9 @@
|
||||||
import {
|
import {
|
||||||
APIRequest,
|
APIRequest,
|
||||||
APIResponse,
|
APIResponse,
|
||||||
APIEncoder,
|
|
||||||
APIDecoder,
|
APIDecoder,
|
||||||
ParameterUtil
|
APIJsonEncoder,
|
||||||
|
MessageAPIResponse
|
||||||
} from '@ucap-webmessenger/api';
|
} from '@ucap-webmessenger/api';
|
||||||
import { DeviceType } from '@ucap-webmessenger/core';
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||||||
import { MessageType } from '../types/message.type';
|
import { MessageType } from '../types/message.type';
|
||||||
|
@ -17,22 +17,14 @@ export interface DelRequest extends APIRequest {
|
||||||
msgList: { msgId: number }[];
|
msgList: { msgId: number }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DelResponse extends APIResponse {
|
export interface DelResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const DelEncodeMap = {};
|
export const encodeDel: APIJsonEncoder<DelRequest> = (req: DelRequest) => {
|
||||||
|
return JSON.stringify(req);
|
||||||
export const encodeDel: APIEncoder<DelRequest> = (req: DelRequest) => {
|
|
||||||
return ParameterUtil.encode(DelEncodeMap, req);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeDel: APIDecoder<DelResponse> = (res: any) => {
|
export const decodeDel: APIDecoder<DelResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as DelResponse;
|
} as DelResponse;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {
|
import {
|
||||||
APIRequest,
|
APIRequest,
|
||||||
APIResponse,
|
MessageAPIResponse,
|
||||||
APIEncoder,
|
|
||||||
APIDecoder,
|
APIDecoder,
|
||||||
ParameterUtil
|
APIJsonEncoder
|
||||||
} from '@ucap-webmessenger/api';
|
} from '@ucap-webmessenger/api';
|
||||||
import { DeviceType } from '@ucap-webmessenger/core';
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||||||
import { MessageType } from '../types/message.type';
|
import { MessageType } from '../types/message.type';
|
||||||
|
@ -18,10 +17,7 @@ export interface DetailRequest extends APIRequest {
|
||||||
msgId: number;
|
msgId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DetailResponse extends APIResponse {
|
export interface DetailResponse extends MessageAPIResponse {
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
|
|
||||||
msgInfo: {
|
msgInfo: {
|
||||||
msgId: number;
|
msgId: number;
|
||||||
category: CategoryType;
|
category: CategoryType;
|
||||||
|
@ -50,17 +46,14 @@ export interface DetailResponse extends APIResponse {
|
||||||
}[];
|
}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const DetailEncodeMap = {};
|
export const encodeDetail: APIJsonEncoder<DetailRequest> = (
|
||||||
|
req: DetailRequest
|
||||||
export const encodeDetail: APIEncoder<DetailRequest> = (req: DetailRequest) => {
|
) => {
|
||||||
return ParameterUtil.encode(DetailEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeDetail: APIDecoder<DetailResponse> = (res: any) => {
|
export const decodeDetail: APIDecoder<DetailResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg,
|
responseMsg: res.responseMsg,
|
||||||
|
|
||||||
|
@ -81,31 +74,20 @@ export interface ReadRequest extends APIRequest {
|
||||||
msgId: number;
|
msgId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ReadResponse extends APIResponse {
|
export interface ReadResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ReadEncodeMap = {};
|
export const encodeRead: APIJsonEncoder<ReadRequest> = (req: ReadRequest) => {
|
||||||
|
return JSON.stringify(req);
|
||||||
export const encodeRead: APIEncoder<ReadRequest> = (req: ReadRequest) => {
|
|
||||||
return ParameterUtil.encode(ReadEncodeMap, req);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRead: APIDecoder<ReadResponse> = (res: any) => {
|
export const decodeRead: APIDecoder<ReadResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as ReadResponse;
|
} as ReadResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ReadCheckResponse extends APIResponse {
|
export interface ReadCheckResponse extends MessageAPIResponse {
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
|
|
||||||
recvList: {
|
recvList: {
|
||||||
userSeq: number;
|
userSeq: number;
|
||||||
userName: string;
|
userName: string;
|
||||||
|
@ -117,9 +99,6 @@ export interface ReadCheckResponse extends APIResponse {
|
||||||
|
|
||||||
export const decodeReadCheck: APIDecoder<ReadCheckResponse> = (res: any) => {
|
export const decodeReadCheck: APIDecoder<ReadCheckResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg,
|
responseMsg: res.responseMsg,
|
||||||
|
|
||||||
|
@ -137,22 +116,16 @@ export interface CancelRequest extends APIRequest {
|
||||||
recvUserList: { userSeq: number }[];
|
recvUserList: { userSeq: number }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CancelResponse extends APIResponse {
|
export interface CancelResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CancelEncodeMap = {};
|
export const encodeCancel: APIJsonEncoder<CancelRequest> = (
|
||||||
|
req: CancelRequest
|
||||||
export const encodeCancel: APIEncoder<CancelRequest> = (req: CancelRequest) => {
|
) => {
|
||||||
return ParameterUtil.encode(CancelEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeCancel: APIDecoder<CancelResponse> = (res: any) => {
|
export const decodeCancel: APIDecoder<CancelResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as CancelResponse;
|
} as CancelResponse;
|
||||||
|
@ -167,26 +140,18 @@ export interface CancelReservationRequest extends APIRequest {
|
||||||
msgId: number;
|
msgId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CancelReservationResponse extends APIResponse {
|
export interface CancelReservationResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CancelReservationEncodeMap = {};
|
export const encodeCancelReservation: APIJsonEncoder<CancelReservationRequest> = (
|
||||||
|
|
||||||
export const encodeCancelReservation: APIEncoder<CancelReservationRequest> = (
|
|
||||||
req: CancelReservationRequest
|
req: CancelReservationRequest
|
||||||
) => {
|
) => {
|
||||||
return ParameterUtil.encode(CancelReservationEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeCancelReservation: APIDecoder<CancelReservationResponse> = (
|
export const decodeCancelReservation: APIDecoder<CancelReservationResponse> = (
|
||||||
res: any
|
res: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as CancelReservationResponse;
|
} as CancelReservationResponse;
|
||||||
|
@ -202,14 +167,12 @@ export interface RetrieveResourceFileRequest extends APIRequest {
|
||||||
resUrl: string;
|
resUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RetrieveResourceFileResponse extends APIResponse {}
|
export interface RetrieveResourceFileResponse extends MessageAPIResponse {}
|
||||||
|
|
||||||
const RetrieveResourceFileEncodeMap = {};
|
export const encodeRetrieveResourceFile: APIJsonEncoder<RetrieveResourceFileRequest> = (
|
||||||
|
|
||||||
export const encodeRetrieveResourceFile: APIEncoder<RetrieveResourceFileRequest> = (
|
|
||||||
req: RetrieveResourceFileRequest
|
req: RetrieveResourceFileRequest
|
||||||
) => {
|
) => {
|
||||||
return ParameterUtil.encode(RetrieveResourceFileEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRetrieveResourceFile: APIDecoder<RetrieveResourceFileResponse> = (
|
export const decodeRetrieveResourceFile: APIDecoder<RetrieveResourceFileResponse> = (
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {
|
import {
|
||||||
APIRequest,
|
APIRequest,
|
||||||
APIResponse,
|
MessageAPIResponse,
|
||||||
APIEncoder,
|
APIJsonEncoder,
|
||||||
APIDecoder,
|
APIDecoder
|
||||||
ParameterUtil
|
|
||||||
} from '@ucap-webmessenger/api';
|
} from '@ucap-webmessenger/api';
|
||||||
import { DeviceType } from '@ucap-webmessenger/core';
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||||||
import { CategoryType } from '../types/category.type';
|
import { CategoryType } from '../types/category.type';
|
||||||
|
@ -25,26 +24,18 @@ export interface EditReservationRequest extends APIRequest {
|
||||||
recvUserList: { userSeq: number; userName: string }[];
|
recvUserList: { userSeq: number; userName: string }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EditReservationResponse extends APIResponse {
|
export interface EditReservationResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const EditReservationEncodeMap = {};
|
export const encodeEditReservation: APIJsonEncoder<EditReservationRequest> = (
|
||||||
|
|
||||||
export const encodeEditReservation: APIEncoder<EditReservationRequest> = (
|
|
||||||
req: EditReservationRequest
|
req: EditReservationRequest
|
||||||
) => {
|
) => {
|
||||||
return ParameterUtil.encode(EditReservationEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeEditReservation: APIDecoder<EditReservationResponse> = (
|
export const decodeEditReservation: APIDecoder<EditReservationResponse> = (
|
||||||
res: any
|
res: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as EditReservationResponse;
|
} as EditReservationResponse;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {
|
import {
|
||||||
APIRequest,
|
APIRequest,
|
||||||
APIResponse,
|
MessageAPIResponse,
|
||||||
APIEncoder,
|
APIJsonEncoder,
|
||||||
APIDecoder,
|
APIDecoder
|
||||||
ParameterUtil
|
|
||||||
} from '@ucap-webmessenger/api';
|
} from '@ucap-webmessenger/api';
|
||||||
import { DeviceType } from '@ucap-webmessenger/core';
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||||||
|
|
||||||
|
@ -15,22 +14,16 @@ export interface SaveMyRequest extends APIRequest {
|
||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SaveMyResponse extends APIResponse {
|
export interface SaveMyResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SaveMyEncodeMap = {};
|
export const encodeSaveMy: APIJsonEncoder<SaveMyRequest> = (
|
||||||
|
req: SaveMyRequest
|
||||||
export const encodeSaveMy: APIEncoder<SaveMyRequest> = (req: SaveMyRequest) => {
|
) => {
|
||||||
return ParameterUtil.encode(SaveMyEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeSaveMy: APIDecoder<SaveMyResponse> = (res: any) => {
|
export const decodeSaveMy: APIDecoder<SaveMyResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as SaveMyResponse;
|
} as SaveMyResponse;
|
||||||
|
@ -44,29 +37,21 @@ export interface RetrieveMyRequest extends APIRequest {
|
||||||
pageCount: number;
|
pageCount: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RetrieveMyResponse extends APIResponse {
|
export interface RetrieveMyResponse extends MessageAPIResponse {
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
|
|
||||||
msgList: {
|
msgList: {
|
||||||
msgId: number;
|
msgId: number;
|
||||||
message: string;
|
message: string;
|
||||||
}[];
|
}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const RetrieveMyEncodeMap = {};
|
export const encodeRetrieveMy: APIJsonEncoder<RetrieveMyRequest> = (
|
||||||
|
|
||||||
export const encodeRetrieveMy: APIEncoder<RetrieveMyRequest> = (
|
|
||||||
req: RetrieveMyRequest
|
req: RetrieveMyRequest
|
||||||
) => {
|
) => {
|
||||||
return ParameterUtil.encode(RetrieveMyEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRetrieveMy: APIDecoder<RetrieveMyResponse> = (res: any) => {
|
export const decodeRetrieveMy: APIDecoder<RetrieveMyResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg,
|
responseMsg: res.responseMsg,
|
||||||
|
|
||||||
|
@ -80,22 +65,16 @@ export interface DelMyRequest extends APIRequest {
|
||||||
tokenKey: string;
|
tokenKey: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DelMyResponse extends APIResponse {
|
export interface DelMyResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const DelMyEncodeMap = {};
|
export const encodeDelMy: APIJsonEncoder<DelMyRequest> = (
|
||||||
|
req: DelMyRequest
|
||||||
export const encodeDelMy: APIEncoder<DelMyRequest> = (req: DelMyRequest) => {
|
) => {
|
||||||
return ParameterUtil.encode(DelMyEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeDelMy: APIDecoder<DelMyResponse> = (res: any) => {
|
export const decodeDelMy: APIDecoder<DelMyResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as DelMyResponse;
|
} as DelMyResponse;
|
||||||
|
@ -109,22 +88,16 @@ export interface EditMyRequest extends APIRequest {
|
||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EditMyResponse extends APIResponse {
|
export interface EditMyResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const EditMyEncodeMap = {};
|
export const encodeEditMy: APIJsonEncoder<EditMyRequest> = (
|
||||||
|
req: EditMyRequest
|
||||||
export const encodeEditMy: APIEncoder<EditMyRequest> = (req: EditMyRequest) => {
|
) => {
|
||||||
return ParameterUtil.encode(EditMyEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeEditMy: APIDecoder<EditMyResponse> = (res: any) => {
|
export const decodeEditMy: APIDecoder<EditMyResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as EditMyResponse;
|
} as EditMyResponse;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {
|
import {
|
||||||
APIRequest,
|
APIRequest,
|
||||||
APIResponse,
|
MessageAPIResponse,
|
||||||
APIEncoder,
|
|
||||||
APIDecoder,
|
APIDecoder,
|
||||||
ParameterUtil
|
APIJsonEncoder
|
||||||
} from '@ucap-webmessenger/api';
|
} from '@ucap-webmessenger/api';
|
||||||
import { DeviceType } from '@ucap-webmessenger/core';
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||||||
import { MessageType } from '../types/message.type';
|
import { MessageType } from '../types/message.type';
|
||||||
|
@ -23,33 +22,25 @@ export interface RetrieveSearchRequest extends RetrieveRequest {
|
||||||
searchContent: string;
|
searchContent: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RetrieveResponse extends APIResponse {
|
export interface RetrieveResponse extends MessageAPIResponse {
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
totalCount: number;
|
totalCount: number;
|
||||||
|
|
||||||
messageList: MessageList[];
|
messageList: MessageList[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const RetrieveEncodeMap = {};
|
export const encodeRetrieve: APIJsonEncoder<RetrieveRequest> = (
|
||||||
const RetrieveSearchEncodeMap = {};
|
|
||||||
|
|
||||||
export const encodeRetrieve: APIEncoder<RetrieveRequest> = (
|
|
||||||
req: RetrieveRequest
|
req: RetrieveRequest
|
||||||
) => {
|
) => {
|
||||||
return ParameterUtil.encode(RetrieveEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
export const encodeRetrieveSearch: APIEncoder<RetrieveResponse> = (
|
export const encodeRetrieveSearch: APIJsonEncoder<RetrieveResponse> = (
|
||||||
req: RetrieveResponse
|
req: RetrieveResponse
|
||||||
) => {
|
) => {
|
||||||
return ParameterUtil.encode(RetrieveSearchEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRetrieveSend: APIDecoder<RetrieveResponse> = (res: any) => {
|
export const decodeRetrieveSend: APIDecoder<RetrieveResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg,
|
responseMsg: res.responseMsg,
|
||||||
totalCount: res.totalCount,
|
totalCount: res.totalCount,
|
||||||
|
@ -61,9 +52,6 @@ export const decodeRetrieveReceive: APIDecoder<RetrieveResponse> = (
|
||||||
res: any
|
res: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg,
|
responseMsg: res.responseMsg,
|
||||||
totalCount: res.totalCount,
|
totalCount: res.totalCount,
|
||||||
|
@ -75,9 +63,6 @@ export const decodeRetrieveReservation: APIDecoder<RetrieveResponse> = (
|
||||||
res: any
|
res: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg,
|
responseMsg: res.responseMsg,
|
||||||
totalCount: res.totalCount,
|
totalCount: res.totalCount,
|
||||||
|
@ -89,9 +74,6 @@ export const decodeRetrieveSearch: APIDecoder<RetrieveResponse> = (
|
||||||
res: any
|
res: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg,
|
responseMsg: res.responseMsg,
|
||||||
totalCount: res.totalCount,
|
totalCount: res.totalCount,
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {
|
import {
|
||||||
APIRequest,
|
APIRequest,
|
||||||
APIResponse,
|
MessageAPIResponse,
|
||||||
APIEncoder,
|
APIJsonEncoder,
|
||||||
APIDecoder,
|
APIDecoder
|
||||||
ParameterUtil
|
|
||||||
} from '@ucap-webmessenger/api';
|
} from '@ucap-webmessenger/api';
|
||||||
import { DeviceType } from '@ucap-webmessenger/core';
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||||||
import { CategoryType } from '../types/category.type';
|
import { CategoryType } from '../types/category.type';
|
||||||
|
@ -26,24 +25,16 @@ export interface SendCopyRequest extends APIRequest {
|
||||||
recvUserList: { userSeq: number; userName: string }[];
|
recvUserList: { userSeq: number; userName: string }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SendCopyResponse extends APIResponse {
|
export interface SendCopyResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SendCopyEncodeMap = {};
|
export const encodeSendCopy: APIJsonEncoder<SendCopyRequest> = (
|
||||||
|
|
||||||
export const encodeSendCopy: APIEncoder<SendCopyRequest> = (
|
|
||||||
req: SendCopyRequest
|
req: SendCopyRequest
|
||||||
) => {
|
) => {
|
||||||
return ParameterUtil.encode(SendCopyEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeSendCopy: APIDecoder<SendCopyResponse> = (res: any) => {
|
export const decodeSendCopy: APIDecoder<SendCopyResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as SendCopyResponse;
|
} as SendCopyResponse;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {
|
import {
|
||||||
APIRequest,
|
APIRequest,
|
||||||
APIResponse,
|
MessageAPIResponse,
|
||||||
APIEncoder,
|
APIJsonEncoder,
|
||||||
APIDecoder,
|
APIDecoder
|
||||||
ParameterUtil
|
|
||||||
} from '@ucap-webmessenger/api';
|
} from '@ucap-webmessenger/api';
|
||||||
import { DeviceType } from '@ucap-webmessenger/core';
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||||||
import { MessageType } from '../types/message.type';
|
import { MessageType } from '../types/message.type';
|
||||||
|
@ -28,22 +27,14 @@ export interface SendRequest extends APIRequest {
|
||||||
recvUserList: { userSeq: number; userName: string }[];
|
recvUserList: { userSeq: number; userName: string }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SendResponse extends APIResponse {
|
export interface SendResponse extends MessageAPIResponse {}
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SendEncodeMap = {};
|
export const encodeSend: APIJsonEncoder<SendRequest> = (req: SendRequest) => {
|
||||||
|
return JSON.stringify(req);
|
||||||
export const encodeSend: APIEncoder<SendRequest> = (req: SendRequest) => {
|
|
||||||
return ParameterUtil.encode(SendEncodeMap, req);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeSend: APIDecoder<SendResponse> = (res: any) => {
|
export const decodeSend: APIDecoder<SendResponse> = (res: any) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg
|
responseMsg: res.responseMsg
|
||||||
} as SendResponse;
|
} as SendResponse;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {
|
import {
|
||||||
APIRequest,
|
APIRequest,
|
||||||
APIResponse,
|
MessageAPIResponse,
|
||||||
APIEncoder,
|
APIJsonEncoder,
|
||||||
APIDecoder,
|
APIDecoder
|
||||||
ParameterUtil
|
|
||||||
} from '@ucap-webmessenger/api';
|
} from '@ucap-webmessenger/api';
|
||||||
import { DeviceType } from '@ucap-webmessenger/core';
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||||||
|
|
||||||
|
@ -13,28 +12,20 @@ export interface UnreadCountRequest extends APIRequest {
|
||||||
tokenKey: string;
|
tokenKey: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UnreadCountResponse extends APIResponse {
|
export interface UnreadCountResponse extends MessageAPIResponse {
|
||||||
responseCode: string;
|
|
||||||
responseMsg: string;
|
|
||||||
|
|
||||||
unreadCount: number;
|
unreadCount: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const UnreadCountEncodeMap = {};
|
export const encodeUnreadCount: APIJsonEncoder<UnreadCountRequest> = (
|
||||||
|
|
||||||
export const encodeUnreadCount: APIEncoder<UnreadCountRequest> = (
|
|
||||||
req: UnreadCountRequest
|
req: UnreadCountRequest
|
||||||
) => {
|
) => {
|
||||||
return ParameterUtil.encode(UnreadCountEncodeMap, req);
|
return JSON.stringify(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeUnreadCount: APIDecoder<UnreadCountResponse> = (
|
export const decodeUnreadCount: APIDecoder<UnreadCountResponse> = (
|
||||||
res: any
|
res: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
statusCode: res.StatusCode,
|
|
||||||
errorMessage: res.ErrorMessage,
|
|
||||||
|
|
||||||
responseCode: res.responseCode,
|
responseCode: res.responseCode,
|
||||||
responseMsg: res.responseMsg,
|
responseMsg: res.responseMsg,
|
||||||
unreadCount: res.unreadCount
|
unreadCount: res.unreadCount
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
@ -92,6 +92,8 @@ import {
|
||||||
export class MessageApiService {
|
export class MessageApiService {
|
||||||
readonly urls: Urls;
|
readonly urls: Urls;
|
||||||
|
|
||||||
|
headers: HttpHeaders;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(_MODULE_CONFIG) private moduleConfig: ModuleConfig,
|
@Inject(_MODULE_CONFIG) private moduleConfig: ModuleConfig,
|
||||||
private httpClient: HttpClient
|
private httpClient: HttpClient
|
||||||
|
@ -100,6 +102,10 @@ export class MessageApiService {
|
||||||
this.moduleConfig.hostConfig,
|
this.moduleConfig.hostConfig,
|
||||||
this.moduleConfig.urls
|
this.moduleConfig.urls
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.headers = new HttpHeaders({
|
||||||
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** retrieve */
|
/** retrieve */
|
||||||
|
@ -107,26 +113,18 @@ export class MessageApiService {
|
||||||
req: RetrieveRequest
|
req: RetrieveRequest
|
||||||
): Observable<RetrieveResponse> {
|
): Observable<RetrieveResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.retrieveSendMessageList, encodeRetrieve(req), {
|
||||||
this.urls.retrieveSendMessageList,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeRetrieve(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeRetrieveSend(res)));
|
.pipe(map(res => decodeRetrieveSend(res)));
|
||||||
}
|
}
|
||||||
public retrieveReceiveMessage(
|
public retrieveReceiveMessage(
|
||||||
req: RetrieveRequest
|
req: RetrieveRequest
|
||||||
): Observable<RetrieveResponse> {
|
): Observable<RetrieveResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.retrieveRecvMessageList, encodeRetrieve(req), {
|
||||||
this.urls.retrieveRecvMessageList,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeRetrieve(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeRetrieveReceive(res)));
|
.pipe(map(res => decodeRetrieveReceive(res)));
|
||||||
}
|
}
|
||||||
public retrieveReservationMessage(
|
public retrieveReservationMessage(
|
||||||
|
@ -135,9 +133,9 @@ export class MessageApiService {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(
|
||||||
this.urls.retrieveReservationMessageList,
|
this.urls.retrieveReservationMessageList,
|
||||||
{},
|
encodeRetrieve(req),
|
||||||
{
|
{
|
||||||
params: encodeRetrieve(req)
|
headers: this.headers
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.pipe(map(res => decodeRetrieveReservation(res)));
|
.pipe(map(res => decodeRetrieveReservation(res)));
|
||||||
|
@ -146,72 +144,48 @@ export class MessageApiService {
|
||||||
req: RetrieveSearchRequest
|
req: RetrieveSearchRequest
|
||||||
): Observable<RetrieveResponse> {
|
): Observable<RetrieveResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.retrieveSearchMessage, encodeRetrieve(req), {
|
||||||
this.urls.retrieveSearchMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeRetrieve(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeRetrieveSearch(res)));
|
.pipe(map(res => decodeRetrieveSearch(res)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** send */
|
/** send */
|
||||||
public sendMessage(req: SendRequest): Observable<SendResponse> {
|
public sendMessage(req: SendRequest): Observable<SendResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.sendNewMessage, encodeSend(req), {
|
||||||
this.urls.sendNewMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeSend(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeSend(res)));
|
.pipe(map(res => decodeSend(res)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** detail */
|
/** detail */
|
||||||
public detailMessage(req: DetailRequest): Observable<DetailResponse> {
|
public detailMessage(req: DetailRequest): Observable<DetailResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.retrieveMessageDetail, encodeDetail(req), {
|
||||||
this.urls.retrieveMessageDetail,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeDetail(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeDetail(res)));
|
.pipe(map(res => decodeDetail(res)));
|
||||||
}
|
}
|
||||||
public readMessage(req: ReadRequest): Observable<ReadResponse> {
|
public readMessage(req: ReadRequest): Observable<ReadResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.readMessage, encodeRead(req), {
|
||||||
this.urls.readMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeRead(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeRead(res)));
|
.pipe(map(res => decodeRead(res)));
|
||||||
}
|
}
|
||||||
public retrieveReadCheck(req: ReadRequest): Observable<ReadCheckResponse> {
|
public retrieveReadCheck(req: ReadRequest): Observable<ReadCheckResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.retrieveReadCheck, encodeRead(req), {
|
||||||
this.urls.retrieveReadCheck,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeRead(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeReadCheck(res)));
|
.pipe(map(res => decodeReadCheck(res)));
|
||||||
}
|
}
|
||||||
public cancelMessage(req: CancelRequest): Observable<CancelResponse> {
|
public cancelMessage(req: CancelRequest): Observable<CancelResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.cancelMessage, encodeCancel(req), {
|
||||||
this.urls.cancelMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeCancel(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeCancel(res)));
|
.pipe(map(res => decodeCancel(res)));
|
||||||
}
|
}
|
||||||
public cancelReservationMessage(
|
public cancelReservationMessage(
|
||||||
|
@ -220,9 +194,9 @@ export class MessageApiService {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(
|
||||||
this.urls.cancelReservationMessage,
|
this.urls.cancelReservationMessage,
|
||||||
{},
|
encodeCancelReservation(req),
|
||||||
{
|
{
|
||||||
params: encodeCancelReservation(req)
|
headers: this.headers
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.pipe(map(res => decodeCancelReservation(res)));
|
.pipe(map(res => decodeCancelReservation(res)));
|
||||||
|
@ -233,9 +207,9 @@ export class MessageApiService {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(
|
||||||
this.urls.retrieveResourceFile,
|
this.urls.retrieveResourceFile,
|
||||||
{},
|
encodeRetrieveResourceFile(req),
|
||||||
{
|
{
|
||||||
params: encodeRetrieveResourceFile(req)
|
headers: this.headers
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.pipe(map(res => decodeRetrieveResourceFile(res)));
|
.pipe(map(res => decodeRetrieveResourceFile(res)));
|
||||||
|
@ -244,61 +218,41 @@ export class MessageApiService {
|
||||||
/** del */
|
/** del */
|
||||||
public deleteMessage(req: DelRequest): Observable<DelResponse> {
|
public deleteMessage(req: DelRequest): Observable<DelResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.deleteMessage, encodeDel(req), {
|
||||||
this.urls.deleteMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeDel(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeDel(res)));
|
.pipe(map(res => decodeDel(res)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** save my message */
|
/** save my message */
|
||||||
public saveMyMessage(req: SaveMyRequest): Observable<SaveMyResponse> {
|
public saveMyMessage(req: SaveMyRequest): Observable<SaveMyResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.saveMyMessage, encodeSaveMy(req), {
|
||||||
this.urls.saveMyMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeSaveMy(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeSaveMy(res)));
|
.pipe(map(res => decodeSaveMy(res)));
|
||||||
}
|
}
|
||||||
public retrieveMyMessage(
|
public retrieveMyMessage(
|
||||||
req: RetrieveMyRequest
|
req: RetrieveMyRequest
|
||||||
): Observable<RetrieveMyResponse> {
|
): Observable<RetrieveMyResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.retrieveMyMessage, encodeRetrieveMy(req), {
|
||||||
this.urls.retrieveMyMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeRetrieveMy(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeRetrieveMy(res)));
|
.pipe(map(res => decodeRetrieveMy(res)));
|
||||||
}
|
}
|
||||||
public deleteMyMessage(req: DelMyRequest): Observable<DelMyResponse> {
|
public deleteMyMessage(req: DelMyRequest): Observable<DelMyResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.deleteMyMessage, encodeDelMy(req), {
|
||||||
this.urls.deleteMyMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeDelMy(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeDelMy(res)));
|
.pipe(map(res => decodeDelMy(res)));
|
||||||
}
|
}
|
||||||
public editMyMessage(req: EditMyRequest): Observable<EditMyResponse> {
|
public editMyMessage(req: EditMyRequest): Observable<EditMyResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.editMyMessage, encodeEditMy(req), {
|
||||||
this.urls.editMyMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeEditMy(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeEditMy(res)));
|
.pipe(map(res => decodeEditMy(res)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,9 +263,9 @@ export class MessageApiService {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(
|
||||||
this.urls.editReservationMessageEx,
|
this.urls.editReservationMessageEx,
|
||||||
{},
|
encodeEditReservation(req),
|
||||||
{
|
{
|
||||||
params: encodeEditReservation(req)
|
headers: this.headers
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.pipe(map(res => decodeEditReservation(res)));
|
.pipe(map(res => decodeEditReservation(res)));
|
||||||
|
@ -320,13 +274,9 @@ export class MessageApiService {
|
||||||
/** send-copy(forward) */
|
/** send-copy(forward) */
|
||||||
public sendCopyMessage(req: SendCopyRequest): Observable<SendCopyResponse> {
|
public sendCopyMessage(req: SendCopyRequest): Observable<SendCopyResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.sendCopyMessage, encodeSendCopy(req), {
|
||||||
this.urls.sendCopyMessage,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeSendCopy(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeSendCopy(res)));
|
.pipe(map(res => decodeSendCopy(res)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,13 +285,9 @@ export class MessageApiService {
|
||||||
req: UnreadCountRequest
|
req: UnreadCountRequest
|
||||||
): Observable<UnreadCountResponse> {
|
): Observable<UnreadCountResponse> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.post<any>(
|
.post<any>(this.urls.retrieveUnreadCount, encodeUnreadCount(req), {
|
||||||
this.urls.retrieveUnreadCount,
|
headers: this.headers
|
||||||
{},
|
})
|
||||||
{
|
|
||||||
params: encodeUnreadCount(req)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.pipe(map(res => decodeUnreadCount(res)));
|
.pipe(map(res => decodeUnreadCount(res)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { HttpParams } from '@angular/common/http';
|
import { HttpParams } from '@angular/common/http';
|
||||||
|
|
||||||
import { StatusCode } from '../types/status-code.type';
|
import { StatusCode } from '../types/status-code.type';
|
||||||
|
import { MessageStatusCode } from '../types/message-status-code.type';
|
||||||
|
|
||||||
export interface APIRequest {
|
export interface APIRequest {
|
||||||
_id?: string;
|
_id?: string;
|
||||||
|
@ -11,9 +12,16 @@ export interface APIResponse {
|
||||||
statusCode: StatusCode;
|
statusCode: StatusCode;
|
||||||
errorMessage: string;
|
errorMessage: string;
|
||||||
}
|
}
|
||||||
|
export interface MessageAPIResponse {
|
||||||
|
_id?: string;
|
||||||
|
responseCode: MessageStatusCode;
|
||||||
|
responseMsg: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type APIEncoder<REQ> = (req: REQ) => HttpParams;
|
export type APIEncoder<REQ> = (req: REQ) => HttpParams;
|
||||||
|
|
||||||
|
export type APIJsonEncoder<REQ> = (req: REQ) => string;
|
||||||
|
|
||||||
export type APIFormDataEncoder<REQ> = (req: REQ) => FormData;
|
export type APIFormDataEncoder<REQ> = (req: REQ) => FormData;
|
||||||
|
|
||||||
export type APIDecoder<RES> = (res: any) => RES;
|
export type APIDecoder<RES> = (res: any) => RES;
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
export enum MessageStatusCode {
|
||||||
|
/** 성공 */
|
||||||
|
Success = '00',
|
||||||
|
/** 사용자 토큰이 일치하지 않을 경우 발생 (인증 실패) */
|
||||||
|
Fail_Auth = '10',
|
||||||
|
/** 메시지 타입이 일치하지 않을 경우 발생 */
|
||||||
|
Fail_Msg_Type = '20',
|
||||||
|
/** 메시지 아이디가 NULL일 경우 발생 */
|
||||||
|
Fail_Msg_Id_Null = '21',
|
||||||
|
/** 예약 메시지 발송 시, 예약 시간이 지정되어있지 않을 경우 발생 */
|
||||||
|
Fail_Msg_Reservation_Time_Null = '22',
|
||||||
|
/** 메시지 발송 시, 제목이 최대 길이보다 길 경우 발생 */
|
||||||
|
Fail_Msg_Title_length = '23',
|
||||||
|
/** 예약 메시지 발송 시, 현재 시간 10분 전일 경우 발생 */
|
||||||
|
Fail_Msg_Reservation_Time_Less = '24',
|
||||||
|
/** 예약 메시지 수정 시, 발송 시간 10분 전일 경우 발생 */
|
||||||
|
Fail_Msg_Edit_Reservation_Time_Less = '25',
|
||||||
|
/** 예약 메시지 수정 및 발송 취소 시, 이미 발송된 메시지일 경우 발생 */
|
||||||
|
Fail_Msg_Edit_Cancel_Reservation_Sended = '26',
|
||||||
|
/** 파일 업로드 시, 경로가 올바르지 않을 경우 발생 */
|
||||||
|
Fail_File_Path = '40',
|
||||||
|
/** 파일 업로드 시, 파일 크기가 최대 크기보다 클 경우 발생 */
|
||||||
|
Fail_File_Size = '41',
|
||||||
|
/** 파일 업로드 시, 업로드할 수 없는 파일 형식일 경우 발생 */
|
||||||
|
Fail_File_Ext = '42',
|
||||||
|
/** Exception 에러 발생 */
|
||||||
|
Fail = '99'
|
||||||
|
}
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
export * from './lib/apis/api';
|
export * from './lib/apis/api';
|
||||||
|
|
||||||
|
export * from './lib/types/message-status-code.type';
|
||||||
export * from './lib/types/status-code.type';
|
export * from './lib/types/status-code.type';
|
||||||
|
|
||||||
export * from './lib/utils/json.util';
|
export * from './lib/utils/json.util';
|
||||||
|
|
|
@ -38,7 +38,7 @@ import {
|
||||||
RetrieveRequest
|
RetrieveRequest
|
||||||
} from '@ucap-webmessenger/api-message';
|
} from '@ucap-webmessenger/api-message';
|
||||||
import { DeviceType } from '@ucap-webmessenger/core';
|
import { DeviceType } from '@ucap-webmessenger/core';
|
||||||
import { StatusCode } from '@ucap-webmessenger/api';
|
import { StatusCode, MessageStatusCode } from '@ucap-webmessenger/api';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-layout-chat-right-drawer-message-box',
|
selector: 'app-layout-chat-right-drawer-message-box',
|
||||||
|
@ -93,7 +93,7 @@ export class MessageBoxComponent implements OnInit, OnDestroy {
|
||||||
.pipe(
|
.pipe(
|
||||||
map(res => {
|
map(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res.statusCode === StatusCode.Success) {
|
if (res.responseCode === MessageStatusCode.Success) {
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user