Skip to content

[IDLE-000] 요양보호사는 공고상세 화면을 확인하고 관심이 있는 공고를 iOS에서 즐겨찾기 및 확인을 할 수 있다. #44

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

Merged
merged 21 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ac5669a
[IDLE-313] 요양보호사 메인화면 메인 코디네이터 구현
J0onYEong Aug 15, 2024
15c1269
[IDLE-163] WorkerEmployCardRO구현
J0onYEong Aug 15, 2024
779f5b6
[IDLE-163] WorkerRecruitmentPostBoardVC 구현
J0onYEong Aug 15, 2024
6f33ed7
[IDLE-163] 요양보호사 진행중인 공고화면 확인 화면 구현
J0onYEong Aug 15, 2024
6e1eca8
[IDLE-000] caption2 타이포 그래피 추가
J0onYEong Aug 15, 2024
ef358a0
[IDLE-000] 탭바아이템 라벨 텍스트 색상 변경
J0onYEong Aug 15, 2024
98448c2
[IDLE-163] 요양보호사가 확인할 수 있는 정보를 가져오는 DTO및 레포지토리 구현
J0onYEong Aug 15, 2024
825d627
[IDLE-163] PostDetailForWorkerVC바인드 함수 구현
J0onYEong Aug 15, 2024
8a1e653
[IDLE-163] 공고 상세 조회하기 화면 이동 구현
J0onYEong Aug 15, 2024
7cc1f48
[IDLE-163] 공고 상세화면 공고카드 타이포 그래프 수정
J0onYEong Aug 16, 2024
1545a6b
[IDLE-163] 공고 상세화면에서 센터프로필 보기 구현완료
J0onYEong Aug 16, 2024
c85936e
[IDLE-163] 공고 상세화면 공고불러오기 실패시 alert구현
J0onYEong Aug 16, 2024
e757282
[IDLE-163] 프로필 정보를 불러올 수 없는 경우 화면 탈출 처리
J0onYEong Aug 16, 2024
5d31ee5
[IDLE-163] 지도뷰 옵션 설정 구현
J0onYEong Aug 16, 2024
a8d9a36
[IDLE-163] 풀스크린 지도뷰 구현및 네비게이션 작업 완료
J0onYEong Aug 16, 2024
6d71a30
[IDLE-163] StarredAndAppliedVC 생성
J0onYEong Aug 16, 2024
d0c88b3
[IDLE-163] 요양보호사 공고 전체조회 API 구현
J0onYEong Aug 16, 2024
dd15ef9
[IDLE-163] 요양보호사 메인화면 페이징 기능 구현
J0onYEong Aug 17, 2024
d91b0af
[IDLE-163] WorkerStaticPostBoardVMable 구현
J0onYEong Aug 19, 2024
7631851
[IDLE-163] 찜한공고및 즐겨찾기한 공고 화면 구현완료
J0onYEong Aug 19, 2024
717112e
[IDLE-000] 테스트실패 해결
J0onYEong Aug 19, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ extension CenterProfileRegisterCoordinator {

func showMyCenterProfile() {
let coordinator = CenterProfileCoordinator(
mode: .myProfile,
profileUseCase: injector.resolve(CenterProfileUseCase.self),
navigationController: navigationController
dependency: .init(
mode: .myProfile,
profileUseCase: injector.resolve(CenterProfileUseCase.self),
navigationController: navigationController
)
)
addChildCoordinator(coordinator)
coordinator.parent = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import UIKit
import DSKit
import PresentationCore
import RootFeature
import UseCaseInterface

class WorkerMainCoordinator: ParentCoordinator {

Expand Down Expand Up @@ -54,7 +55,7 @@ class WorkerMainCoordinator: ParentCoordinator {
func createNavForTab(page: IdleWorkerMainPage) -> UINavigationController {

let tabNavController = UINavigationController()
tabNavController.setNavigationBarHidden(false, animated: false)
tabNavController.setNavigationBarHidden(true, animated: false)

startTabCoordinator(
page: page,
Expand All @@ -66,19 +67,27 @@ class WorkerMainCoordinator: ParentCoordinator {
// #2. 생성한 컨트롤러를 각 탭별 Coordinator에 전달
func startTabCoordinator(page: IdleWorkerMainPage, navigationController: UINavigationController) {

var coordinator: ChildCoordinator!
var coordinator: Coordinator!

switch page {
case .home:
coordinator = RecruitmentBoardCoordinator(
navigationController: navigationController
coordinator = WorkerRecruitmentBoardCoordinator(
depedency: .init(
navigationController: navigationController,
centerProfileUseCase: injector.resolve(CenterProfileUseCase.self),
recruitmentPostUseCase: injector.resolve(RecruitmentPostUseCase.self)
)
)
case .preferredPost:
coordinator = ApplyManagementCoordinator(
navigationController: navigationController
coordinator = AppliedAndLikedBoardCoordinator(
depedency: .init(
navigationController: navigationController,
centerProfileUseCase: injector.resolve(CenterProfileUseCase.self),
recruitmentPostUseCase: injector.resolve(RecruitmentPostUseCase.self)
)
)
case .setting:
coordinator = RecruitmentBoardCoordinator(
coordinator = SettingCoordinator(
navigationController: navigationController
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import RxSwift
import Entity
import NetworkDataSource
import Foundation
import Moya

public class DefaultRecruitmentPostRepository: RecruitmentPostRepository {

Expand All @@ -21,6 +22,7 @@ public class DefaultRecruitmentPostRepository: RecruitmentPostRepository {
}
}

// MARK: Center
public func registerPost(bundle: RegisterRecruitmentPostBundle) -> RxSwift.Single<Void> {

let encodedData = try! JSONEncoder().encode(bundle.toDTO())
Expand All @@ -47,6 +49,36 @@ public class DefaultRecruitmentPostRepository: RecruitmentPostRepository {
with: .withToken
).map { _ in () }
}

// MARK: Worker
public func getPostDetailForWorker(id: String) -> RxSwift.Single<Entity.RecruitmentPostForWorkerBundle> {
service.request(
api: .postDetail(id: id, userType: .worker),
with: .withToken
)
.map(RecruitmentPostDTO.self)
.map { dto in
dto.toEntity()
}
}

public func getNativePostListForWorker(nextPageId: String?, requestCnt: Int = 10) -> RxSwift.Single<Entity.RecruitmentPostListForWorkerVO> {

service.request(
api: .nativePostList(nextPageId: nextPageId, requestCnt: String(requestCnt)),
with: .withToken
)
.map(RecruitmentPostListForWorkerDTO.self)
.catch({ error in
if let moyaError = error as? MoyaError, case .objectMapping(let error, let response) = moyaError {
print(error.localizedDescription)
}
return .error(error)
})
.map { dto in
dto.toEntity()
}
}
}

fileprivate extension RegisterRecruitmentPostBundle {
Expand Down
2 changes: 1 addition & 1 deletion project/Projects/Data/NetworkDataSource/API/AuthAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public enum AuthAPI {

extension AuthAPI: BaseAPI {

public var apiType: APIType { .auth}
public var apiType: APIType { .auth }

public var method: Moya.Method {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Moya
import Foundation
import Alamofire
import Entity

public enum RcruitmentPostAPI {
Expand All @@ -19,6 +20,9 @@ public enum RcruitmentPostAPI {
case editPost(id: String, postData: Data)
case removePost(id: String)
case closePost(id: String)

// Worker
case nativePostList(nextPageId: String?, requestCnt: String)
}

extension RcruitmentPostAPI: BaseAPI {
Expand All @@ -39,6 +43,8 @@ extension RcruitmentPostAPI: BaseAPI {
"/\(id)"
case .closePost(let id):
"/\(id)/end"
case .nativePostList:
""
}
}

Expand All @@ -54,18 +60,38 @@ extension RcruitmentPostAPI: BaseAPI {
.delete
case .closePost:
.patch
case .nativePostList:
.get
}
}

var bodyParameters: Parameters? {
var params: Parameters = [:]
switch self {
case .nativePostList(let nextPageId, let requestCnt):
if let nextPageId {
params["next"] = nextPageId
}
params["limit"] = requestCnt
default:
break
}
return params
}

var parameterEncoding: ParameterEncoding {
switch self {
case .nativePostList:
return URLEncoding.queryString
default:
return JSONEncoding.default
}
}

public var task: Moya.Task {
switch self {
case .nativePostList:
.requestParameters(parameters: bodyParameters ?? [:], encoding: parameterEncoding)
case .registerPost(let bodyData):
.requestData(bodyData)
case .editPost(_, let editData):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ extension UserInformationAPI: BaseAPI {
.post
case .getMyWorkerProfile:
.get
case .getOtherWorkerProfile(id: let id):
case .getOtherWorkerProfile:
.get
case .updateWorkerProfile(data: let data):
case .updateWorkerProfile:
.patch
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public struct RecruitmentPostFetchDTO: Codable {
age: Int,
weight: Int?,
careLevel: Int,
mentalStatus: String,
mentalStatus: String,
disease: String?,
lifeAssistance: [String]?,
extraRequirement: String?,
Expand Down Expand Up @@ -132,7 +132,17 @@ public struct RecruitmentPostFetchDTO: Codable {
workTimeAndPay.workStartTime = IdleDateComponent.toEntity(text: startTime)
workTimeAndPay.workEndTime = IdleDateComponent.toEntity(text: endTime)
workTimeAndPay.paymentType = PaymentType.toEntity(text: payType)
workTimeAndPay.paymentAmount = String(payAmount)

let payAmount = String(payAmount)
var formedPayAmount = ""
for (index, char) in payAmount.reversed().enumerated() {
if (index % 3) == 0, index != 0 {
formedPayAmount += ","
}
formedPayAmount += String(char)
}

workTimeAndPay.paymentAmount = formedPayAmount

let addressInfo: AddressInputStateObject = .init()
addressInfo.addressInfo = .init(
Expand Down Expand Up @@ -184,7 +194,7 @@ public struct RecruitmentPostFetchDTO: Codable {
}
}

fileprivate extension ApplyType {
extension ApplyType {
static func toEntity(text: String) -> ApplyType {
switch text {
case "CALLING":
Expand All @@ -200,7 +210,7 @@ fileprivate extension ApplyType {
}
}

fileprivate extension ApplyDeadlineType {
extension ApplyDeadlineType {
static func toEntity(text: String) -> ApplyDeadlineType {
switch text {
case "UNLIMITED":
Expand All @@ -214,7 +224,7 @@ fileprivate extension ApplyDeadlineType {
}
}

fileprivate extension DailySupportType {
extension DailySupportType {
static func toEntity(text: String) -> DailySupportType {
switch text {
case "CLEANING":
Expand All @@ -234,7 +244,7 @@ fileprivate extension DailySupportType {
}
}

fileprivate extension Gender {
extension Gender {
static func toEntity(text: String) -> Gender {
switch text {
case "MAN":
Expand All @@ -248,7 +258,7 @@ fileprivate extension Gender {
}
}

fileprivate extension PaymentType {
extension PaymentType {

static func toEntity(text: String) -> PaymentType {
switch text {
Expand All @@ -265,7 +275,7 @@ fileprivate extension PaymentType {
}
}

fileprivate extension IdleDateComponent {
extension IdleDateComponent {

static func toEntity(text: String) -> IdleDateComponent {
let timeArr = text.split(separator: ":")
Expand All @@ -283,7 +293,7 @@ fileprivate extension IdleDateComponent {
}
}

fileprivate extension CognitionDegree {
extension CognitionDegree {
static func toEntity(text: String) -> CognitionDegree {
switch text {
case "NORMAL":
Expand All @@ -299,7 +309,7 @@ fileprivate extension CognitionDegree {
}
}

fileprivate extension WorkDay {
extension WorkDay {

static func toEntity(text: String) -> WorkDay {

Expand Down
Loading
Loading