feat: 콘텐츠 수정 작업

This commit is contained in:
2025-04-18 14:40:39 +09:00
parent 9665189c95
commit 6c014fe0ce
19 changed files with 304 additions and 23 deletions
@@ -4,8 +4,10 @@ import type {
ContentsService,
ContentsParams,
ContentsList,
Contents,
ContentsFormData,
ContentsVersionParams,
ContentsVersionList,
ContentsDetail,
} from "../model/contents-interface";
export class ContentsApiService implements ContentsService {
@@ -17,9 +19,22 @@ export class ContentsApiService implements ContentsService {
return response.data;
}
public async getContentsInfo(contsSn: number): Promise<Contents> {
const response = await client.get<Contents>(
`${ENDPOINT.CMS_SERVICE.CONTENTS}/${contsSn}`,
public async getContentsVersionList(
params: ContentsVersionParams,
): Promise<ContentsVersionList> {
const response = await client.get<ContentsVersionList>(
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}`,
{ params },
);
return response.data;
}
public async getLatestContentsInfo(
contsSn: number,
contsVer: number,
): Promise<ContentsDetail> {
const response = await client.get<ContentsDetail>(
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}/${contsSn}/${contsVer}`,
);
return response.data;
}
@@ -34,10 +49,11 @@ export class ContentsApiService implements ContentsService {
public async updateContents(
contsSn: number,
contsVer: number,
data: ContentsFormData,
): Promise<void> {
const response = await client.put<void>(
`${ENDPOINT.CMS_SERVICE.CONTENTS}/${contsSn}`,
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}/${contsSn}/${contsVer}`,
data,
);
return response.data;