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

[Feat] 마이페이지 메인 화면 구현 #214

Merged
merged 22 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cde40f0
[ADD] 프로필 기본 이미지 추가
soobin-k Mar 12, 2023
3e1547e
[ADD] 내 정보 조회 API 관련 파일 추가
soobin-k Mar 12, 2023
e1dabcc
[ADD] 마이페이지 파일 추가
soobin-k Mar 12, 2023
5fd5967
[CHORE] MyPageViewController 탭바 연결
soobin-k Mar 12, 2023
a0c672e
[ADD] 이미지 추가
soobin-k Mar 12, 2023
475a8f0
[FEAT] 마이페이지 메인 화면 UI
soobin-k Mar 12, 2023
a70724f
[ADD] MyPageSectionFooterView 추가
soobin-k Mar 12, 2023
dc3238e
Merge remote-tracking branch 'refs/remotes/origin/develop'
soobin-k Mar 12, 2023
804d232
[ADD] addBorder 함수 추가
soobin-k Mar 12, 2023
739ce80
[CHORE] header, footer 뷰 roundCorner 추가
soobin-k Mar 12, 2023
20419e8
[ADD] 마이페이지 네트워크 파일 추가
soobin-k Mar 12, 2023
60623a9
[FEAT] 마이페이지 > 모임 조회 API 연동
soobin-k Mar 12, 2023
79e7e78
[FIX] 섹션 접을 때 레이아웃 겹치는 현상 제거
soobin-k Mar 12, 2023
d37e1fd
[CHORE] 알람 타입값 변경
soobin-k Mar 13, 2023
1ddc840
[CHORE] 내모임 조회 > 플러빙 타입값 변경
soobin-k Mar 13, 2023
70596cc
[FEAT] 내모임 조회 4가지 API 동시 호출 로직 추가
soobin-k Mar 13, 2023
7a0c64c
[FEAT] 섹션 접고 펴기 로직 추가
soobin-k Mar 13, 2023
c4d5a71
[CHORE] 더미 데이터 제거
soobin-k Mar 13, 2023
a258960
[CHORE] 주석 추가
soobin-k Mar 13, 2023
244f588
[CHORE] 플러빙 메인 진입 시, 탭바 hidden
soobin-k Mar 13, 2023
85bd699
[CHORE] pr 리뷰 반영
soobin-k Mar 15, 2023
8ab40f9
Merge remote-tracking branch 'refs/remotes/origin/develop'
soobin-k Mar 15, 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
92 changes: 92 additions & 0 deletions PLUB.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions PLUB/Assets.xcassets/MyPage/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
23 changes: 23 additions & 0 deletions PLUB/Assets.xcassets/MyPage/foldedArrow.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "unfoldedArrow.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions PLUB/Assets.xcassets/MyPage/pencil.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "pencil.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions PLUB/Assets.xcassets/MyPage/setting.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions PLUB/Assets.xcassets/MyPage/unfoldedArrow.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "unfoldedArrow.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions PLUB/Configuration/Extensions/Ex+CALayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,32 @@ extension CALayer {
let rect = bounds.insetBy(dx: dxValue, dy: dxValue)
shadowPath = UIBezierPath(rect: rect).cgPath
}

func addBorder(
_ edges: [UIRectEdge],
color: UIColor,
width: CGFloat
) {
for edge in edges {
let border = CALayer()
switch edge {
case UIRectEdge.top:
border.frame = CGRect.init(x: 0, y: 0, width: frame.width, height: width)
break
case UIRectEdge.bottom:
border.frame = CGRect.init(x: 0, y: frame.height - width, width: frame.width, height: width)
break
case UIRectEdge.left:
border.frame = CGRect.init(x: 0, y: 0, width: width, height: frame.height)
break
case UIRectEdge.right:
border.frame = CGRect.init(x: frame.width - width, y: 0, width: width, height: frame.height)
break
default:
break
}
border.backgroundColor = color.cgColor
self.addSublayer(border)
}
}
}
2 changes: 1 addition & 1 deletion PLUB/Configuration/Extensions/Ex+UIColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extension UIColor {
static let background: UIColor = .init(hex: 0xF5F3F6)
static let deepGray: UIColor = .init(hex: 0x8C8C8C)
static let mediumGray: UIColor = .init(hex: 0xC4C4C4)
static let lightGray: UIColor = .init(hex: 0xE4E4E4)
static let lightGray: UIColor = .init(hex: 0xF2F3F4)
static let black: UIColor = .init(hex: 0x363636)
static let error: UIColor = .init(hex: 0xF75B2B)
}
18 changes: 18 additions & 0 deletions PLUB/Sources/Models/Account/Response/MyInfoResponse.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// MyInfoResponse.swift
// PLUB
//
// Created by 김수빈 on 2023/03/12.
//

import Foundation

struct MyInfoResponse: Codable {
let email: String
let nickname: String
let socialType: String
let birthday: String
let gender: String
let introduce: String
let profileImage: String?
}
13 changes: 13 additions & 0 deletions PLUB/Sources/Models/MyPage/Request/MyPlubbingParameter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// MyPlubbingParameter.swift
// PLUB
//
// Created by 김수빈 on 2023/03/13.
//

