Skip to content

Commit

Permalink
Merge pull request #214 from PLUB2022/feat/130-MyPage/Main
Browse files Browse the repository at this point in the history
[Feat] 마이페이지 메인 화면 구현
  • Loading branch information
soobin-k authored Mar 15, 2023
2 parents 0de3dd7 + 8ab40f9 commit e7226da
Show file tree
Hide file tree
Showing 36 changed files with 1,020 additions and 6 deletions.
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" : "unfoldedArrow@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "unfoldedArrow@3x.png",
"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" : "pencil@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pencil@3x.png",
"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" : "setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "setting@3x.png",
"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" : "unfoldedArrow@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "unfoldedArrow@3x.png",
"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

0 comments on commit e7226da

Please sign in to comment.