Skip to content

Commit

Permalink
Merge pull request #161 from Sopt-Mongle/feature/#152
Browse files Browse the repository at this point in the history
Feature/#152 버그 수정
  • Loading branch information
seu11ee authored Nov 19, 2020
2 parents 6224536 + 95fa6ab commit 8ff92c7
Show file tree
Hide file tree
Showing 27 changed files with 325 additions and 210 deletions.
8 changes: 6 additions & 2 deletions Mongle/Mongle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
7FFEA28724BF768D003D381A /* EditorPickData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FFEA28624BF768D003D381A /* EditorPickData.swift */; };
7FFEA28924BF9C72003D381A /* TodaySentenceData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FFEA28824BF9C72003D381A /* TodaySentenceData.swift */; };
7FFEA28B24BFAC77003D381A /* MainCuratorData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FFEA28A24BFAC77003D381A /* MainCuratorData.swift */; };
B816185F25663D6500307B53 /* PasswordChangeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = B816185E25663D6400307B53 /* PasswordChangeService.swift */; };
B8218AC9255F8289003AA1AA /* ServicePolicy.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B8218AC8255F8289003AA1AA /* ServicePolicy.storyboard */; };
B8218ACC255F82BD003AA1AA /* ServicePolicyVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8218ACB255F82BD003AA1AA /* ServicePolicyVC.swift */; };
B8218B1A256000E3003AA1AA /* OpenSource.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B8218B19256000E2003AA1AA /* OpenSource.storyboard */; };
Expand Down Expand Up @@ -308,6 +309,7 @@
7FFEA28624BF768D003D381A /* EditorPickData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditorPickData.swift; sourceTree = "<group>"; };
7FFEA28824BF9C72003D381A /* TodaySentenceData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodaySentenceData.swift; sourceTree = "<group>"; };
7FFEA28A24BFAC77003D381A /* MainCuratorData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainCuratorData.swift; sourceTree = "<group>"; };
B816185E25663D6400307B53 /* PasswordChangeService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordChangeService.swift; sourceTree = "<group>"; };
B8218AC8255F8289003AA1AA /* ServicePolicy.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = ServicePolicy.storyboard; sourceTree = "<group>"; };
B8218ACB255F82BD003AA1AA /* ServicePolicyVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServicePolicyVC.swift; sourceTree = "<group>"; };
B8218B19256000E2003AA1AA /* OpenSource.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = OpenSource.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -622,6 +624,7 @@
EC849310255BD99B003B4149 /* SignUpEmailService.swift */,
EC84931C255D1892003B4149 /* SignUpDuplicateService.swift */,
B8218B2F25610356003AA1AA /* WithdrawService.swift */,
B816185E25663D6400307B53 /* PasswordChangeService.swift */,
);
path = APIService;
sourceTree = "<group>";
Expand Down Expand Up @@ -1063,6 +1066,7 @@
B8B48B3524BC676500551F5B /* CuratorTabInfoVC.swift in Sources */,
B8E2E15924C0A71E00595752 /* SearchSentenceService.swift in Sources */,
7FFEA26A24BE3317003D381A /* MonglesVC.swift in Sources */,
B816185F25663D6500307B53 /* PasswordChangeService.swift in Sources */,
7F1E719D24B46E3C00D79516 /* MainPopularThemaCVC.swift in Sources */,
7FC5B4D324BB61A4007C1725 /* WritingSentenceInThemeVC.swift in Sources */,
EC6E99CA2508C9D900B57284 /* SignUpAgreeVC.swift in Sources */,
Expand Down Expand Up @@ -1309,7 +1313,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = io.github.juhyeoklee.Mongle3;
PRODUCT_BUNDLE_IDENTIFIER = io.github.juhyeoklee.Mongle;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1328,7 +1332,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = io.github.juhyeoklee.Mongle3;
PRODUCT_BUNDLE_IDENTIFIER = io.github.juhyeoklee.Mongle;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
4 changes: 2 additions & 2 deletions Mongle/Mongle/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand Down Expand Up @@ -78,5 +76,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions Mongle/Mongle/Resource/APIService/APIConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ struct APIConstants {
static let signupEmailURL = baseURL + "/users/auth"
static let signupDuplicateURL = baseURL + "/users/duplicate"
static let withdrawURL = baseURL + "/users/withdraw"
static let passwordChangeURL = baseURL + "/users/changePassword"
}
63 changes: 63 additions & 0 deletions Mongle/Mongle/Resource/APIService/PasswordChangeService.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//
// PasswordChangeService.swift
// Mongle
//
// Created by 이예슬 on 11/19/20.
// Copyright © 2020 이주혁. All rights reserved.
//

