[cs] WIP: 알림톡템플릿관리
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
import { client } from "@/shared/api";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
import {
|
||||
type NtftalkBiztalkCheckInspectionResponse,
|
||||
type NtftalkBiztalkInspectionRequestItem,
|
||||
type NtftalkBiztalkInspectionResponse,
|
||||
type NtftalkBiztalkSender,
|
||||
type NtftalkBiztalkService,
|
||||
type NtftalkBiztalkSyncTemplatesParams,
|
||||
type NtftalkBiztalkSyncTemplatesResponse,
|
||||
} from "../model/ntftalk-biztalk-interface";
|
||||
|
||||
export const NtftalkBiztalkApi: NtftalkBiztalkService = {
|
||||
async getSender(): Promise<NtftalkBiztalkSender> {
|
||||
const response = await client.get<NtftalkBiztalkSender>(
|
||||
`${ENDPOINT.NTFTALK_SERVICE.NTFTALK_BIZTALK}/sender`,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async syncTemplates(
|
||||
params?: NtftalkBiztalkSyncTemplatesParams,
|
||||
): Promise<NtftalkBiztalkSyncTemplatesResponse> {
|
||||
const response = await client.post<NtftalkBiztalkSyncTemplatesResponse>(
|
||||
`${ENDPOINT.NTFTALK_SERVICE.NTFTALK_BIZTALK}/sync-templates`,
|
||||
undefined,
|
||||
{
|
||||
params: {
|
||||
senderKeyType: params?.senderKeyType,
|
||||
},
|
||||
},
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async requestInspection(
|
||||
requestList: NtftalkBiztalkInspectionRequestItem[],
|
||||
): Promise<NtftalkBiztalkInspectionResponse> {
|
||||
const response = await client.post<NtftalkBiztalkInspectionResponse>(
|
||||
`${ENDPOINT.NTFTALK_SERVICE.NTFTALK_BIZTALK}/request-inspection`,
|
||||
requestList,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async cancelInspection(
|
||||
requestList: NtftalkBiztalkInspectionRequestItem[],
|
||||
): Promise<NtftalkBiztalkInspectionResponse> {
|
||||
const response = await client.post<NtftalkBiztalkInspectionResponse>(
|
||||
`${ENDPOINT.NTFTALK_SERVICE.NTFTALK_BIZTALK}/cancel-inspection`,
|
||||
requestList,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async checkInspection(
|
||||
templateCode: string,
|
||||
): Promise<NtftalkBiztalkCheckInspectionResponse> {
|
||||
const response = await client.get<NtftalkBiztalkCheckInspectionResponse>(
|
||||
`${ENDPOINT.NTFTALK_SERVICE.NTFTALK_BIZTALK}/check-inspection/${encodeURIComponent(templateCode)}`,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user