Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POST] 핀보기 기능 #103

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
09f2b7c
feat: 핀보기 슬라이드 구현중
KimKyungYun Aug 2, 2023
f95e024
feat: comment 목록 가져오기
KimKyungYun Aug 6, 2023
0e2eb1c
feat: 상점정보api연결, 슬라이드쇼 제작
KimKyungYun Aug 20, 2023
4512e0a
feat: 이미지 슬라이드 제작
KimKyungYun Aug 20, 2023
800c76e
feat: 글 작성하기 버튼 추가
KimKyungYun Aug 20, 2023
0ab4656
feat: 리뷰가 없을때 화면 추가
KimKyungYun Aug 28, 2023
233754b
feat: scrap api 추가
KimKyungYun Aug 28, 2023
d7b72af
feat: 북마크 api 연결
KimKyungYun Aug 29, 2023
78be6ae
fix: props지정
KimKyungYun Aug 29, 2023
959f631
feat: 44branch병합, placeId api 수정
KimKyungYun Aug 31, 2023
b609bc3
feat: plceId 연결
KimKyungYun Sep 2, 2023
43f614c
fix: sidenav에 맞춰 디자인 변경, 호출 위치 수정
KimKyungYun Sep 3, 2023
83d1cd8
fix: lint수정
KimKyungYun Sep 3, 2023
4facf0b
fix: 핀 선택시만 핀보기 표시
KimKyungYun Sep 4, 2023
0026837
fix: 로딩 완료 후 한번에 보여주기
KimKyungYun Sep 4, 2023
deb79ac
Merge branch 'develop' into feature/#24
KimKyungYun Sep 5, 2023
675ecb3
fix: 마커 정보 수정
KimKyungYun Sep 6, 2023
f14402d
fix: 주석제거
KimKyungYun Sep 7, 2023
0f2f9cc
Merge remote-tracking branch 'origin/develop' into feature/#24
KimKyungYun Sep 12, 2023
152faca
fix: usequeries로 변경, 사진, 문구변경
KimKyungYun Sep 12, 2023
53d03b4
fix: pin 기능들 훅으로 분리
KimKyungYun Oct 17, 2023
94bab77
fix: 스크랩동작에 따라 스크랩목록을 다시 받아오도록 수정
KimKyungYun Oct 17, 2023
f9055c1
fix: placeId 가져오는 기능 훅으로 분리
KimKyungYun Oct 17, 2023
8e1fbf9
Merge remote-tracking branch 'origin/develop' into feature/#24
KimKyungYun Oct 31, 2023
6bfeecf
fix: 쿼리명 수정, 버튼 커서추가
KimKyungYun Oct 31, 2023
c685bca
feat: develop merge
KimKyungYun Nov 13, 2023
0597ad0
feat: 모바일 핀보기 추가
KimKyungYun Nov 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions src/api/review/entity.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
export interface PostReviewParams {
content:string;
placeId:string;
rate:number;
reviewImages?:Array<string>;
}

export interface LatestReviewResponse {
lastDate:null | string;
}

export interface FetchParams {
placeId:string;
sort:string;
}

export interface GetReviewResponse {
content:Review[];
empty:boolean;
first:boolean;
last:boolean;
number:boolean;
numberOfElements:number;
pageable:Pagable;
size:number;
sort:Sort;
totalElements:number;
totalPages:number;
}

interface Review {
content:string;
createdAt:string;
id:number;
rate:number;
reviewImages:ReviewImage[];
shopPlaceId:string;
userReviewResponse:UserReviewResponse;
}

interface Pagable {
offset:number;
pageNumber:number;
pageSize:number;
paged:boolean;
sort:Sort;
unpaged:boolean;
}

interface ReviewImage {
imageUrl:string;
originalname:string;
}

interface UserReviewResponse {
account:string;
id:number;
nickname:string;
}

interface Sort {
empty:boolean;
sorted:boolean;
unsorted:boolean;
}