import Foundation
import Alamofire
struct PasswordChangeService{
static let shared = PasswordChangeService()

private func makeParameter(_ password : String)-> Parameters{
return ["password" : password]
}

func putRequest(password:String, completion : @escaping (NetworkResult<Any>) -> Void){
let header : HTTPHeaders = ["Content-Type" : "application/json", "token" : UserDefaults.standard.string(forKey: "token")!]

let dataRequest = Alamofire.request(APIConstants.passwordChangeURL,
method: .put,
parameters: makeParameter(password),
encoding: JSONEncoding.default,
headers: header)


dataRequest.responseData { dataResponse in
switch dataResponse.result {
case .success :
guard let statusCode = dataResponse.response?.statusCode else {return}
guard let data = dataResponse.value else {return}
let networkResult = self.judgePut(by: statusCode, data)
completion(networkResult)

case .failure :

completion(.networkFail)


}
}
}
private func judgePut( by statusCode:Int, _ data :Data) -> NetworkResult<Any> {
let decoder = JSONDecoder()

guard let decodedData = try? decoder.decode(GenericResponse<String>.self, from: data)
else { return .pathErr }

switch statusCode{
case 200 :
return .success(decodedData.message)
case 400_:
return .requestErr(decodedData.message)
case 600 :
return .serverErr
default :
return .networkFail
}

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "searchResultThemeBtnBack.png"
},
{
"scale" : "2x",
"idiom" : "universal",
"filename" : "[email protected]"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "[email protected]"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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: 11 additions & 12 deletions Mongle/Mongle/Resource/Storyboard/CuratorTabKeyword.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="collection view cell content view" minToolsVersion="11.0"/>
Expand All @@ -30,34 +30,34 @@
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CuratorListCVC" id="ewe-Sr-P5O" customClass="CuratorListCVC" customModule="Mongle" customModuleProvider="target">
<rect key="frame" x="43" y="0.0" width="328" height="120"/>
<rect key="frame" x="0.0" y="0.0" width="128" height="120"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<collectionViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="bay-D4-7N8">
<rect key="frame" x="0.0" y="0.0" width="328" height="120"/>
<rect key="frame" x="0.0" y="0.0" width="128" height="120"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sentenceThemeOImgCurator1010" translatesAutoresizingMaskIntoConstraints="NO" id="SVV-RK-E1p">
<rect key="frame" x="18" y="28" width="65" height="65"/>
<rect key="frame" x="28" y="28" width="65" height="65"/>
<constraints>
<constraint firstAttribute="width" constant="65" id="BsK-RE-yFT"/>
<constraint firstAttribute="width" secondItem="SVV-RK-E1p" secondAttribute="height" multiplier="1:1" id="Qca-IZ-XTY"/>
<constraint firstAttribute="height" constant="65" id="W9C-v7-JaF"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0N5-VZ-kBL">
<rect key="frame" x="105" y="30" width="37.5" height="18"/>
<rect key="frame" x="115" y="30" width="37.5" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lQT-cx-AZf">
<rect key="frame" x="105" y="51" width="33" height="16"/>
<rect key="frame" x="115" y="51" width="33" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aOZ-sO-S4F">
<rect key="frame" x="105" y="75" width="120" height="14.5"/>
<rect key="frame" x="115" y="75" width="120" height="14.5"/>
<constraints>
<constraint firstAttribute="width" constant="120" id="Cfr-Xw-4OQ"/>
</constraints>
Expand All @@ -66,7 +66,7 @@
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KbD-r2-jKY">
<rect key="frame" x="240" y="46" width="60" height="28"/>
<rect key="frame" x="40" y="46" width="60" height="28"/>
<color key="backgroundColor" red="0.45098039220000002" green="0.75294117650000003" blue="0.53333333329999999" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="Hxa-eu-bs1"/>
Expand All @@ -84,15 +84,14 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h7Y-NM-KSE">
<rect key="frame" x="0.0" y="119" width="328" height="1"/>
<rect key="frame" x="0.0" y="119" width="128" height="1"/>
<color key="backgroundColor" red="0.90588235289999997" green="0.90588235289999997" blue="0.90588235289999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="OBO-ed-enA"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="lQT-cx-AZf" secondAttribute="trailing" constant="190" id="2Fy-n0-CdO"/>
<constraint firstAttribute="trailing" secondItem="h7Y-NM-KSE" secondAttribute="trailing" id="4p7-KO-myK"/>
<constraint firstItem="h7Y-NM-KSE" firstAttribute="leading" secondItem="bay-D4-7N8" secondAttribute="leading" id="86k-CG-Uoy"/>
<constraint firstAttribute="bottom" secondItem="h7Y-NM-KSE" secondAttribute="bottom" id="Dqs-gK-Xbn"/>
Expand All @@ -107,7 +106,7 @@
<constraint firstAttribute="bottom" secondItem="KbD-r2-jKY" secondAttribute="bottom" constant="46" id="iYn-Xi-awk"/>
<constraint firstAttribute="bottom" secondItem="SVV-RK-E1p" secondAttribute="bottom" constant="27" id="p88-Q7-X1V"/>
<constraint firstItem="aOZ-sO-S4F" firstAttribute="top" secondItem="lQT-cx-AZf" secondAttribute="bottom" constant="8" id="qPG-5z-CNW"/>
<constraint firstItem="SVV-RK-E1p" firstAttribute="leading" secondItem="bay-D4-7N8" secondAttribute="leading" constant="18" id="t0h-XR-YRg"/>
<constraint firstItem="SVV-RK-E1p" firstAttribute="leading" secondItem="bay-D4-7N8" secondAttribute="leading" constant="28" id="t0h-XR-YRg"/>
</constraints>
</collectionViewCellContentView>
<connections>
Expand Down
Loading

0 comments on commit 8ff92c7

Please sign in to comment.