-
Notifications
You must be signed in to change notification settings - Fork 0
[FEATURE] 신고 API 연동 #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[FEATURE] 신고 API 연동 #259
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
96ccacf
refactor : "CustomTagCard를 label/onTap 기반 API로 통일"
eum018 50d858e
feature : "data/domain - 신고 기능 핵심 모듈 추가"
eum018 918b82a
fix : "ApiConstants.serverLog statusCode 파라미터 오타 수정"
eum018 bb37ec2
feature : "presentation - 통합 CustomReportDialog 적용 및 중복 컴포넌트 제거"
eum018 7120153
refactor : "ChatInputField에서 sendChat→sendMessage 호출부 정리"
eum018 adb5dc1
refactor : "CustomTagCard를 Stateless(isSelected) 기반으로 전환"
eum018 2b3cc3c
fix : "ChatRoomController의 불필요한 import 제거"
eum018 7f70bbb
fix : "chat_message_view_model_test의 createdAt 기대값을 UTC 기준으로 수정"
eum018 448a6fe
refactor : "ReportBinding이 구현체 대신 ReportRepository 인터페이스로 DI"
eum018 cabdfeb
refactor : "CommentRemoteDataSource.createComment이 성공 여부(bool)를 반환하도록…
eum018 6b90b0b
refactor : "CommentRepository/CreateCommentUseCase의 createComment 반환형…
eum018 f62422b
feature : "댓글 롱프레스 시 신고하기 메뉴 추가"
eum018 0a67174
style : "CustomPopupMenuButton 코드 포맷 정리"
eum018 014fd60
feature : "ChatMainScreen의 채팅 목록에 좌우 패딩 적용"
eum018 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,26 @@ | ||
| enum ReportType { | ||
| post('POST'), | ||
| comment('COMMENT'), | ||
| chatRoom('CHAT_ROOM'), | ||
| user('USER') | ||
| ; | ||
|
|
||
| final String value; | ||
|
|
||
| const ReportType(this.value); | ||
| } | ||
|
|
||
| enum ReportReason { | ||
| swear("욕설이 많아요"), | ||
| disrespect("상대를 존중하지 않아요"), | ||
| offensive("불쾌감을 느끼는 발언을 해요"), | ||
| aggressive("공격적인 언어를 사용해요"), | ||
| discrimination("신분, 장애, 인종에 대해 차별 발언을 일삼아요"), | ||
| badName("부적절한 이름을 사용해요"), | ||
| etc("기타") | ||
| ; | ||
|
|
||
| final String label; | ||
|
|
||
| const ReportReason(this.label); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 @@ | ||
| import 'package:get/get.dart'; | ||
| import 'package:ondo/data/datasource/report/report_remote_datasource.dart'; | ||
| import 'package:ondo/data/network/clients/auth_client.dart'; | ||
| import 'package:ondo/data/repositories/report/report_repository_impl.dart'; | ||
| import 'package:ondo/domain/repositories/report/report_repository.dart'; | ||
| import 'package:ondo/domain/usecases/report/report_use_case.dart'; | ||
|
|
||
| class ReportBinding extends Bindings { | ||
| @override | ||
| void dependencies() { | ||
| Get.lazyPut( | ||
| () => ReportRemoteDatasource(Get.find<AuthClient>()), | ||
| ); | ||
|
|
||
| Get.lazyPut<ReportRepository>( | ||
| () => ReportRepositoryImpl(Get.find<ReportRemoteDatasource>()), | ||
| ); | ||
|
|
||
| Get.lazyPut( | ||
| () => ReportUseCase(Get.find<ReportRepository>()), | ||
| ); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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,37 @@ | ||
| import 'dart:convert'; | ||
|
|
||
| import 'package:http/http.dart'; | ||
| import 'package:ondo/data/models/report/request/report_request_model.dart'; | ||
| import 'package:ondo/data/network/constants/api_constants.dart'; | ||
|
|
||
| class ReportRemoteDatasource { | ||
| final BaseClient _client; | ||
|
|
||
| ReportRemoteDatasource(this._client); | ||
|
|
||
| Future<bool> report(ReportRequestModel model) async { | ||
| final log = ApiConstants(logName: '신고 접수 서버'); | ||
|
|
||
| try { | ||
| final res = await _client.post( | ||
| Uri.parse(ApiConstants.report), | ||
| headers: ApiConstants.baseHeader, | ||
| body: jsonEncode(model.toJson()), | ||
| ); | ||
|
|
||
| final body = jsonDecode(res.body); | ||
|
|
||
| log.successLog(body['success']); | ||
| log.messageLog(body['message']); | ||
|
|
||
| if (res.statusCode == 200 && body['success'] == true) { | ||
| return true; | ||
| } | ||
| log.statusLog(res.statusCode); | ||
| } catch (e) { | ||
| log.errorLog(e); | ||
| } | ||
|
|
||
| return false; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.