-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/notification' into develop
- Loading branch information
Showing
42 changed files
with
808 additions
and
202 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// import { ICommon } from '../types/common'; | ||
import { getRequest } from '../request'; | ||
import { NotificationList } from '../types/notification'; | ||
|
||
/* 알림 조회*/ | ||
|
||
export const noticeInfo = async (type: string, cursorId?: string) => { | ||
let url = `notification`; | ||
const params = []; | ||
|
||
if (type && type === 'RESERVATION') { | ||
params.push(`type=RESERVATION`); | ||
} else if (type && type === 'COMMUNITY') { | ||
params.push(`type=COMMUNITY`); | ||
} | ||
|
||
if (cursorId !== '0') { | ||
params.push(`cursorId=${cursorId}`); | ||
} | ||
|
||
if (params.length > 0) { | ||
url += `?${params.join('&')}`; | ||
} | ||
const response = await getRequest<NotificationList>(url); | ||
const lastVisible = | ||
response?.data?.content[response?.data?.content.length - 1].notificationId; | ||
return { | ||
content: response?.data?.content, | ||
lastVisible, | ||
hasNext: response?.data?.hasNext | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
import axios from 'axios'; | ||
|
||
interface IQuestion { | ||
title: string; | ||
content: string; | ||
} | ||
export const signinmock = async () => { | ||
const response = await axios.get(`/sign`); | ||
return response; | ||
}; | ||
|
||
export const questionpostmock = async ({ title, content }: IQuestion) => { | ||
const response = await axios.post(`/question`, { title, content }); | ||
return response; | ||
}; | ||
|
||
export const questiongetmock = async () => { | ||
const response = await axios.get(`/question`); | ||
return response; | ||
}; | ||
|
||
export const reservationgetmock = async () => { | ||
const response = await axios.get(`/notification/reservation`); | ||
return response; | ||
}; | ||
|
||
export const communitygetmock = async () => { | ||
const response = await axios.get(`/notification/community`); | ||
return response; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* 일대일 문의 전체 조회 */ | ||
|
||
import { getRequest } from '../request'; | ||
import { QuestionType } from '../types/question'; | ||
|
||
export const userinfo = async () => { | ||
const response = await getRequest<QuestionType>('privatePosts'); | ||
return response; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ICommon } from './common'; | ||
|
||
export interface NotificationType { | ||
notificationId: string; | ||
title: string; | ||
content: string; | ||
targetUrl: string; | ||
date: string; | ||
} | ||
|
||
interface NotificationListType { | ||
content: NotificationType[]; | ||
hasNext: boolean; | ||
} | ||
|
||
export type NotificationList = ICommon<NotificationListType>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ICommon } from './common'; | ||
|
||
interface QuestionPost { | ||
id: number; | ||
title: string; | ||
content: string; | ||
branchName: string; | ||
createdDate: string; | ||
} | ||
|
||
interface QuestionPosttResponse { | ||
privatePostList: QuestionPost[]; | ||
hasNext: boolean; | ||
} | ||
|
||
interface Message { | ||
message: string; | ||
} | ||
|
||
export type QuestionType = ICommon<QuestionPosttResponse & Message>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.