export interface ReviewParams {
placeId : string;
content : string;
Expand Down
24 changes: 23 additions & 1 deletion src/api/review/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
import { ReviewParams } from './entity';
import reviewApi from './reviewApiClient';
import {
GetReviewResponse, LatestReviewResponse, FetchParams, ReviewParams,
} from './entity';

export const getMyReview = async (params:FetchParams) => {
const { data } = await reviewApi.get<GetReviewResponse>(`/shop/${params.placeId}?sort=${params.sort}`);
return data;
};

export const getFollowersReview = async (params:FetchParams) => {
const { data } = await reviewApi.get<GetReviewResponse>(`/followers/shop/${params.placeId}?sort=${params.sort}`);
return data;
};

export const latestFollowerReview = async (placeId:string) => {
const { data } = await reviewApi.get<LatestReviewResponse>(`/followers/last-date/shop/${placeId}`);
return data;
};

export const latestMyReview = async (placeId:string) => {
const { data } = await reviewApi.get<LatestReviewResponse>(`/last-date/shop/${placeId}`);
return data;
};

export const postReview = (params: ReviewParams) => {
const formData = new FormData();
Expand Down
58 changes: 58 additions & 0 deletions src/api/scrap/entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
export interface PostScrapParams {
directoryId:number;
placeId:string;
}

export interface PostScrapResponse {
createdAt:string;
directory:{
createdAt:string;
id:number;
name:string;
scrapCount:number;
updatedAt:string;
}
id:number;
shopId:number;
updatedAt:string;
}

export interface GetScrapResponse {
content: Content[];
empty:boolean;
first:boolean;
last:boolean;
number:number;
numberOfElements:number;
pagable: Pagable;
size:number;
sort: Sort;
totalElements:number;
totalPages:number;
}

interface Content {
address:string;
category:string;
name:string;
photo:string;
placeId:string;
ratingCount:number;
scrapId:number;
totalRating:number;
}

interface Pagable {
offset:number;
pageNumber:number;
pageSize:number;
paged:boolean;
sort: Sort[];
unpaged:boolean;
}

interface Sort {
empty:boolean;
sorted:boolean;
unsorted:boolean;
}
14 changes: 14 additions & 0 deletions src/api/scrap/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { PostScrapParams, GetScrapResponse, PostScrapResponse } from './entity';
import scrapApi from './scrapApiClient';

export const postScrap = async (params:PostScrapParams) => {
const { data } = await scrapApi.post<PostScrapResponse>('/scraps', params);
return data;
};

export const deleteScrap = async (scrapId:number) => scrapApi.delete(`/scraps/${scrapId}`);

export const getScrap = async () => {
const { data } = await scrapApi.get<GetScrapResponse>('/scraps');
return data;
};
18 changes: 18 additions & 0 deletions src/api/scrap/scrapApiClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import axios from 'axios';
import { API_PATH } from 'config/constants';

const scrapApi = axios.create({
baseURL: `${API_PATH}`,
timeout: 2000,
});

scrapApi.interceptors.request.use(
(config) => {
const accessToken = sessionStorage.getItem('accessToken');
// eslint-disable-next-line no-param-reassign
if (config.headers && accessToken) config.headers.Authorization = `Bearer ${accessToken}`;
return config;
},
);

export default scrapApi;
18 changes: 18 additions & 0 deletions src/api/shop/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@ export interface Coords {
lng: number | undefined;
}

export interface FetchShopResponse {
businessDay:string[];
category:string;
formattedAddress:string;
formattedPhoneNumber:string;
lat:number;
lng:number;
name:string;
openNow:boolean;
photos:string[];
placeId:string;
ratingCount:number;
scrap:number;
shopId:number;
todayBusinessHour:string;
totalRating:number;
}

export interface FetchShopsResponse {
shopQueryResponseList: Shop[];
}
Expand Down
7 changes: 5 additions & 2 deletions src/api/shop/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import {
Coords, FetchShopsResponse, FetchTrendingsResponse, FilterShopsParams,
FilterShopsListResponse, ShopsParams,
FilterShopsListResponse, ShopsParams, FetchShopResponse,
} from './entity';
import shopApi from './shopApiClient';

export const fetchTrendings = () => shopApi.get<FetchTrendingsResponse>('/trending');

export const fetchShop = (shopId: string) => shopApi.get(`/shop?place_id=${shopId}`);
export const fetchShop = async (placeId: string) => {
const { data } = await shopApi.get<FetchShopResponse>(`/shops/${placeId}`);
return data;
};

export const getfilterShops = (params: FilterShopsParams, location: Coords) => {
const url = `/shops/maps?options_friend=${params.options_friend}&options_nearby=${params.options_nearby}&options_scrap=${params.options_scrap}`;
Expand Down
5 changes: 5 additions & 0 deletions src/assets/svg/pin/bookmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/svg/pin/bookmark_activated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions src/assets/svg/pin/empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading