Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions ACON-iOS/ACON-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
15304FC22E33C57A00EFCDEF /* CafeFeatureSelectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15304FC12E33C57A00EFCDEF /* CafeFeatureSelectionViewController.swift */; };
15304FC82E33EFA600EFCDEF /* SpotUploadSizeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15304FC72E33EFA600EFCDEF /* SpotUploadSizeType.swift */; };
1530CC792DDFC0D100EB4AEC /* SpotNoImageContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1530CC782DDFC0D100EB4AEC /* SpotNoImageContentView.swift */; };
15432E7D2E41ECCA0005DB90 /* PostSpotUploadRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15432E7C2E41ECCA0005DB90 /* PostSpotUploadRequest.swift */; };
15432E802E41ECDD0005DB90 /* SpotUploadTargetType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15432E7F2E41ECDD0005DB90 /* SpotUploadTargetType.swift */; };
15432E822E41ECF40005DB90 /* SpotUploadService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15432E812E41ECF40005DB90 /* SpotUploadService.swift */; };
1547A6EB2D337F4100E96616 /* SpotListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1547A6EA2D337F4100E96616 /* SpotListView.swift */; };
1547A6EF2D33854B00E96616 /* SpotListCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1547A6EE2D33854B00E96616 /* SpotListCollectionViewCell.swift */; };
1547A6F22D33AD4500E96616 /* SpotListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1547A6F12D33AD4500E96616 /* SpotListModel.swift */; };
Expand Down Expand Up @@ -358,6 +361,9 @@
15304FC12E33C57A00EFCDEF /* CafeFeatureSelectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CafeFeatureSelectionViewController.swift; sourceTree = "<group>"; };
15304FC72E33EFA600EFCDEF /* SpotUploadSizeType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotUploadSizeType.swift; sourceTree = "<group>"; };
1530CC782DDFC0D100EB4AEC /* SpotNoImageContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotNoImageContentView.swift; sourceTree = "<group>"; };
15432E7C2E41ECCA0005DB90 /* PostSpotUploadRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostSpotUploadRequest.swift; sourceTree = "<group>"; };
15432E7F2E41ECDD0005DB90 /* SpotUploadTargetType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotUploadTargetType.swift; sourceTree = "<group>"; };
15432E812E41ECF40005DB90 /* SpotUploadService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotUploadService.swift; sourceTree = "<group>"; };
1547A6EA2D337F4100E96616 /* SpotListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotListView.swift; sourceTree = "<group>"; };
1547A6EE2D33854B00E96616 /* SpotListCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotListCollectionViewCell.swift; sourceTree = "<group>"; };
1547A6F12D33AD4500E96616 /* SpotListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotListModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -716,6 +722,24 @@
path = Component;
sourceTree = "<group>";
};
15432E7B2E41ECB30005DB90 /* SpotUpload */ = {
isa = PBXGroup;
children = (
15432E7E2E41ECD00005DB90 /* DTO */,
15432E7F2E41ECDD0005DB90 /* SpotUploadTargetType.swift */,
15432E812E41ECF40005DB90 /* SpotUploadService.swift */,
);
path = SpotUpload;
sourceTree = "<group>";
};
15432E7E2E41ECD00005DB90 /* DTO */ = {
isa = PBXGroup;
children = (
15432E7C2E41ECCA0005DB90 /* PostSpotUploadRequest.swift */,
);
path = DTO;
sourceTree = "<group>";
};
1547A6E92D326EDB00E96616 /* Type */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1465,6 +1489,7 @@
7462617C2D3F9E9400A4E84F /* SpotDetail */,
746F15B42D3E2041003EA031 /* LocalVerification */,
746261602D3E9F6000A4E84F /* Upload */,
15432E7B2E41ECB30005DB90 /* SpotUpload */,
D6AF15612D3E8A3700289683 /* Onboarding */,
151003E72D5FBEE900409DF4 /* Profile */,
74D297EF2D63432900DDEE31 /* Image */,
Expand Down Expand Up @@ -2205,6 +2230,7 @@
155422A42E41E00300547471 /* ACTargetType.swift in Sources */,
748D6F912D2BD450007690B4 /* UILabel+.swift in Sources */,
746261772D3EA88700A4E84F /* GetAcornCountResponse.swift in Sources */,
15432E802E41ECDD0005DB90 /* SpotUploadTargetType.swift in Sources */,
745ECB9D2D614183005129B0 /* PhotoSelectionViewController.swift in Sources */,
156AE6792DE0F1D300AE800D /* NoMatchingSpotListItemSizeType.swift in Sources */,
15A2461A2DE7A9E500469272 /* NoMatchingSpotListCollectionViewCell.swift in Sources */,
Expand Down Expand Up @@ -2317,6 +2343,7 @@
74D31C7A2D5841EA00B4B2B4 /* PhotoCollectionViewController.swift in Sources */,
74B967D52E3D181C008F8360 /* NaverSearchService.swift in Sources */,
746261632D3EA1D500A4E84F /* GetSearchSuggestionResponse.swift in Sources */,
15432E822E41ECF40005DB90 /* SpotUploadService.swift in Sources */,
15D6901E2DD723FA0009278D /* SpotDetailMoreViewController.swift in Sources */,
746F5BEC2DE009450081569B /* ACToastView.swift in Sources */,
15A167E42E3D964400062C49 /* SpotUploadSuccessViewController.swift in Sources */,
Expand Down Expand Up @@ -2372,6 +2399,7 @@
151003F02D5FC4C600409DF4 /* ProfileTargetType.swift in Sources */,
1515CE0D2E00823B00A559A2 /* DeepLinkManager.swift in Sources */,
156AE67B2DE0F37100AE800D /* NoMatchingSpotHeader.swift in Sources */,
15432E7D2E41ECCA0005DB90 /* PostSpotUploadRequest.swift in Sources */,
745C7E152D35AEC10074DBDB /* SpotSearchViewModel.swift in Sources */,
741368002DD516680075D06A /* SearchSuggestionCollectionViewCell.swift in Sources */,
15CF62C22D577B600000A10F /* ProfileValidMessageType.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ enum ACAlertType: CaseIterable {
case logout // NOTE: 로그아웃

case deletePhoto // NOTE: 사진 삭제 (장소 업로드)
case spotUploadFail // NOTE: 장소 업로드 실패

var title: String {
switch self {
Expand Down Expand Up @@ -64,14 +65,17 @@ enum ACAlertType: CaseIterable {

case .deletePhoto:
return "사진을 삭제 하시겠습니까?"

case .spotUploadFail:
return "장소 업로드 실패"
}
}

var description: String? {
switch self {
case .locationAccessDenied:
return "설정에서 위치접근 권한을 허용해주세요."
case .locationAccessFail:
case .locationAccessFail, .spotUploadFail:
return "문제가 발생했습니다.\n나중에 다시 시도해주세요."
case .reviewLocationFail:
return "현재 위치와 리뷰 등록 장소가\n오차범위 밖에 있습니다.\n좀 더 가까이 이동해보세요."
Expand Down
2 changes: 1 addition & 1 deletion ACON-iOS/ACON-iOS/Global/Utils/Enums/ImageType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ enum ImageType: String {

case REVIEW

case SPOT
case APPLY_SPOT

}
2 changes: 2 additions & 0 deletions ACON-iOS/ACON-iOS/Network/Base/ACService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ final class ACService {

lazy var uploadService: UploadService = UploadService()

lazy var spotUploadService = SpotUploadService()

lazy var onboardingService: OnboardingService = OnboardingService()

lazy var spotListService = SpotListService()
Expand Down
10 changes: 0 additions & 10 deletions ACON-iOS/ACON-iOS/Network/SpotList/DTO/PostSpotListRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ struct SpotConditionDTO: Encodable {

let filterList: [SpotFilterDTO]?

enum CodingKeys: CodingKey {
case spotType, filterList, walkingTime, priceRange
}

func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.spotType, forKey: .spotType)
try container.encodeIfPresent(self.filterList, forKey: .filterList)
}

}

struct SpotFilterDTO: Encodable {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// PostSpotUploadRequest.swift
// ACON-iOS
//
// Created by 김유림 on 8/5/25.
//

import Foundation

struct PostSpotUploadRequest: Encodable {

let spotName: String

let address: String

let spotType: String

let featureList: [SpotUploadFeatureDTO]

let recommendedMenu: String

let imageList: [String]?

}

struct SpotUploadFeatureDTO: Encodable {

let category: String

let optionList: [String]

}
33 changes: 33 additions & 0 deletions ACON-iOS/ACON-iOS/Network/SpotUpload/SpotUploadService.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// SpotUploadService.swift
// ACON-iOS
//
// Created by 김유림 on 8/5/25.
//

import Foundation

import Moya

protocol SpotUploadServiceProtocol {

func postSpotUpload(requestBody: PostSpotUploadRequest,
completion: @escaping (NetworkResult<EmptyResponse>) -> Void)

}

final class SpotUploadService: BaseService<SpotUploadTargetType>, SpotUploadServiceProtocol {

func postSpotUpload(requestBody: PostSpotUploadRequest, completion: @escaping (NetworkResult<EmptyResponse>) -> Void) {
self.provider.request(.postSpotUpload(requestBody)) { result in
switch result {
case .success(let response):
let networkResult: NetworkResult<EmptyResponse> = self.judgeStatus(statusCode: response.statusCode, data: response.data, type: EmptyResponse.self)
completion(networkResult)
case .failure:
completion(.networkFail)
}
}
}

}
50 changes: 50 additions & 0 deletions ACON-iOS/ACON-iOS/Network/SpotUpload/SpotUploadTargetType.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// SpotUploadTargetType.swift
// ACON-iOS
//
// Created by 김유림 on 8/5/25.
//

import Foundation

import Moya

enum SpotUploadTargetType {

case postSpotUpload(_ requestBody: PostSpotUploadRequest)

}

extension SpotUploadTargetType: ACTargetType {

var method: Moya.Method {
switch self {
case .postSpotUpload:
return .post
}
}

var path: String {
switch self {
case .postSpotUpload:
return utilPath + "spots/apply"
}
}

var task: Task {
switch self {
case .postSpotUpload(let requestBody):
return .requestJSONEncodable(requestBody)
}
}

var headers: [String : String]? {
var headers = HeaderType.noHeader
switch self {
case .postSpotUpload:
headers = HeaderType.headerWithToken()
}
return headers
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import Foundation

enum SpotUploadType {

case restaurantFeature, cafeFeature, priceValue
case restaurantFeature, cafeFeature, price

var serverKey: String {
switch self {
case .restaurantFeature: return "RESTAURANT_FEATURE"
case .cafeFeature: return "CAFE_FEATURE"
case .priceValue: return "PRICE"
case .price: return "PRICE"
}
}

Expand Down Expand Up @@ -76,9 +76,30 @@ extension SpotUploadType {
}


// MARK: - Cafe

enum CafeOptionType {

case workFriendly

var text: String {
switch self {
case .workFriendly: return StringLiterals.SpotUpload.workFriendly
}
}

var serverKey: String {
switch self {
case .workFriendly: return "WORK_FRIENDLY"
}
}

}


// MARK: - Price

enum ValueRatingType: CaseIterable {
enum PriceValueType: CaseIterable {

case low, average, best

Expand All @@ -92,8 +113,8 @@ extension SpotUploadType {

var serverKey: String {
switch self {
case .low: return "VALUE_FOR_MONEY"
case .average: return "AVERAGE"
case .low: return "LOW_VALUE"
case .average: return "AVERAGE_VALUE"
case .best: return "VALUE_FOR_MONEY"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SpotUploadPhotoViewController: BaseUploadInquiryViewController {

setDelegate()
registerCells()
bind()
observeViewModel()
}

override func setLayout() {
Expand All @@ -89,7 +89,7 @@ class SpotUploadPhotoViewController: BaseUploadInquiryViewController {
}
}

private func bind() {
private func observeViewModel() {
viewModel.photosToAppend.bind { [weak self] photos in
guard let self, let photos else { return }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ class SpotUploadSearchViewController: BaseUploadInquiryViewController {
override var canGoPrevious: Bool { false }

override var canGoNext: Bool {
guard let spotName = viewModel.spotName else { return false }
guard let spotName = viewModel.selectedSpot?.spotName else { return false }
return !spotName.isEmpty
}

private var selectedSpotName: String = ""

private var spotUploadSearchViewModel = SpotUploadSearchViewModel()

private let acDebouncer = ACDebouncer(delay: 0.3)
Expand Down Expand Up @@ -158,10 +156,7 @@ private extension SpotUploadSearchViewController {
}

guard let text else { return }

self?.viewModel.spotName = text
self?.updatePagingButtonStates()


self?.spotSearchView.searchEmptyView.isHidden = text.isEmpty
self?.spotSearchView.searchKeywordCollectionView.isHidden = text.isEmpty

Expand Down Expand Up @@ -205,9 +200,11 @@ extension SpotUploadSearchViewController: UICollectionViewDelegateFlowLayout {
}

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
selectedSpotName = spotUploadSearchViewModel.naverSearchResult.value?[indexPath.item].spotName ?? ""
spotSearchView.searchTextField.text = selectedSpotName
let selectedSpot = spotUploadSearchViewModel.naverSearchResult.value?[indexPath.item]
viewModel.selectedSpot = selectedSpot
spotSearchView.searchTextField.text = selectedSpot?.spotName
self.dismissKeyboard()
self.updatePagingButtonStates()
}

}
Expand Down
Loading