-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-화면 이동 동작 수정 -비밀번호 입력 기능 -연결코드/인증코드 관련 기능 -유효성검사 관련 작업 Related to:#30
- Loading branch information
Showing
17 changed files
with
688 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,43 @@ | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
|
||
import '../model/user_model.dart'; | ||
|
||
// 영화 데이터 전체를 가져오는 함수 | ||
Future<List<Map<String, dynamic>>> getMovieData() async { | ||
// movie_data 컬렉션에 저장되어 있는 모든 문서를 가져온다. | ||
var querySnapShot = await FirebaseFirestore.instance.collection('movie_data').get(); | ||
|
||
// 데이터를 담을 리스트 | ||
List<Map<String, dynamic>> results = []; | ||
Future<void> saveUser(UserModel user) async { | ||
await FirebaseFirestore.instance.collection('userData').add({ | ||
"user_idx": user.userIdx, | ||
"login_type": user.loginType, | ||
"user_account": user.userAccount, | ||
"user_nickname": user.userNickname, | ||
"user_birth": user.userBirth, | ||
"user_profileImage": user.userProfileImage, | ||
"lover_user_idx": user.loverUserIdx, | ||
"lover_nickname": user.loverNickname, | ||
"home_preset_type": user.homePresetType, | ||
"top_bar_type": user.topBarType, | ||
"profile_message": user.profileMessage, | ||
"alarms_allow": user.alarmsAllow, | ||
"app_lock_state": user.appLockState, | ||
"top_bar_activate": user.topBarActivate, | ||
"lock_password": user.lockPassword, | ||
"user_state": user.lockPassword, | ||
"love_dDay": user.loveDday, | ||
}); | ||
} | ||
|
||
// 데이터를 리스트에 담아준다. | ||
// 컬렉션에 담긴 모든 문서를 가져와 반복한다. | ||
for(var doc in querySnapShot.docs){ | ||
// 문서에 담긴 데이터를 맵으로 추출하여 리스트에 담는다. | ||
results.add(doc.data()); | ||
} | ||
Future<void> setUserIndexx(int idx) async { | ||
await FirebaseFirestore.instance | ||
.collection('Sequence') | ||
.doc('DiarySequence') | ||
.set({'value': idx}); | ||
} | ||
|
||
return results; | ||
} | ||
// // 지금 뜨는 콘텐츠 정보를 가져온다. | ||
// Future<int> getUserIndex() async { | ||
// | ||
// var querySnapshot = await FirebaseFirestore.instance.collection('userData').where("user_idx").get(); | ||
// | ||
// List<int> results = List<int>.from(querySnapshot.docs[0].data()['hot_movie_idx']); | ||
// | ||
// return results; | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.