Skip to content

Commit

Permalink
merge complete
Browse files Browse the repository at this point in the history
  • Loading branch information
Leewonyooung committed Dec 31, 2024
1 parent 12ca48e commit 9de2b61
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 73 deletions.
29 changes: 16 additions & 13 deletions DateSpot/DateSpot/View/Detail/RestaurantDetailInfoView.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftUI

struct RestaurantDetailInfoView: View {
var restaurant: Restaurant
@State var restaurant: Restaurant
@EnvironmentObject var appState: AppState
@StateObject private var ratingViewModel = RatingViewModel()
@State private var rates: Int = 0 // StarRatingView와 바인딩할 별점 값
Expand All @@ -17,18 +17,21 @@ struct RestaurantDetailInfoView: View {
Spacer()

Button(action: {
print(appState.userEmail ?? "")
}) {
HStack {
Image(systemName: "paperplane.fill")
.foregroundColor(.white)
Text("Navigate")
.foregroundColor(.white)
}
.padding()
.background(Color.blue)
.cornerRadius(8)
}
print(appState.userEmail ?? "")
}) {
NavigationLink(destination: DetailMap(restaurants: $restaurant, images: $images), label: {
HStack {
Image(systemName: "paperplane.fill")
.foregroundColor(.white)
Text("Navigate")
.foregroundColor(.white)
}
})
.padding()
.background(Color.blue)
.cornerRadius(8)
}

}

VStack(alignment: .leading) {
Expand Down
39 changes: 21 additions & 18 deletions DateSpot/DateSpot/View/TabBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,31 @@ struct TabBarView: View {
@EnvironmentObject var appState: AppState // 전역 상태 사용

var body: some View {
TabView {
DetailView()
.tabItem {
Label("", systemImage: "house.fill")
}
NavigationStack{
TabView {
HomeContentView()
.tabItem {
Label("", systemImage: "house.fill")
}

TabbarMapView()
.tabItem {
Label("지도", systemImage: "map.fill")
}
TabbarMapView()
.tabItem {
Label("지도", systemImage: "map.fill")
}

BookMarkView()
.tabItem {
Label("북마크", systemImage: "bookmark.fill")
}
BookMarkView()
.tabItem {
Label("북마크", systemImage: "bookmark.fill")
}

UserView()
.tabItem {
Label("프로필", systemImage: "person.fill")
}
UserView()
.tabItem {
Label("프로필", systemImage: "person.fill")
}
}
.environmentObject(appState) // 전역 상태 전달
}
.environmentObject(appState) // 전역 상태 전달

}
}

Expand Down
4 changes: 2 additions & 2 deletions fastapi/hosts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fastapi import APIRouter, HTTPException, Request
from fastapi import HTTPException
import os
import pymysql , json
import pymysql
from redis.asyncio import Redis
import boto3
from botocore.exceptions import NoCredentialsError, PartialCredentialsError
Expand Down
35 changes: 1 addition & 34 deletions fastapi/parking.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,8 @@
from fastapi import APIRouter
import hosts



router = APIRouter()


# @app.get('/api_parkinginfo')
# def fetch_pakring(): # 자치구 입력
# try:
# url = f'http://openapi.seoul.go.kr:8088/496c726e54746c733132325669414e57/json/GetParkingInfo/3/1000'
# response = requests.get(url=url)
# data = response.json()
# results = data["GetParkingInfo"]["row"]
# unique_parking = {row["PKLT_CD"]: row for row in results}.values()
# data = []
# for result in unique_parking :
# data.append({
# "name" : result['PKLT_NM'],
# "address" : result["ADDR"],
# "latitude" : result["LAT"],
# "longitude" : result["LOT"]
# })
# print(data.__len__())
# return {"result" : data}
# except Exception as e :
# print("parking_info", e)
# return {"result" : e}







@router.get("/select_parkinginfo")
async def select():
try:
Expand All @@ -53,6 +22,4 @@ async def select():
return {"result": results}
except Exception as e:
print("parking.py select Error", e)
return {"parking.py select Error": str(e)}


return {"parking.py select Error": str(e)}
6 changes: 0 additions & 6 deletions fastapi/place.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def remove_invisible_characters(input_str: str) -> str:
# 모든 비표시 가능 문자를 제거 (공백, 제어 문자 포함)
return ''.join(ch for ch in input_str if ch.isprintable())

import unicodedata

def normalize_place_name_nfd(name: str) -> str:
"""
Expand Down Expand Up @@ -61,10 +60,6 @@ def remove_invisible_characters(input_str: str) -> str:







@router.get("/images")
async def get_images(name: str):
"""
Expand All @@ -78,7 +73,6 @@ async def get_images(name: str):
prefix = f"명소/{normalized_name}_"


# S3에서 파일 검색 (Prefix 적용)
response = s3_client.list_objects_v2(Bucket=hosts.BUCKET_NAME, Prefix=normalize_place_name_nfd(prefix))

if "Contents" not in response or not response["Contents"]:
Expand Down

0 comments on commit 9de2b61

Please sign in to comment.