import Foundation

struct MyPlubbingParameter: Encodable {
let status: String
let cursorId: Int
}
39 changes: 39 additions & 0 deletions PLUB/Sources/Models/MyPage/Response/MyPlubbingResponse.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// MyPlubbingResponse.swift
// PLUB
//
// Created by 김수빈 on 2023/03/13.
//

import Foundation

enum PlubbingStatusType: String, CaseIterable {
case recruiting = "RECRUITING"
case waiting = "WAITING"
case active = "ACTIVE"
case end = "END"
}

struct MyPlubbingResponse: Codable {
let plubbingStatus: PlubbingStatusType.RawValue
let plubbings: [MyPagePlubbing]

enum CodingKeys: String, CodingKey {
case plubbingStatus
case plubbings
}
}

struct MyPagePlubbing: Codable {
let plubbingID: Int
let name: String
let goal: String
let iconImage: String
let myPlubbingStatus: String

enum CodingKeys: String, CodingKey {
case plubbingID = "plubbingId"
case name = "title"
case goal, iconImage, myPlubbingStatus
}
}
9 changes: 6 additions & 3 deletions PLUB/Sources/Network/Routers/AccountRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Alamofire

enum AccountRouter {
case inquireMyInfo
case validateNickname(String)
case inquireInterest
case registerInterest(RegisterInterestRequest)
Expand All @@ -16,7 +17,7 @@ enum AccountRouter {
extension AccountRouter: Router {
var method: HTTPMethod {
switch self {
case .validateNickname, .inquireInterest:
case .inquireMyInfo, .validateNickname, .inquireInterest:
return .get
case .registerInterest:
return .post
Expand All @@ -25,6 +26,8 @@ extension AccountRouter: Router {

var path: String {
switch self {
case .inquireMyInfo:
return "/accounts/me"
case let .validateNickname(nickname):
return "/accounts/check/nickname/\(nickname)"
case .inquireInterest:
Expand All @@ -38,14 +41,14 @@ extension AccountRouter: Router {
switch self {
case .validateNickname:
return .default
case .inquireInterest, .registerInterest:
case .inquireMyInfo, .inquireInterest, .registerInterest:
return .withAccessToken
}
}

var parameters: ParameterType {
switch self {
case .inquireInterest, .validateNickname:
case .inquireMyInfo, .inquireInterest, .validateNickname:
return .plain
case .registerInterest(let request):
return .body(request)
Expand Down
43 changes: 43 additions & 0 deletions PLUB/Sources/Network/Routers/MyPageRouter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// MyPageRouter.swift
// PLUB
//
// Created by 김수빈 on 2023/03/13.
//

import Alamofire

enum MyPageRouter {
case inquireMyMeeting(MyPlubbingParameter)
}

extension MyPageRouter: Router {
var method: HTTPMethod {
switch self {
case .inquireMyMeeting:
return .get
}
}

var path: String {
switch self {
case .inquireMyMeeting:
return "/plubbings/all/my"
}
}

var parameters: ParameterType {
switch self {
case .inquireMyMeeting(let parameter):
return .query(parameter)
}
}

var headers: HeaderType {
switch self {
case .inquireMyMeeting:
return .withAccessToken
}
}
}

4 changes: 4 additions & 0 deletions PLUB/Sources/Network/Services/AccountService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ final class AccountService: BaseService {
}

extension AccountService {
func inquireMyInfo() -> PLUBResult<MyInfoResponse> {
return sendRequest(AccountRouter.inquireMyInfo, type: MyInfoResponse.self)
}

func validateNickname(_ nickname: String) -> PLUBResult<EmptyModel> {
return sendRequest(AccountRouter.validateNickname(nickname))
}
Expand Down
29 changes: 29 additions & 0 deletions PLUB/Sources/Network/Services/MyPageService.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// MyPageService.swift
// PLUB
//
// Created by 김수빈 on 2023/03/13.
//

import RxSwift

final class MyPageService: BaseService {
static let shared = MyPageService()

private override init() { }
}

extension MyPageService {
func inquireMyMeeting(
status: PlubbingStatusType,
cursorID: Int
) -> PLUBResult<MyPlubbingResponse> {
return sendRequest(
MyPageRouter.inquireMyMeeting(
.init(
status:status.rawValue,
cursorId: cursorID
)
), type: MyPlubbingResponse.self)
}
}
1 change: 1 addition & 0 deletions PLUB/Sources/Views/Meeting/MeetingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ extension MeetingViewController: UICollectionViewDelegate, UICollectionViewDataS
// 플러빙 메인
let vc = MainPageViewController()
vc.navigationItem.largeTitleDisplayMode = .never
vc.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(vc, animated: true)
} else {
// 모임 생성
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum ScheduleAlarmType: String, CaseIterable {
case .before5Minute:
return "FIVE_MINUTES"
case .before15Minute:
return "TEN_MINUTES"
return "FIFTEEN_MINUTES"
case .before30Minute:
return "THIRTY_MINUTES"
case .before1Hour:
Expand Down
Loading