Skip to content

Commit

Permalink
Merge pull request #217 from FinalDoubleTen/dev
Browse files Browse the repository at this point in the history
Env: 여정페이지 2차배포
  • Loading branch information
LeHiHo authored Jan 21, 2024
2 parents 72a9064 + d530e38 commit 3c5f516
Show file tree
Hide file tree
Showing 92 changed files with 2,738 additions and 651 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@radix-ui/react-radio-group": "^1.1.3",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5",
"@radix-ui/react-toggle-group": "^1.0.4",
"@stomp/stompjs": "^7.0.0",
"@svgr/rollup": "^8.1.0",
Expand Down
35 changes: 35 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 7 additions & 10 deletions src/@types/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type subInfoRes = {
status: number;
message: string;
data: {
tripId: number;
tripId: string;
startDate: string;
endDate: string;
numberOfPeople: number;
Expand All @@ -16,7 +16,7 @@ export type subItemRes = {
status: number;
message: string;
data: {
tripId: number;
tripId: string;
visitDate: string;
transportation: 'CAR' | 'PUBLIC_TRANSPORTATION';
tripItems: {
Expand Down Expand Up @@ -52,7 +52,7 @@ export type subPathRes = {
status: number;
message: string;
data: {
tripId: number;
tripId: string;
visitDate: string;
transportation: 'CAR' | 'PUBLIC_TRANSPORTATION';
paths: {
Expand All @@ -77,16 +77,12 @@ export type subMemberRes = {
status: number;
message: string;
data: {
tripId: number;
connectedMembers: {
memberId: number;
name: string;
thumbnailUrl: string;
}[];
tripId: string;
tripMembers: {
memberId: number;
name: string;
thumbnailUrl: string;
connected: boolean;
}[];
numberOfPeople: number;
} | null;
Expand All @@ -95,7 +91,7 @@ export type subBudgetRes = {
status: number;
message: string;
data: {
tripId: number;
tripId: string;
budget: number;
calculatedPrice: number;
} | null;
Expand All @@ -107,6 +103,7 @@ export type SocketContextType = {
tripPath: subPathRes | null;
tripMember: subMemberRes | null;
tripBudget: subBudgetRes | null;
tripId: string;
callBackPub: (callback: () => void) => void;
};

Expand Down
22 changes: 9 additions & 13 deletions src/@types/socket.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type subInfoMessage = (message: {
status: number;
message: string;
data: {
tripId: number;
tripId: string;
startDate: string;
endDate: string;
numberOfPeople: number;
Expand All @@ -16,7 +16,7 @@ type subItemMessage = (response: {
status: number;
message: string;
data: {
tripId: number;
tripId: string;
visitDate: string;
transportation: 'CAR' | 'PUBLIC_TRANSPORTATION';
tripItems: {
Expand All @@ -36,7 +36,7 @@ type subPathMessage = (response: {
status: number;
message: string;
data: {
tripId: number;
tripId: string;
visitDate: string;
transportation: 'CAR' | 'PUBLIC_TRANSPORTATION';
paths: {
Expand All @@ -61,16 +61,12 @@ type subMemberMessage = (response: {
status: number;
message: string;
data: {
tripId: number;
connectedMembers: {
memberId: number;
name: string;
thumbnailUrl: string;
}[];
tripId: string;
tripMembers: {
memberId: number;
name: string;
thumbnailUrl: string;
connected: boolean;
}[];
numberOfPeople: number;
};
Expand All @@ -80,7 +76,7 @@ type subBudgetMessage = (response: {
status: number;
message: string;
data: {
tripId: number;
tripId: string;
budget: number;
calculatedPrice: number;
};
Expand All @@ -102,9 +98,9 @@ interface pubAddTripItem {
}

interface pubUpdatePrice {
tripId: number;
tripId: string;
visitDate: string;
price: number;
price: string;
}

interface pubUpdateTripItem {
Expand Down Expand Up @@ -132,7 +128,7 @@ interface pubDeleteItem {
}

interface pubMember {
memberId: number;
token: string;
}

interface pubGetPathAndItems {
Expand Down
15 changes: 15 additions & 0 deletions src/@types/tours.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,18 @@ export interface TourType {
longitude?: string;
latitude?: string;
}

export interface LikedListType {
tripLikedItemId: number;
tourItemId: number;
contentTypeId: number;
title: string;
ratingAverage: number;
reviewCount: number;
smallThumbnailUrl: string;
tourAddress: string;
prefer: boolean;
notPrefer: boolean;
preferTotalCount: number;
notPreferTotalCount: number;
}
38 changes: 35 additions & 3 deletions src/@types/trips.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ interface TripRequest {
numberOfPeople: number;
startDate: string | null;
endDate: string | null;
area: string | null;
subarea: string | null;
area?: string | null;
subarea?: string | null;
}

interface MyTripType {
tripId: number;
tripId: string;
tripName: string;
startDate: string;
endDate: string;
Expand All @@ -18,3 +18,35 @@ interface MyTripType {
area: string;
subArea: string;
}

interface ourTripType {
tripLikedItemId: number;
tourItemId: number;
contentTypeId: number;
ratingAverage: number;
reviewCount: number;
smallThumbnailUrl: string;
tourAddress: string;
prefer: boolean;
notPrefer: boolean;
preferTotalCount: number;
notPreferTotalCount: number;
title: string;
}

interface ThumbsProps {
tripId: string;
tourId: number;
prefer: boolean;
notPrefer: boolean;
}

interface AuthorityType {
status: number;
message: string;
data: {
memberId: number;
tripAuthority: string;
tripId: string;
};
}
13 changes: 4 additions & 9 deletions src/api/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const pubAddTripItem = (
// 여행 아이템 예상 가격 업데이트 이벤트 발생시
export const pubUpdatePrice = (
pubUpdatePrice: pubUpdatePrice,
tripItemId: string,
tripItemId: number,
) => {
socketClient.publish({
destination: `/pub/tripItems/${tripItemId}/updatePrice`,
Expand All @@ -101,18 +101,15 @@ export const pubUpdateTripItem = (
destination: `/pub/trips/${tripId}/updateTripItemOrder`,
body: JSON.stringify(pubUpdateTripItem),
});

console.log(pubUpdateTripItem);
console.log('펍실행');
};

// 여행 날짜별 교통 수단 변경 이벤트 발생시 (01/16 업데이트)
export const pubUpdateTransportation = (
pubUpdateTransportation: pubUpdateTransportation,
trips: string,
tripId: string,
) => {
socketClient.publish({
destination: `/pub/trips/${trips}/updateTransportation`,
destination: `/pub/trips/${tripId}/updateTransportation`,
body: JSON.stringify(pubUpdateTransportation),
});
};
Expand All @@ -137,7 +134,6 @@ export const pubDeleteItem = (
destination: `/pub/tripItems/${tripItemId}/deleteItem`,
body: JSON.stringify(pubDeleteItem),
});
console.log(pubDeleteItem);
};

// 멤버 여정 페이지로 입장 이벤트 발생시
Expand All @@ -157,10 +153,9 @@ export const pubDisconnectMember = (pubMember: pubMember, tripId: string) => {
};

// 여정 편집 페이지 입장 이벤트 발생시(모든 sub 다받음)
export const pubEnterMember = (pubMember: pubMember, tripId: string) => {
export const pubEnterMember = (tripId: string) => {
socketClient.publish({
destination: `/pub/trips/${tripId}/enterMember`,
body: JSON.stringify(pubMember),
});
};

Expand Down
Loading

0 comments on commit 3c5f516

Please sign in to comment.