Skip to content

Commit

Permalink
Merge pull request #93 from kookmin-sw/FE_Feature/#59-BackendConnect
Browse files Browse the repository at this point in the history
hotfix
  • Loading branch information
ZombieBread123 authored May 21, 2024
2 parents 2898df1 + 706cae8 commit 6ba8e73
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 47 deletions.
35 changes: 34 additions & 1 deletion frontend/lib/http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ Future<dynamic> quizCreate(
"endDate": endDate,
}),
);
final data = res.body;
//final data = res.body;
final data = json.decode(utf8.decode(res.bodyBytes));
print(data);
return data;
}

Expand Down Expand Up @@ -693,6 +695,37 @@ Future<dynamic> getRecommend(String token) async {
return data;
}

//서재 삭제하기
Future<String> deleteLibrary(String token, String groupName) async {
var address =
Uri.parse("$BASE_URL/member/my-book/rm/group?groupName=$groupName");
http.Response res = await http.delete(
address,
headers: {
"Content-Type": "application/json",
"Authorization": 'Bearer $token',
},
);
final data = res.body;
return data;
}

//서재에서 책 삭제하기
Future<String> deleteBookFromLibrary(
String token, String groupName, String isbn) async {
var address = Uri.parse(
"$BASE_URL/member/my-book/rm/book?groupName=$groupName&isbn=$isbn");
http.Response res = await http.delete(
address,
headers: {
"Content-Type": "application/json",
"Authorization": 'Bearer $token',
},
);
final data = res.body;
return data;
}

