forked from kookmin-sw/cap-template
-
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.
Merge pull request #48 from kookmin-sw/FE
FE
- Loading branch information
Showing
28 changed files
with
820 additions
and
755 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
frontend/.dart_tool/flutter_build/f53bae067f9785b129dd4b9b5597f59d/.filecache
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+677 KB
(100%)
frontend/.dart_tool/flutter_build/f53bae067f9785b129dd4b9b5597f59d/app.dill
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
frontend/.dart_tool/flutter_build/f53bae067f9785b129dd4b9b5597f59d/kernel_snapshot.d
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
frontend/.dart_tool/flutter_build/f53bae067f9785b129dd4b9b5597f59d/kernel_snapshot.stamp
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#select file | ||
lib/secret.dart |
Binary file modified
BIN
+677 KB
(100%)
frontend/build/f4da31578bf74e160393d588ebd02ee2.cache.dill.track.dill
Binary file not shown.
Binary file not shown.
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
Binary file modified
BIN
+677 KB
(100%)
frontend/build/ios/Debug-iphonesimulator/App.framework/flutter_assets/kernel_blob.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
frontend/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/App
Binary file not shown.
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
Binary file modified
BIN
+677 KB
(100%)
.../Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin
Binary file not shown.
Binary file not shown.
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
Binary file modified
BIN
+0 Bytes
(100%)
frontend/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/App
Binary file not shown.
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
Binary file modified
BIN
+677 KB
(100%)
...ld/ios/iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,84 @@ | ||
import 'package:http/http.dart' as http; | ||
import 'package:frontend/secret.dart'; | ||
import 'dart:convert'; | ||
|
||
//회원 가입 | ||
Future<String> singup(String email, String name, int age, String gender) async { | ||
var address = Uri.parse(BASE_URL + "/auth/signup"); | ||
http.Response res = await http.post( | ||
address, | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: json.encode({ | ||
"email": email, | ||
"name": name, | ||
"age": age, | ||
"gender": gender, | ||
}), | ||
); | ||
final data = json.decode(utf8.decode(res.bodyBytes)); | ||
print(data); | ||
|
||
return data['token']; | ||
} | ||
|
||
//로그인 | ||
Future<String> login(String email) async { | ||
var address = Uri.parse(BASE_URL + "/auth/login"); | ||
http.Response res = await http.post( | ||
address, | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: json.encode({ | ||
"email": email, | ||
}), | ||
); | ||
final data = json.decode(utf8.decode(res.bodyBytes)); | ||
print(data); | ||
|
||
// Future<String> sendData() async { | ||
// //http.post는 리턴값이 Future이기 떄문에 async 함수 내에서 await로 호출할 수 있다. | ||
// var test = Uri.parse(); | ||
// http.Response res = await http.get( | ||
// test, | ||
// headers: {"Content-Type":"application/json", | ||
// 'Authorization': 'Bearer $token' | ||
// }, | ||
// // body: json.encode({ | ||
// // "email" : "[email protected]", | ||
|
||
// // }) | ||
// ); | ||
// final data = json.decode(utf8.decode(res.bodyBytes)); | ||
// final comment = data['body']; | ||
// print(comment); | ||
// // print(res.body); | ||
// //여기서는 응답이 객체로 변환된 res 변수를 사용할 수 있다. | ||
// //여기서 res.body를 jsonDecode 함수로 객체로 만들어서 데이터를 처리할 수 있다. | ||
|
||
// return res.body; //작업이 끝났기 때문에 리턴 | ||
// } | ||
return data['token']; | ||
} | ||
|
||
//모임 목록 가져오기(주제를 기반으로)› | ||
Future<List<dynamic>> groupSerachforTopic(String topic) async { | ||
List<dynamic> groupList = []; | ||
var address = Uri.parse(BASE_URL + "/club/search/topic?topic=$topic"); | ||
http.Response res = await http.get( | ||
address, | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
); | ||
final data = json.decode(utf8.decode(res.bodyBytes)); | ||
for (int i = 0; i < data.length; i++) { | ||
groupList.add(data[i]); | ||
// print(data[i]); | ||
} | ||
|
||
return groupList; | ||
} | ||
|
||
//모임 생성하기 | ||
Future<dynamic> groupCreate(dynamic token, String name, String topic, int maximum, String publication, var password) async { | ||
var address = Uri.parse(BASE_URL + "/club/create"); | ||
http.Response res = await http.post( | ||
address, | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization": 'Bearer $token', | ||
}, | ||
body: json.encode({ | ||
"topic": topic, | ||
"name": name, | ||
"maximum": maximum, | ||
"publicStatus": publication, | ||
"password": password, | ||
}), | ||
); | ||
final data = res.body; | ||
// print(res.body); | ||
|
||
return data; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// import 'package:flutter/material.dart'; | ||
// import 'package:frontend/http.dart'; | ||
// 일단은 폐기 | ||
// final List<String> Thema = ['역사', '경제', '종교', '사회', '시집']; | ||
|
||
|
||
// class GroupListProvider with ChangeNotifier { | ||
// List<List<dynamic>> GroupList = [[], [], [], [], []]; | ||
|
||
// void makeGroupList() async { | ||
// for (int i = 0; i < Thema.length; i++) { | ||
// GroupList[i] = await groupSerachforTopic(Thema[i]); | ||
// // print(GroupList[i].length); | ||
// } | ||
// notifyListeners(); | ||
// } | ||
|
||
// void updateGroupList() { | ||
// makeGroupList(); | ||
// } | ||
// } | ||
|
||
// class Group { | ||
// final int id; | ||
// var bookId; | ||
// final String topic; | ||
// final String name; | ||
// final int maximum; | ||
// final String publication; | ||
|
||
// Group({ | ||
// required this.id, | ||
// required this.bookId, | ||
// required this.topic, | ||
// required this.name, | ||
// required this.maximum, | ||
// required this.publication, | ||
// }); | ||
// } |
Oops, something went wrong.