// 추천 리스트 받아오기(비로그인)
Future<dynamic> getRecommendAnony() async {
var address = Uri.parse(BASE_URL + "/rec/anonymous");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:frontend/http.dart';
import 'package:frontend/provider/secure_storage_provider.dart';
import 'package:frontend/screens/home/bookreport/bookreport_viewing_screen.dart';
import 'package:frontend/screens/home/bookreport/booksearch_screen_util.dart'
as searchutil;
import 'package:go_router/go_router.dart';
Expand Down Expand Up @@ -191,7 +190,6 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
SizedBox(width: 10.w),
Expanded(
child: SizedBox(
//width: _screenWidth * 0.7,
child: TextField(
style: TextStyle(fontSize: 14.sp),
controller: _titleController,
Expand Down Expand Up @@ -457,10 +455,10 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
selectedCategory.toString(),
_questionController.text,
ansnum,
_answerController1.text,
_answerController2.text,
_answerController3.text,
_answerController4.text,
_answerControllers[0].text,
_answerControllers[1].text,
_answerControllers[2].text,
_answerControllers[3].text,
_startDate.toString(),
_endDate.toString());
break;
Expand Down Expand Up @@ -557,13 +555,11 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
controller: _writingController,
textAlign: TextAlign.center,
maxLines: 10,
decoration: InputDecoration(
decoration: InputDecoration(
hintText: '인용문을 작성해주세요',
hintStyle: TextStyle(
// 힌트 텍스트 정중앙 정렬
height: 15.h,
height: 15.h,
),
border: InputBorder.none,
),
Expand Down Expand Up @@ -630,8 +626,7 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
),
],
),
SizedBox(height: 15.h),
SizedBox(height: 15.h),
SizedBox(height: 5.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 0.w),
child: Row(
Expand All @@ -657,8 +652,6 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
SizedBox(
width: 350.w,
height: 150.h,
width: 350.w,
height: 190.h,
child: Stack(
children: [
Positioned(
Expand All @@ -667,12 +660,8 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
child: Container(
width: 350.w,
height: 150.h,
width: 350.w,
height: 190.h,
decoration: BoxDecoration(
color: const Color(0xFFE7FFEB),
borderRadius: BorderRadius.circular(20),
border: Border.all(width: 1.w),
borderRadius: BorderRadius.circular(20.r),
border: Border.all(width: 1.w),
),
Expand Down Expand Up @@ -735,8 +724,6 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
SizedBox(
width: 350.w,
height: 150.h,
width: 350.w,
height: 190.h,
child: Stack(
children: [
Positioned(
Expand All @@ -745,12 +732,8 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
child: Container(
width: 350.w,
height: 150.h,
width: 350.w,
height: 190.h,
decoration: BoxDecoration(
color: const Color(0xFFE7FFEB),
borderRadius: BorderRadius.circular(20),
border: Border.all(width: 1.w),
borderRadius: BorderRadius.circular(20.r),
border: Border.all(width: 1.w),
),
Expand All @@ -765,7 +748,6 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
SizedBox(width: 10.w),
Expanded(
child: SizedBox(
//width: _screenWidth * 0.7,
child: TextField(
style: TextStyle(fontSize: 14.sp),
controller: _questionController,
Expand All @@ -785,7 +767,6 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
SizedBox(height: 15.h),
SizedBox(height: 15.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Expand All @@ -801,15 +782,13 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
backgroundColor: _isOX ? Colors.green : Colors.white,
elevation: 0,
side: BorderSide(width: 0.5.w),
side: BorderSide(width: 0.5.w),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.r)),
minimumSize: const Size(140, 140),
minimumSize: Size(140.w, 140.w),
),
child: const Text('O'),
),
SizedBox(width: 30.w),
SizedBox(width: 30.w),
ElevatedButton(
onPressed: () {
setState(() {
Expand All @@ -821,10 +800,9 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
backgroundColor: !_isOX ? Colors.green : Colors.white,
elevation: 0,
side: BorderSide(width: 0.5.w),
side: BorderSide(width: 0.5.w),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.r)),
minimumSize: const Size(140, 140),
minimumSize: Size(140.w, 140.w),
),
child: const Text('X'),
),
Expand All @@ -839,8 +817,6 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
SizedBox(
width: 350.w,
height: 150.h,
width: 350.w,
height: 190.h,
child: Stack(
children: [
Positioned(
Expand All @@ -849,12 +825,8 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
child: Container(
width: 350.w,
height: 150.h,
width: 350.w,
height: 190.h,
decoration: BoxDecoration(
color: const Color(0xFFE7FFEB),
borderRadius: BorderRadius.circular(20),
border: Border.all(width: 1.w),
borderRadius: BorderRadius.circular(20.r),
border: Border.all(width: 1.w),
),
Expand All @@ -866,10 +838,8 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
children: [
const Text('Q: '),
SizedBox(width: 10.w),
SizedBox(width: 10.w),
Expanded(
child: SizedBox(
//width: _screenWidth * 0.7,
child: TextField(
style: TextStyle(fontSize: 14.sp),
controller: _questionController,
Expand All @@ -886,10 +856,8 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
],
),
),
SizedBox(height: 15.h),
SizedBox(height: 15.h),
SizedBox(height: 10.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 0.w),
padding: EdgeInsets.symmetric(horizontal: 0.w),
child: Column(
children: [
Expand Down Expand Up @@ -920,34 +888,29 @@ class _BookReportWritingState extends State<BookReportWritingScreen> {
),
),
SizedBox(width: 5.w),
SizedBox(width: 5.w),
Expanded(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r),
border: Border.all(
color: Colors.black,
width: 0.5.w,
width: 0.5.w,
),
color: _multipleanswer[i]
? Colors.green
: Colors.white,
),
height: 24.h,
height: 24.h,
alignment: Alignment.center,
child: Row(
children: [
SizedBox(width: 10.w),
SizedBox(width: 10.w),
const Text('A: '),
Expanded(
child: SizedBox(
//width: _screenWidth * 0.7,
child: TextField(
style: TextStyle(fontSize: 10.sp),
controller: _answerController1,
controller: _answerControllers[i],
decoration: InputDecoration(
hintText: '답을 입력해주세요.',
contentPadding:
Expand Down

0 comments on commit 6ba8e73

Please sign in to comment.