├── .github ├── ISSUE_TEMPLATE │ ├── bug.yml │ └── todo.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── android-cj.yml ├── .gitignore ├── .idea ├── .gitignore ├── compiler.xml ├── deploymentTargetDropDown.xml ├── gradle.xml ├── kotlinc.xml ├── misc.xml └── vcs.xml ├── LICENSE ├── build.gradle.kts ├── buildSrc ├── .gitignore ├── build.gradle.kts └── src │ └── main │ └── java │ ├── Dependency.kt │ └── Versions.kt ├── data ├── .gitignore ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── team_ia │ │ └── data │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── team_ia │ │ └── data │ │ ├── interceptor │ │ └── AuthorizationInterceptor.kt │ │ ├── local │ │ ├── datasource │ │ │ ├── LocalAuthDataSource.kt │ │ │ └── LocalAuthDataSourceImpl.kt │ │ └── storage │ │ │ ├── AuthStorage.kt │ │ │ └── AuthStorageImpl.kt │ │ ├── remote │ │ ├── api │ │ │ ├── AdminAPI.kt │ │ │ ├── ApplicationAPI.kt │ │ │ ├── AuthAPI.kt │ │ │ ├── EmailAPI.kt │ │ │ ├── ImgAPI.kt │ │ │ ├── MemberAPI.kt │ │ │ ├── PostAPI.kt │ │ │ └── SocialAPI.kt │ │ ├── datasource │ │ │ ├── admin │ │ │ │ ├── AdminDataSource.kt │ │ │ │ └── AdminDataSourceImpl.kt │ │ │ ├── application │ │ │ │ ├── ApplicationDataSource.kt │ │ │ │ └── ApplicationDataSourceImpl.kt │ │ │ ├── auth │ │ │ │ ├── AuthDataSource.kt │ │ │ │ └── AuthDataSourceImpl.kt │ │ │ ├── email │ │ │ │ ├── EmailDataSource.kt │ │ │ │ └── EmailDataSourceImpl.kt │ │ │ ├── img │ │ │ │ ├── ImgDataSource.kt │ │ │ │ └── ImgDataSourceImpl.kt │ │ │ ├── member │ │ │ │ ├── MemberDataSource.kt │ │ │ │ └── MemberDataSourceImpl.kt │ │ │ ├── post │ │ │ │ ├── PostDataSource.kt │ │ │ │ └── PostDataSourceImpl.kt │ │ │ └── social │ │ │ │ ├── SocialDataSource.kt │ │ │ │ └── SocialDataSourceImpl.kt │ │ ├── model │ │ │ ├── NoticeModel.kt │ │ │ └── PostModel.kt │ │ ├── request │ │ │ ├── admin │ │ │ │ ├── EditNoticeRequest.kt │ │ │ │ └── PostNoticeRequest.kt │ │ │ ├── auth │ │ │ │ ├── LoginRequest.kt │ │ │ │ ├── SignupRequest.kt │ │ │ │ └── SocialLoginRequest.kt │ │ │ ├── email │ │ │ │ └── SendVerificationCodeRequest.kt │ │ │ ├── img │ │ │ │ ├── ChangeProfilePictureRequest.kt │ │ │ │ └── PostProfilePictureRequest.kt │ │ │ ├── member │ │ │ │ ├── ChangeNickNameRequest.kt │ │ │ │ ├── ChangePasswordRequest.kt │ │ │ │ ├── FindPasswordRequest.kt │ │ │ │ ├── MemberRequest.kt │ │ │ │ └── WithdrawalMemberRequest.kt │ │ │ └── post │ │ │ │ ├── PostCommentRequest.kt │ │ │ │ ├── SearchPostRequest.kt │ │ │ │ └── WritePostRequest.kt │ │ └── response │ │ │ ├── admin │ │ │ └── ReadNoticeResponse.kt │ │ │ ├── application │ │ │ └── GetApplicantResponse.kt │ │ │ ├── auth │ │ │ └── LoginResponse.kt │ │ │ ├── member │ │ │ ├── GetDetailNoticeResponse.kt │ │ │ ├── GetNoticeResponse.kt │ │ │ └── MemberResponse.kt │ │ │ └── post │ │ │ └── GetDetailPostResponse.kt │ │ ├── repository │ │ ├── AdminRepositoryImpl.kt │ │ ├── ApplicationRepositoryImpl.kt │ │ ├── AuthRepositoryImpl.kt │ │ ├── EmailRepositoryImpl.kt │ │ ├── ImgRepositoryImpl.kt │ │ ├── MemberRepositoryImpl.kt │ │ ├── PostRepositoryImpl.kt │ │ └── SocialRepositoryImpl.kt │ │ └── utils │ │ └── IAApiHandler.kt │ └── test │ └── java │ └── com │ └── team_ia │ └── data │ └── ExampleUnitTest.kt ├── di ├── .gitignore ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── team_ia │ │ └── di │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── team_ia │ │ └── di │ │ ├── LocalDataSourceModule.kt │ │ ├── NetworkModule.kt │ │ ├── RemoteDataSourceModule.kt │ │ ├── RepositoryModule.kt │ │ ├── SharedPreferenceModule.kt │ │ └── StorageModule.kt │ └── test │ └── java │ └── com │ └── team_ia │ └── di │ └── ExampleUnitTest.kt ├── domain ├── .gitignore ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── team_ia │ │ └── domain │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── team_ia │ │ └── domain │ │ ├── entity │ │ ├── GetApplicantEntity.kt │ │ ├── GetDetailNoticeEntity.kt │ │ ├── GetDetailPostEntity.kt │ │ ├── GetNoticeEntity.kt │ │ ├── LoginEntity.kt │ │ ├── MemberEntity.kt │ │ └── ReadNoticeEntity.kt │ │ ├── exception │ │ ├── HttpException.kt │ │ ├── IOException.kt │ │ └── NetworkException.kt │ │ ├── model │ │ ├── NoticeModel.kt │ │ └── PostModel.kt │ │ ├── param │ │ ├── ChangeNickNameParam.kt │ │ ├── ChangeProfilePictureParam.kt │ │ ├── EditNoticeParam.kt │ │ ├── FindPasswordParam.kt │ │ ├── LoginParam.kt │ │ ├── PasswordParam.kt │ │ ├── PostCommentParam.kt │ │ ├── PostNoticeParam.kt │ │ ├── PostProfilePictureParam.kt │ │ ├── SearchPostParam.kt │ │ ├── SendVerificationCodeParam.kt │ │ ├── SignupParam.kt │ │ ├── SocialLoginParam.kt │ │ ├── WithdrawalMemberParam.kt │ │ └── WritePostParam.kt │ │ ├── repository │ │ ├── AdminRepository.kt │ │ ├── ApplicationRepository.kt │ │ ├── AuthRepository.kt │ │ ├── EmailRepository.kt │ │ ├── ImgRepository.kt │ │ ├── MemberRepository.kt │ │ ├── PostRepository.kt │ │ └── SocialRepository.kt │ │ ├── usecase │ │ ├── admin │ │ │ ├── DeleteNoticeUseCase.kt │ │ │ ├── DetailNoticeUseCase.kt │ │ │ ├── EditNoticeUseCase.kt │ │ │ ├── PostNoticeUseCase.kt │ │ │ └── ReadNoticeUseCase.kt │ │ ├── application │ │ │ ├── ApplicationPostUseCase.kt │ │ │ └── GetApplicantUseCase.kt │ │ ├── auth │ │ │ ├── LoginUseCase.kt │ │ │ ├── LogoutUseCase.kt │ │ │ ├── SaveTokenUseCase.kt │ │ │ └── SignupUseCase.kt │ │ ├── email │ │ │ ├── CheckVerificationCodeUseCase.kt │ │ │ └── SendVerificationCodeUseCase.kt │ │ ├── img │ │ │ ├── ChangeProfilePictureUseCase.kt │ │ │ ├── DeleteProfilePicture.kt │ │ │ └── PostProfilePictureUseCase.kt │ │ ├── member │ │ │ ├── ChangeNickNameUseCase.kt │ │ │ ├── ChangePasswordUseCase.kt │ │ │ ├── FindPasswordUseCase.kt │ │ │ ├── GetDetailNoticeUseCase.kt │ │ │ ├── GetMyHeartListUseCase.kt │ │ │ ├── GetMyPostUseCase.kt │ │ │ ├── GetNoticeUseCase.kt │ │ │ ├── GetProfileInfoUseCase.kt │ │ │ └── WithdrawalMemberUseCase.kt │ │ ├── post │ │ │ ├── DeleteCommentUseCase.kt │ │ │ ├── DeletePostUseCase.kt │ │ │ ├── EditCommentUseCase.kt │ │ │ ├── EditPostUseCase.kt │ │ │ ├── GetCategoryPostUseCase.kt │ │ │ ├── GetDetailPostUseCase.kt │ │ │ ├── GetPopularPostUseCase.kt │ │ │ ├── GetPostUseCase.kt │ │ │ ├── PostCommentUseCase.kt │ │ │ ├── PostHeartUseCase.kt │ │ │ ├── SearchPostUseCase.kt │ │ │ └── WritePostUseCase.kt │ │ └── social │ │ │ ├── GoogleLoginUseCase.kt │ │ │ ├── KakaoLoginUseCase.kt │ │ │ ├── SocialLogoutUseCase.kt │ │ │ └── SocialSaveTokenUseCase.kt │ │ └── utils │ │ └── Result.kt │ └── test │ └── java │ └── com │ └── team_ia │ └── domain │ └── ExampleUnitTest.kt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── presentation ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── team_ia │ │ └── idea_archive_android │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── team_ia │ │ │ └── idea_archive_android │ │ │ ├── IAApplication.kt │ │ │ ├── adapter │ │ │ ├── CategoryListAdapter.kt │ │ │ ├── MajorFilterListAdapter.kt │ │ │ ├── PostListAdapter.kt │ │ │ └── viewpager │ │ │ │ └── MyViewPagerAdapter.kt │ │ │ ├── ui │ │ │ ├── base │ │ │ │ ├── BaseActivity.kt │ │ │ │ └── BaseFragment.kt │ │ │ ├── login │ │ │ │ └── LoginActivity.kt │ │ │ ├── main │ │ │ │ ├── FindPasswordActivity.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── MainEntireFragment.kt │ │ │ │ ├── MainFeedbackFragment.kt │ │ │ │ ├── MainIdeaFragment.kt │ │ │ │ └── MainJobOpeningFragment.kt │ │ │ ├── profile │ │ │ │ ├── EditPasswordActivity.kt │ │ │ │ ├── EditProfileActivity.kt │ │ │ │ ├── EditProfileInfoActivity.kt │ │ │ │ ├── LikedFragment.kt │ │ │ │ ├── MyFragment.kt │ │ │ │ ├── PostItem.kt │ │ │ │ ├── ProfileActivity.kt │ │ │ │ ├── WithdrawalActivity.kt │ │ │ │ └── WithdrawalModal.kt │ │ │ ├── signup │ │ │ │ ├── AuthCodeInputFragment.kt │ │ │ │ ├── AuthenticationFailedActivity.kt │ │ │ │ ├── AuthenticationSuccessActivity.kt │ │ │ │ ├── SignUpActivity.kt │ │ │ │ └── SignUpFragment.kt │ │ │ ├── viewmodel │ │ │ │ ├── ChangePasswordViewModel.kt │ │ │ │ ├── CommentViewModel.kt │ │ │ │ ├── EditProfilePictureViewModel.kt │ │ │ │ ├── GoogleSocialLoginViewModel.kt │ │ │ │ ├── KakaoSocialLoginViewModel.kt │ │ │ │ ├── LoginViewModel.kt │ │ │ │ ├── MainViewModel.kt │ │ │ │ ├── MyViewModel.kt │ │ │ │ ├── SignupViewModel.kt │ │ │ │ └── WriteViewModel.kt │ │ │ └── write │ │ │ │ ├── SelectCategoryFragment.kt │ │ │ │ ├── SelectMajorFragment.kt │ │ │ │ ├── WriteActivity.kt │ │ │ │ └── WriteFragment.kt │ │ │ └── utils │ │ │ ├── ErrorHandling.kt │ │ │ ├── Event.kt │ │ │ ├── FileUtil.kt │ │ │ ├── ItemDecorator.kt │ │ │ ├── KeyboardEvent.kt │ │ │ ├── MutableEventFlow.kt │ │ │ ├── extension │ │ │ ├── ButtonExtension.kt │ │ │ ├── EditTextExtension.kt │ │ │ └── LifeCycleOwnerExtension.kt │ │ │ └── formatTimeDeference.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── bg_bottom_nav.xml │ │ ├── bg_category_view.xml │ │ ├── bg_change_profile_picture.xml │ │ ├── bg_comment_send_btn.xml │ │ ├── bg_confirm.xml │ │ ├── bg_content_textview.xml │ │ ├── bg_default_profile.xml │ │ ├── bg_edit_password.xml │ │ ├── bg_edit_profile_button.xml │ │ ├── bg_edittext.xml │ │ ├── bg_feedback_btn.xml │ │ ├── bg_feedback_false_btn.xml │ │ ├── bg_filter_btn.xml │ │ ├── bg_floatingbutton.xml │ │ ├── bg_go_to.xml │ │ ├── bg_idea_btn.xml │ │ ├── bg_idea_false_btn.xml │ │ ├── bg_incorrect_edittext.xml │ │ ├── bg_input_auth_code_edit_text.xml │ │ ├── bg_item_post.xml │ │ ├── bg_jobopening_btn.xml │ │ ├── bg_jobopening_false_btn.xml │ │ ├── bg_major_ai_btn.xml │ │ ├── bg_major_ai_selected_btn.xml │ │ ├── bg_major_android_btn.xml │ │ ├── bg_major_android_selected_btn.xml │ │ ├── bg_major_back_btn.xml │ │ ├── bg_major_back_seleceted_btn.xml │ │ ├── bg_major_dba_btn.xml │ │ ├── bg_major_dba_selected_btn.xml │ │ ├── bg_major_design_btn.xml │ │ ├── bg_major_design_selected_btn.xml │ │ ├── bg_major_devops_btn.xml │ │ ├── bg_major_devops_selected_btn.xml │ │ ├── bg_major_embedded_btn.xml │ │ ├── bg_major_embedded_selected_btn.xml │ │ ├── bg_major_frontend_btn.xml │ │ ├── bg_major_frontend_seleted_btn.xml │ │ ├── bg_major_game_btn.xml │ │ ├── bg_major_game_selected_btn.xml │ │ ├── bg_major_ios_btn.xml │ │ ├── bg_major_ios_selected_btn.xml │ │ ├── bg_major_security_btn.xml │ │ ├── bg_major_security_selected_btn.xml │ │ ├── bg_major_web_btn.xml │ │ ├── bg_major_web_selected_btn.xml │ │ ├── bg_next.xml │ │ ├── bg_quit.xml │ │ ├── bg_see_more_ibtn.xml │ │ ├── bg_share_btn.xml │ │ ├── bg_title_edittext.xml │ │ ├── bg_withdrawal.xml │ │ ├── bg_withdrawal_btn.xml │ │ ├── bg_withdrawal_modal.xml │ │ ├── bg_write_btn.xml │ │ ├── bg_write_post.xml │ │ ├── bg_write_post_bubble.xml │ │ ├── btn_login.xml │ │ ├── ibtn_back_button.xml │ │ ├── ic_add.xml │ │ ├── ic_close.xml │ │ ├── ic_comment.xml │ │ ├── ic_empty_heart.xml │ │ ├── ic_full_heart.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_liked_text_activate.xml │ │ ├── ic_liked_text_activate_2.xml │ │ ├── ic_liked_text_inactivate.xml │ │ ├── ic_main_page_menu_bar.xml │ │ ├── ic_my_post_text_activate.xml │ │ ├── ic_my_post_text_inactivate.xml │ │ ├── ic_notice.xml │ │ ├── ic_search_button.xml │ │ ├── lg_authentication_failed_icon.xml │ │ ├── lg_authentication_success_icon.xml │ │ ├── lg_github.xml │ │ ├── lg_google.xml │ │ ├── lg_kakaotalk.xml │ │ ├── menu_entire_post_active.xml │ │ ├── menu_entire_post_inactive.xml │ │ ├── menu_feedback_post_active.xml │ │ ├── menu_feedback_post_inactive.xml │ │ ├── menu_idea_post_active.xml │ │ ├── menu_idea_post_inactive.xml │ │ ├── menu_job_opening_post_active.xml │ │ ├── menu_job_opening_post_inactive.xml │ │ ├── selector_nav_bg.xml │ │ ├── selector_nav_color.xml │ │ ├── selector_nav_color_text.xml │ │ ├── selector_nav_text_liked.xml │ │ ├── selector_nav_text_my_post.xml │ │ ├── src_write_post.xml │ │ └── v_vertical_line.xml │ │ ├── font │ │ ├── font.xml │ │ ├── pretendard_bold.ttf │ │ ├── pretendard_medium.ttf │ │ ├── pretendard_regular.ttf │ │ └── pretendard_semibold.ttf │ │ ├── layout │ │ ├── actiivty_find_password_page.xml │ │ ├── activity_authentication_failed_page.xml │ │ ├── activity_authentication_success_page.xml │ │ ├── activity_detail_post_page.xml │ │ ├── activity_edit_password.xml │ │ ├── activity_edit_profile.xml │ │ ├── activity_edit_profile_info.xml │ │ ├── activity_login_page.xml │ │ ├── activity_main.xml │ │ ├── activity_main_page.xml │ │ ├── activity_new_password_input_page.xml │ │ ├── activity_profile.xml │ │ ├── activity_sign_up_page.xml │ │ ├── activity_withdrawal.xml │ │ ├── activity_write_page.xml │ │ ├── fragment_auth_code_input_page.xml │ │ ├── fragment_liked.xml │ │ ├── fragment_main_entire.xml │ │ ├── fragment_main_feedback.xml │ │ ├── fragment_main_idea.xml │ │ ├── fragment_main_job_opening.xml │ │ ├── fragment_my.xml │ │ ├── fragment_select_category.xml │ │ ├── fragment_select_major.xml │ │ ├── fragment_sign_up_page.xml │ │ ├── fragment_write_page.xml │ │ ├── item_category.xml │ │ ├── item_major_filter.xml │ │ ├── item_post.xml │ │ ├── item_tab_layout.xml │ │ └── withdrawal_member_modal.xml │ │ ├── menu │ │ └── menu_main_page_tab_bar.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-anydpi-v33 │ │ └── ic_launcher.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── navigation │ │ ├── nav_main_graph.xml │ │ ├── sign_up_graph.xml │ │ └── write_graph.xml │ │ ├── values-night │ │ └── themes.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ ├── backup_rules.xml │ │ └── data_extraction_rules.xml │ └── test │ └── java │ └── com │ └── team_ia │ └── idea_archive_android │ └── ExampleUnitTest.kt └── settings.gradle.kts /.github/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | name: "Bug" 2 | description: "버그가 생겼어요 👾" 3 | labels: 버그 4 | body: 5 | - type: textarea 6 | attributes: 7 | label: Describe 8 | description: | 9 | [Description] 버그에 관한 설명을 적어주세요 10 | placeholder: | 11 | conflict난거 그냥 merge해버림 12 | - type: textarea 13 | attributes: 14 | label: Additional 15 | description: | 16 | [추가사항] 별도로 알려줘야 할 사항이나 추가사항을 작성해주세요 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/todo.yml: -------------------------------------------------------------------------------- 1 | name: "Todo" 2 | description: "해야할 것이 있나요??🤔" 3 | body: 4 | 5 | - type: textarea 6 | attributes: 7 | label: Describe 8 | description: | 9 | [Description] 할일의 설명을 작성해주세요. 10 | placeholder: | 11 | 회원가입 UI 작성 12 | - type: textarea 13 | attributes: 14 | label: Additional 15 | description: | 16 | [추가사항] 별도로 알려줘야 할 사항이나 추가사항을 작성해주세요 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## 💡 개요 2 | 3 | ## 📃 작업내용 4 | 5 | ## 🔀 변경사항 6 | 7 | ## 🙋‍♂️ 질문사항 8 | 9 | ## 🍴 사용방법 10 | 11 | ## 🎸 기타 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | /buildSrc/build -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | /sonarlint/ -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <<<<<<< HEAD 5 | 6 | ======= 7 | 8 | >>>>>>> 23c1280db05833589013eb9d7fae5edb425c4117 9 | 10 | 11 | 12 | 14 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 MSG.Team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath(Dependency.GradlePlugin.GRADLE_ANDROID) 10 | classpath(Dependency.GradlePlugin.GRADLE_KOTLIN) 11 | classpath(Dependency.GradlePlugin.GRADLE_HILT) 12 | classpath(Dependency.Google.GMS_GOOGLE_SERVICE) 13 | classpath(Dependency.GiuhubLogin.GITHUB_API) 14 | } 15 | } 16 | 17 | plugins { 18 | id(Dependency.GradlePlugin.GRADLE_KTLINT) version Versions.KTLINT_PLUGIN 19 | } 20 | 21 | tasks.register("clean", Delete::class) { 22 | delete(rootProject.buildDir) 23 | } 24 | -------------------------------------------------------------------------------- /buildSrc/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | repositories { 6 | mavenCentral() 7 | } 8 | -------------------------------------------------------------------------------- /data/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /data/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Idea-Archive/Idea-Archive-Android/bb44bca1d4c86987563fe15c645b254775c88dd9/data/consumer-rules.pro -------------------------------------------------------------------------------- /data/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /data/src/androidTest/java/com/team_ia/data/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.team_ia.data.test", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /data/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/local/datasource/LocalAuthDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.local.datasource 2 | 3 | interface LocalAuthDataSource { 4 | suspend fun getAccessToken(): String? 5 | suspend fun getRefreshToken(): String? 6 | suspend fun getExpiredAt(): String? 7 | suspend fun saveToken(access: String?, refresh: String?,expiredAt: String?) 8 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/local/datasource/LocalAuthDataSourceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.local.datasource 2 | 3 | import com.team_ia.data.local.storage.AuthStorage 4 | import javax.inject.Inject 5 | 6 | class LocalAuthDataSourceImpl @Inject constructor( 7 | private val localStorage: AuthStorage 8 | ): LocalAuthDataSource { 9 | override suspend fun getAccessToken(): String? = 10 | localStorage.getAccessToken() 11 | 12 | override suspend fun getRefreshToken(): String? = 13 | localStorage.getRefreshToken() 14 | 15 | override suspend fun getExpiredAt(): String? = 16 | localStorage.getExpiredAt() 17 | 18 | override suspend fun saveToken(access: String?, refresh: String?, expiredAt: String?) = 19 | localStorage.run { 20 | setAccessToken(access) 21 | setRefreshToken(refresh) 22 | setExpiredAt(expiredAt) 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/local/storage/AuthStorage.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.local.storage 2 | 3 | interface AuthStorage { 4 | fun setAccessToken(access: String?) 5 | fun getAccessToken(): String? 6 | 7 | fun setRefreshToken(refresh: String?) 8 | fun getRefreshToken(): String? 9 | 10 | fun setExpiredAt(expiredAt: String?) 11 | fun getExpiredAt(): String? 12 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/local/storage/AuthStorageImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.local.storage 2 | 3 | import android.content.SharedPreferences 4 | import javax.inject.Inject 5 | 6 | class AuthStorageImpl @Inject constructor( 7 | private val sharedPreferences: SharedPreferences 8 | ) : AuthStorage { 9 | companion object { 10 | const val TOKEN = "TOKEN" 11 | const val ACCESS_TOKEN = "ACCESS_TOKEN" 12 | const val REFRESH_TOKEN = "REFRESH_TOKEN" 13 | const val EXPIRED_AT = "EXPIRED_AT" 14 | } 15 | 16 | override fun setAccessToken(access: String?) = 17 | setData(ACCESS_TOKEN, access) 18 | override fun getAccessToken(): String? = 19 | sharedPreferences.getString(ACCESS_TOKEN, "") 20 | 21 | override fun setRefreshToken(refresh: String?) = 22 | setData(REFRESH_TOKEN, refresh) 23 | override fun getRefreshToken(): String? = 24 | sharedPreferences.getString(REFRESH_TOKEN, "") 25 | 26 | override fun setExpiredAt(expiredAt: String?) = 27 | setData(EXPIRED_AT, expiredAt) 28 | override fun getExpiredAt(): String? = 29 | sharedPreferences.getString(EXPIRED_AT, "") 30 | 31 | private fun setData(id: String, data: String?) { 32 | sharedPreferences.edit().let { 33 | it.putString(id, data) 34 | it.apply() 35 | } 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/api/AdminAPI.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.api 2 | 3 | import com.team_ia.data.remote.model.NoticeModel 4 | import com.team_ia.data.remote.request.admin.EditNoticeRequest 5 | import com.team_ia.data.remote.request.admin.PostNoticeRequest 6 | import com.team_ia.data.remote.response.admin.ReadNoticeResponse 7 | import retrofit2.Response 8 | import retrofit2.http.* 9 | 10 | interface AdminAPI { 11 | 12 | @POST("/admin/notice/write") 13 | suspend fun postNotice( 14 | @Body postNoticeRequest: PostNoticeRequest 15 | ): Response 16 | 17 | @GET("/admin/notice") 18 | suspend fun readNotice(): ReadNoticeResponse 19 | 20 | @DELETE("/admin/notice/{noticeId}") 21 | suspend fun deleteNotice( 22 | @Path("noticeId") noticeId: Long 23 | ): Response 24 | 25 | @PATCH("/admin/notice/{noticeId}") 26 | suspend fun editNotice( 27 | @Path("noticeId") noticeId: Long, 28 | @Body editNoticeRequest: EditNoticeRequest 29 | ): Response 30 | 31 | @GET("admin/notice/{noticeId}") 32 | suspend fun detailNotice( 33 | @Path("noticeId") noticeId: Long, 34 | ): NoticeModel 35 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/api/ApplicationAPI.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.api 2 | 3 | import com.team_ia.data.remote.response.application.GetApplicantResponse 4 | import retrofit2.Response 5 | import retrofit2.http.GET 6 | import retrofit2.http.POST 7 | import retrofit2.http.Path 8 | 9 | interface ApplicationAPI { 10 | 11 | @POST("/application/{postId}") 12 | suspend fun applicationPost( 13 | @Path("postId") postId: Long 14 | ): Response 15 | 16 | @GET("/application/{postId}") 17 | suspend fun getApplicant( 18 | @Path("postId") postId: Long 19 | ): GetApplicantResponse 20 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/api/AuthAPI.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.api 2 | 3 | import com.team_ia.data.remote.request.auth.LoginRequest 4 | import com.team_ia.data.remote.request.auth.SignupRequest 5 | import com.team_ia.data.remote.response.auth.LoginResponse 6 | import retrofit2.Response 7 | import retrofit2.http.Body 8 | import retrofit2.http.DELETE 9 | import retrofit2.http.Header 10 | import retrofit2.http.PATCH 11 | import retrofit2.http.POST 12 | 13 | interface AuthAPI { 14 | 15 | @POST("/auth/login") 16 | suspend fun login( 17 | @Body loginRequest: LoginRequest 18 | ): LoginResponse 19 | 20 | @POST("/auth/signup") 21 | suspend fun signup( 22 | @Body signupRequest: SignupRequest 23 | ): Response 24 | 25 | @DELETE("/auth") 26 | suspend fun logout(): Response 27 | 28 | @PATCH("/auth") 29 | suspend fun refreshToken( 30 | @Header("refreshToken") refreshToken: String 31 | ): LoginResponse 32 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/api/EmailAPI.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.api 2 | 3 | import com.team_ia.data.remote.request.email.SendVerificationCodeRequest 4 | import retrofit2.Response 5 | import retrofit2.http.Body 6 | import retrofit2.http.HEAD 7 | import retrofit2.http.POST 8 | import retrofit2.http.Query 9 | 10 | interface EmailAPI { 11 | 12 | @POST("/email/send") 13 | suspend fun sendVerificationCode( 14 | @Body sendVerificationCodeRequest: SendVerificationCodeRequest 15 | ): Response 16 | 17 | @HEAD("/email") 18 | suspend fun checkVerificationCode( 19 | @Query("email") email: String, 20 | @Query("authKey") authKey: Int 21 | ): Response 22 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/api/ImgAPI.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.api 2 | 3 | import com.team_ia.data.remote.request.img.ChangeProfilePictureRequest 4 | import com.team_ia.data.remote.request.img.PostProfilePictureRequest 5 | import retrofit2.Response 6 | import retrofit2.http.Body 7 | import retrofit2.http.DELETE 8 | import retrofit2.http.PATCH 9 | import retrofit2.http.POST 10 | 11 | interface ImgAPI { 12 | 13 | @POST("/image") 14 | suspend fun postProfilePicture( 15 | @Body postProfilePictureRequest: PostProfilePictureRequest 16 | ): Response 17 | 18 | @PATCH("/image") 19 | suspend fun changeProfilePicture( 20 | @Body changeProfilePictureRequest: ChangeProfilePictureRequest 21 | ): Response 22 | 23 | @DELETE("/image") 24 | suspend fun deleteProfilePicture(): Response 25 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/api/MemberAPI.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.api 2 | 3 | import com.team_ia.data.remote.model.PostModel 4 | import com.team_ia.data.remote.request.member.* 5 | import com.team_ia.data.remote.response.member.GetDetailNoticeResponse 6 | import com.team_ia.data.remote.response.member.GetNoticeResponse 7 | import com.team_ia.data.remote.response.member.MemberResponse 8 | import retrofit2.Response 9 | import retrofit2.http.Body 10 | import retrofit2.http.DELETE 11 | import retrofit2.http.GET 12 | import retrofit2.http.PATCH 13 | import retrofit2.http.Path 14 | import retrofit2.http.Query 15 | 16 | interface MemberAPI { 17 | 18 | @GET("/member") 19 | suspend fun getProfileInfo(): MemberResponse 20 | 21 | @PATCH("/member") 22 | suspend fun changePassword( 23 | @Body changePasswordRequest: ChangePasswordRequest 24 | ): Response 25 | 26 | @DELETE 27 | suspend fun withdrawalMember( 28 | @Body withdrawalMemberRequest: WithdrawalMemberRequest 29 | ): Response 30 | 31 | @PATCH("/member/findpw") 32 | suspend fun findPassword( 33 | @Body findPasswordRequest: FindPasswordRequest 34 | ): Response 35 | 36 | @PATCH("/member/name") 37 | suspend fun changeNickName( 38 | @Body changeNickNameRequest: ChangeNickNameRequest 39 | ): Response 40 | 41 | @GET("/member/notice") 42 | suspend fun getNotice(): GetNoticeResponse 43 | 44 | @GET("/member/notice/{noticeId}") 45 | suspend fun getDetailNotice( 46 | @Path("noticeId") noticeId: Long 47 | ): GetDetailNoticeResponse 48 | 49 | @GET("/member/my-post") 50 | suspend fun getMyPost(): List 51 | 52 | @GET("/member/my-heartList") 53 | suspend fun getMyHeartList(): List 54 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/api/SocialAPI.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.api 2 | 3 | import com.team_ia.data.remote.request.auth.SocialLoginRequest 4 | import com.team_ia.data.remote.response.auth.LoginResponse 5 | import retrofit2.Response 6 | import retrofit2.http.* 7 | 8 | interface SocialAPI { 9 | 10 | @GET("/google/login") 11 | suspend fun googleLogin( 12 | @Query("code")socialLoginRequest: SocialLoginRequest 13 | ): LoginResponse 14 | 15 | @GET("/kakao/login") 16 | suspend fun kakaoLogin( 17 | @Query("authorizationCode")socialLoginRequest: SocialLoginRequest 18 | ): LoginResponse 19 | 20 | @DELETE 21 | suspend fun logout(): Response 22 | 23 | @PATCH 24 | suspend fun refreshToken( 25 | @Header("refreshToken") refreshToken: String 26 | ): LoginResponse 27 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/admin/AdminDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.admin 2 | 3 | import com.team_ia.data.remote.model.NoticeModel 4 | import com.team_ia.data.remote.request.admin.EditNoticeRequest 5 | import com.team_ia.data.remote.request.admin.PostNoticeRequest 6 | import com.team_ia.data.remote.response.admin.ReadNoticeResponse 7 | 8 | interface AdminDataSource { 9 | suspend fun postNotice(postNoticeRequest: PostNoticeRequest) 10 | suspend fun readNotice(): ReadNoticeResponse 11 | suspend fun deleteNotice(noticeId: Long) 12 | suspend fun editNotice(noticeId: Long, editNoticeRequest: EditNoticeRequest) 13 | suspend fun detailNotice(noticeId: Long): NoticeModel 14 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/admin/AdminDataSourceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.admin 2 | 3 | import com.team_ia.data.remote.api.AdminAPI 4 | import com.team_ia.data.remote.model.NoticeModel 5 | import com.team_ia.data.remote.request.admin.EditNoticeRequest 6 | import com.team_ia.data.remote.request.admin.PostNoticeRequest 7 | import com.team_ia.data.remote.response.admin.ReadNoticeResponse 8 | import com.team_ia.data.utils.IAApiHandler 9 | import javax.inject.Inject 10 | 11 | class AdminDataSourceImpl @Inject constructor( 12 | private val adminAPI: AdminAPI 13 | ) : AdminDataSource { 14 | 15 | override suspend fun postNotice(postNoticeRequest: PostNoticeRequest) { 16 | return IAApiHandler() 17 | .httpRequest { adminAPI.postNotice(postNoticeRequest) } 18 | .sendRequest() 19 | } 20 | 21 | override suspend fun readNotice(): ReadNoticeResponse { 22 | return IAApiHandler() 23 | .httpRequest { adminAPI.readNotice() } 24 | .sendRequest() 25 | } 26 | 27 | override suspend fun deleteNotice(noticeId: Long) { 28 | return IAApiHandler() 29 | .httpRequest { adminAPI.deleteNotice(noticeId) } 30 | .sendRequest() 31 | } 32 | 33 | override suspend fun editNotice(noticeId: Long, editNoticeRequest: EditNoticeRequest) { 34 | return IAApiHandler() 35 | .httpRequest { adminAPI.editNotice(noticeId, editNoticeRequest) } 36 | .sendRequest() 37 | } 38 | 39 | override suspend fun detailNotice(noticeId: Long): NoticeModel { 40 | return IAApiHandler() 41 | .httpRequest { adminAPI.detailNotice(noticeId) } 42 | .sendRequest() 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/application/ApplicationDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.application 2 | 3 | import com.team_ia.data.remote.response.application.GetApplicantResponse 4 | 5 | interface ApplicationDataSource { 6 | suspend fun applicationPost(postId: Long) 7 | suspend fun getApplicant(postId: Long): GetApplicantResponse 8 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/application/ApplicationDataSourceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.application 2 | 3 | import com.team_ia.data.remote.api.ApplicationAPI 4 | import com.team_ia.data.remote.response.application.GetApplicantResponse 5 | import com.team_ia.data.utils.IAApiHandler 6 | import javax.inject.Inject 7 | 8 | class ApplicationDataSourceImpl @Inject constructor( 9 | private val applicationAPI: ApplicationAPI 10 | ) : ApplicationDataSource { 11 | 12 | override suspend fun applicationPost(postId: Long) { 13 | return IAApiHandler() 14 | .httpRequest { applicationAPI.applicationPost(postId) } 15 | .sendRequest() 16 | } 17 | 18 | override suspend fun getApplicant(postId: Long): GetApplicantResponse { 19 | return IAApiHandler() 20 | .httpRequest { applicationAPI.getApplicant(postId) } 21 | .sendRequest() 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/auth/AuthDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.auth 2 | 3 | import com.team_ia.data.remote.request.auth.LoginRequest 4 | import com.team_ia.data.remote.request.auth.SignupRequest 5 | import com.team_ia.data.remote.response.auth.LoginResponse 6 | 7 | interface AuthDataSource { 8 | suspend fun login(loginRequest: LoginRequest): LoginResponse 9 | suspend fun signup(signupRequest: SignupRequest) 10 | suspend fun logout() 11 | suspend fun refreshToken(refreshToken: String): LoginResponse 12 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/auth/AuthDataSourceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.auth 2 | 3 | import com.team_ia.data.remote.api.AuthAPI 4 | import com.team_ia.data.remote.request.auth.LoginRequest 5 | import com.team_ia.data.remote.request.auth.SignupRequest 6 | import com.team_ia.data.remote.response.auth.LoginResponse 7 | import com.team_ia.data.utils.IAApiHandler 8 | import javax.inject.Inject 9 | 10 | class AuthDataSourceImpl @Inject constructor( 11 | private val authAPI: AuthAPI 12 | ) : AuthDataSource { 13 | override suspend fun login(loginRequest: LoginRequest): LoginResponse { 14 | return IAApiHandler() 15 | .httpRequest { authAPI.login(loginRequest = loginRequest) } 16 | .sendRequest() 17 | } 18 | 19 | override suspend fun signup(signupRequest: SignupRequest) { 20 | return IAApiHandler() 21 | .httpRequest { authAPI.signup(signupRequest = signupRequest) } 22 | .sendRequest() 23 | } 24 | 25 | override suspend fun logout() { 26 | return IAApiHandler() 27 | .httpRequest { authAPI.logout() } 28 | .sendRequest() 29 | } 30 | 31 | override suspend fun refreshToken(refreshToken: String): LoginResponse { 32 | return IAApiHandler() 33 | .httpRequest { authAPI.refreshToken(refreshToken) } 34 | .sendRequest() 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/email/EmailDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.email 2 | 3 | import com.team_ia.data.remote.request.email.SendVerificationCodeRequest 4 | 5 | interface EmailDataSource { 6 | suspend fun sendVerificationCode(sendVerificationCodeRequest: SendVerificationCodeRequest) 7 | suspend fun checkVerificationCode(email: String, authKey: Int) 8 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/email/EmailDataSourceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.email 2 | 3 | import com.team_ia.data.remote.api.EmailAPI 4 | import com.team_ia.data.remote.request.email.SendVerificationCodeRequest 5 | import com.team_ia.data.utils.IAApiHandler 6 | import javax.inject.Inject 7 | 8 | class EmailDataSourceImpl @Inject constructor( 9 | private val emailAPI: EmailAPI 10 | ) : EmailDataSource { 11 | override suspend fun sendVerificationCode(sendVerificationCodeRequest: SendVerificationCodeRequest) { 12 | return IAApiHandler() 13 | .httpRequest { emailAPI.sendVerificationCode(sendVerificationCodeRequest) } 14 | .sendRequest() 15 | } 16 | 17 | override suspend fun checkVerificationCode(email: String, authKey: Int) { 18 | return IAApiHandler() 19 | .httpRequest { emailAPI.checkVerificationCode(email, authKey) } 20 | .sendRequest() 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/img/ImgDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.img 2 | 3 | import com.team_ia.data.remote.request.img.ChangeProfilePictureRequest 4 | import com.team_ia.data.remote.request.img.PostProfilePictureRequest 5 | 6 | interface ImgDataSource { 7 | suspend fun postProfilePicture(postProfilePictureRequest: PostProfilePictureRequest) 8 | suspend fun changeProfilePicture(changeProfilePictureRequest: ChangeProfilePictureRequest) 9 | suspend fun deleteProfilePicture() 10 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/img/ImgDataSourceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.img 2 | 3 | import com.team_ia.data.remote.api.ImgAPI 4 | import com.team_ia.data.remote.request.img.ChangeProfilePictureRequest 5 | import com.team_ia.data.remote.request.img.PostProfilePictureRequest 6 | import com.team_ia.data.utils.IAApiHandler 7 | import javax.inject.Inject 8 | 9 | class ImgDataSourceImpl @Inject constructor( 10 | private val imgAPI: ImgAPI 11 | ) : ImgDataSource { 12 | 13 | override suspend fun postProfilePicture(postProfilePictureRequest: PostProfilePictureRequest) { 14 | return IAApiHandler() 15 | .httpRequest { imgAPI.postProfilePicture(postProfilePictureRequest) } 16 | .sendRequest() 17 | } 18 | 19 | override suspend fun changeProfilePicture(changeProfilePictureRequest: ChangeProfilePictureRequest) { 20 | return IAApiHandler() 21 | .httpRequest { imgAPI.changeProfilePicture(changeProfilePictureRequest) } 22 | .sendRequest() 23 | } 24 | 25 | override suspend fun deleteProfilePicture() { 26 | return IAApiHandler() 27 | .httpRequest { imgAPI.deleteProfilePicture() } 28 | .sendRequest() 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/member/MemberDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.member 2 | 3 | import com.team_ia.data.remote.model.PostModel 4 | import com.team_ia.data.remote.request.member.ChangeNickNameRequest 5 | import com.team_ia.data.remote.request.member.ChangePasswordRequest 6 | import com.team_ia.data.remote.request.member.FindPasswordRequest 7 | import com.team_ia.data.remote.request.member.WithdrawalMemberRequest 8 | import com.team_ia.data.remote.response.member.GetDetailNoticeResponse 9 | import com.team_ia.data.remote.response.member.GetNoticeResponse 10 | import com.team_ia.data.remote.response.member.MemberResponse 11 | 12 | interface MemberDataSource { 13 | suspend fun getProfileInfo(): MemberResponse 14 | suspend fun changePassword(changePasswordRequest: ChangePasswordRequest) 15 | suspend fun withdrawalMember(withdrawalMemberRequest: WithdrawalMemberRequest) 16 | suspend fun findPassword(findPasswordRequest: FindPasswordRequest) 17 | suspend fun changeNickName(changeNickNameRequest: ChangeNickNameRequest) 18 | suspend fun getNotice(): GetNoticeResponse 19 | suspend fun getDetailNotice(noticeId: Long): GetDetailNoticeResponse 20 | suspend fun getMyPost(): List 21 | suspend fun getMyHeartList(): List 22 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/post/PostDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.post 2 | 3 | import com.team_ia.data.remote.model.PostModel 4 | import com.team_ia.data.remote.request.post.PostCommentRequest 5 | import com.team_ia.data.remote.request.post.SearchPostRequest 6 | import com.team_ia.data.remote.request.post.WritePostRequest 7 | import com.team_ia.data.remote.response.post.GetDetailPostResponse 8 | 9 | interface PostDataSource { 10 | suspend fun writePost(writePostRequest: WritePostRequest) 11 | suspend fun getPost(): List 12 | suspend fun getDetailPost(postId: Long): GetDetailPostResponse 13 | suspend fun editPost(postId: Long, editPostRequest: WritePostRequest) 14 | suspend fun deletePost(postId: Long) 15 | suspend fun searchPost(keyword: String, searchPostRequest: SearchPostRequest): List 16 | suspend fun getPopularPost(): List 17 | suspend fun getCategoryPost(getCategoryPostRequest: SearchPostRequest): List 18 | suspend fun postHeart(postId: Long) 19 | suspend fun postComment(postId: Long, postCommentRequest: PostCommentRequest) 20 | suspend fun editComment(commentId: Long, editCommentRequest: PostCommentRequest) 21 | suspend fun deleteComment(commentId: Long) 22 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/social/SocialDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.social 2 | 3 | import com.team_ia.data.remote.request.auth.SocialLoginRequest 4 | import com.team_ia.data.remote.response.auth.LoginResponse 5 | 6 | interface SocialDataSource { 7 | suspend fun googleLogin(socialLoginRequest: SocialLoginRequest): LoginResponse 8 | suspend fun kakaoLogin(socialLoginRequest: SocialLoginRequest): LoginResponse 9 | suspend fun logout() 10 | suspend fun refreshToken(refreshToken: String): LoginResponse 11 | 12 | 13 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/datasource/social/SocialDataSourceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.datasource.social 2 | 3 | import com.team_ia.data.remote.api.SocialAPI 4 | import com.team_ia.data.remote.request.auth.SocialLoginRequest 5 | import com.team_ia.data.remote.response.auth.LoginResponse 6 | import com.team_ia.data.utils.IAApiHandler 7 | import javax.inject.Inject 8 | 9 | class SocialDataSourceImpl @Inject constructor( 10 | private val socialAPI: SocialAPI 11 | ) : SocialDataSource { 12 | override suspend fun googleLogin(socialLoginRequest: SocialLoginRequest): LoginResponse { 13 | return IAApiHandler() 14 | .httpRequest { socialAPI.googleLogin(socialLoginRequest) } 15 | .sendRequest() 16 | } 17 | 18 | override suspend fun kakaoLogin(socialLoginRequest: SocialLoginRequest): LoginResponse{ 19 | return IAApiHandler() 20 | .httpRequest { socialAPI.kakaoLogin(socialLoginRequest) } 21 | .sendRequest() 22 | } 23 | 24 | override suspend fun logout() { 25 | return IAApiHandler() 26 | .httpRequest { socialAPI.logout() } 27 | .sendRequest() 28 | } 29 | 30 | override suspend fun refreshToken(refreshToken: String): LoginResponse { 31 | return IAApiHandler() 32 | .httpRequest { socialAPI.refreshToken(refreshToken) } 33 | .sendRequest() 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/model/NoticeModel.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.model 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.model.NoticeModel as DomainNoticeModel 5 | 6 | data class NoticeModel( 7 | @SerializedName("noticeId") 8 | val noticeId: Long, 9 | @SerializedName("title") 10 | val title: String, 11 | @SerializedName("content") 12 | val content: String, 13 | @SerializedName("createData") 14 | val createData: String 15 | ) 16 | 17 | fun NoticeModel.toEntity() = DomainNoticeModel( 18 | noticeId = noticeId, 19 | title = title, 20 | content = content, 21 | createData = createData 22 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/model/PostModel.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.model 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.model.PostModel as DomainPostModel 5 | import com.team_ia.domain.model.PostModel.Member as DomainMember 6 | 7 | data class PostModel( 8 | @SerializedName("postId") 9 | val postId: String, 10 | @SerializedName("title") 11 | val title: String, 12 | @SerializedName("content") 13 | val content: String, 14 | @SerializedName("category") 15 | val category: List, 16 | @SerializedName("heartCount") 17 | val heartCount: Int, 18 | @SerializedName("commentCount") 19 | val commentCount: Int, 20 | @SerializedName("member") 21 | val member: Member, 22 | @SerializedName("heart") 23 | val heart: Boolean, 24 | @SerializedName("createdDate") 25 | val createDate: String 26 | ) { 27 | data class Member( 28 | @SerializedName("memberId") 29 | val memberId: Long, 30 | @SerializedName("name") 31 | val name: String 32 | ) 33 | 34 | fun Member.toEntity() = DomainPostModel.Member( 35 | memberId = memberId, 36 | name = name 37 | ) 38 | } 39 | 40 | fun PostModel.toEntity() = DomainPostModel( 41 | postId = postId, 42 | title = title, 43 | content = content, 44 | category = category, 45 | heartCount = heartCount, 46 | commentCount = commentCount, 47 | member = DomainMember(memberId = member.memberId, name = member.name), 48 | heart = heart, 49 | createDate = createDate 50 | ) 51 | -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/admin/EditNoticeRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.admin 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.EditNoticeParam 5 | 6 | data class EditNoticeRequest ( 7 | @SerializedName("title") 8 | val title: String, 9 | @SerializedName("content") 10 | val content: String 11 | ) 12 | 13 | fun EditNoticeParam.toRequest() = EditNoticeRequest( 14 | title = title, 15 | content = content 16 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/admin/PostNoticeRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.admin 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.PostNoticeParam 5 | 6 | data class PostNoticeRequest( 7 | @SerializedName("title") 8 | val title: String, 9 | @SerializedName("content") 10 | val content: String 11 | ) 12 | 13 | fun PostNoticeParam.toRequest() = PostNoticeRequest( 14 | title = title, 15 | content = content 16 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/auth/LoginRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.auth 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.LoginParam 5 | 6 | data class LoginRequest( 7 | @SerializedName("email") 8 | val email: String, 9 | @SerializedName("password") 10 | val password: String 11 | ) 12 | 13 | fun LoginParam.toRequest() = LoginRequest( 14 | email = email, 15 | password = password 16 | ) 17 | -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/auth/SignupRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.auth 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.SignupParam 5 | 6 | data class SignupRequest( 7 | @SerializedName("email") 8 | val email: String, 9 | @SerializedName("password") 10 | val password: String, 11 | @SerializedName("name") 12 | val name: String 13 | ) 14 | 15 | fun SignupParam.toRequest() = SignupRequest( 16 | email = email, 17 | password = password, 18 | name = name 19 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/auth/SocialLoginRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.auth 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.SocialLoginParam 5 | 6 | data class SocialLoginRequest( 7 | @SerializedName("code") 8 | private val code: String 9 | ) 10 | 11 | fun SocialLoginParam.toRequest() = SocialLoginRequest( 12 | code = code 13 | ) 14 | 15 | -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/email/SendVerificationCodeRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.email 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.SendVerificationCodeParam 5 | 6 | data class SendVerificationCodeRequest ( 7 | @SerializedName("email") 8 | val email: String 9 | ) 10 | 11 | fun SendVerificationCodeParam.toRequest() = SendVerificationCodeRequest( 12 | email = email 13 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/img/ChangeProfilePictureRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.img 2 | 3 | import android.media.Image 4 | import com.google.gson.annotations.SerializedName 5 | import com.team_ia.domain.param.ChangeProfilePictureParam 6 | import okhttp3.MultipartBody 7 | 8 | data class ChangeProfilePictureRequest( 9 | @SerializedName("multipartFiles") 10 | val multipartFiles: MultipartBody.Part 11 | ) 12 | 13 | fun ChangeProfilePictureParam.toRequest() = ChangeProfilePictureRequest( 14 | multipartFiles = multipartFiles 15 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/img/PostProfilePictureRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.img 2 | 3 | import android.media.Image 4 | import com.google.gson.annotations.SerializedName 5 | import com.team_ia.domain.param.PostProfilePictureParam 6 | import okhttp3.MultipartBody 7 | 8 | data class PostProfilePictureRequest( 9 | @SerializedName("multipartFiles") 10 | val multipartFiles: MultipartBody.Part 11 | ) 12 | 13 | fun PostProfilePictureParam.toRequest() = PostProfilePictureRequest( 14 | multipartFiles = multipartFiles 15 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/member/ChangeNickNameRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.member 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.ChangeNickNameParam 5 | 6 | data class ChangeNickNameRequest( 7 | @SerializedName("newNickname") 8 | val newNickname: String 9 | ) 10 | 11 | fun ChangeNickNameParam.toRequest() = ChangeNickNameRequest( 12 | newNickname = newNickname 13 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/member/ChangePasswordRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.member 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.PasswordParam 5 | 6 | data class ChangePasswordRequest( 7 | @SerializedName("currentPassword") 8 | val currentPassword: String, 9 | @SerializedName("newPassword") 10 | val newPassword: String 11 | ) 12 | 13 | fun PasswordParam.toRequest() = ChangePasswordRequest( 14 | currentPassword = currentPassword, 15 | newPassword = newPassword 16 | ) 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/member/FindPasswordRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.member 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.FindPasswordParam 5 | 6 | data class FindPasswordRequest( 7 | @SerializedName("password") 8 | val password: String, 9 | @SerializedName("checkPassword") 10 | val checkPassword: String 11 | ) 12 | 13 | fun FindPasswordParam.toRequest() = FindPasswordRequest( 14 | password = password, 15 | checkPassword = checkPassword 16 | ) 17 | -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/member/MemberRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.member 2 | 3 | import com.google.gson.annotations.SerializedName 4 | 5 | data class MemberRequest( 6 | @SerializedName("email") 7 | val email: String 8 | ) 9 | -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/member/WithdrawalMemberRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.member 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.WithdrawalMemberParam 5 | 6 | data class WithdrawalMemberRequest ( 7 | @SerializedName("email") 8 | val email: String, 9 | @SerializedName("password") 10 | val password: String 11 | ) 12 | 13 | fun WithdrawalMemberParam.toRequest() = WithdrawalMemberRequest( 14 | email = email, 15 | password = password 16 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/post/PostCommentRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.post 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.PostCommentParam 5 | 6 | data class PostCommentRequest( 7 | @SerializedName("content") 8 | val content: String 9 | ) 10 | 11 | fun PostCommentParam.toRequest() = PostCommentRequest( 12 | content = content 13 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/post/SearchPostRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.post 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.SearchPostParam 5 | 6 | data class SearchPostRequest ( 7 | @SerializedName("category") 8 | val category: List 9 | ) 10 | 11 | fun SearchPostParam.toRequest() = SearchPostRequest( 12 | category = category 13 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/request/post/WritePostRequest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.request.post 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.param.WritePostParam 5 | 6 | data class WritePostRequest ( 7 | @SerializedName("title") 8 | val title: String, 9 | @SerializedName("content") 10 | val content: String, 11 | @SerializedName("category") 12 | val category: List 13 | ) 14 | 15 | fun WritePostParam.toRequest() = WritePostRequest( 16 | title = title, 17 | content = content, 18 | category = category 19 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/response/admin/ReadNoticeResponse.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.response.admin 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.data.remote.model.NoticeModel 5 | import com.team_ia.data.remote.model.toEntity 6 | import com.team_ia.domain.entity.ReadNoticeEntity 7 | 8 | data class ReadNoticeResponse( 9 | @SerializedName("noticeResponses") 10 | val notice: List 11 | ) 12 | 13 | fun ReadNoticeResponse.toEntity() = ReadNoticeEntity( 14 | notice = notice.map { it.toEntity() } 15 | ) 16 | -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/response/application/GetApplicantResponse.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.response.application 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.entity.GetApplicantEntity 5 | 6 | data class GetApplicantResponse( 7 | @SerializedName("ApplicationResponse") 8 | val applicationResponse: List 9 | ) { 10 | data class Member( 11 | @SerializedName("memberId") 12 | val memberId: Long, 13 | @SerializedName("name") 14 | val name: String 15 | ) 16 | 17 | fun Member.toEntity() = GetApplicantEntity.Member( 18 | memberId = memberId, 19 | name = name 20 | ) 21 | } 22 | 23 | fun GetApplicantResponse.toEntity() = GetApplicantEntity( 24 | applicationResponse = applicationResponse.map { it.toEntity() } 25 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/response/auth/LoginResponse.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.response.auth 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.entity.LoginEntity 5 | 6 | data class LoginResponse( 7 | @SerializedName("accessToken") 8 | val accessToken: String, 9 | @SerializedName("refreshToken") 10 | val refreshToken: String, 11 | @SerializedName("expiredAt") 12 | val expiredAt: String 13 | ) 14 | fun LoginResponse.toEntity() = LoginEntity( 15 | accessToken = accessToken, 16 | refreshToken = refreshToken, 17 | expiredAt = expiredAt 18 | ) 19 | 20 | 21 | -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/response/member/GetDetailNoticeResponse.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.response.member 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.entity.GetDetailNoticeEntity 5 | 6 | data class GetDetailNoticeResponse( 7 | @SerializedName("noticeId") 8 | val noticeId: Long, 9 | @SerializedName("title") 10 | val title: String, 11 | @SerializedName("content") 12 | val content: String, 13 | @SerializedName("createDate") 14 | val createDate: String 15 | ) 16 | fun GetDetailNoticeResponse.toEntity() = GetDetailNoticeEntity( 17 | noticeId = noticeId, 18 | title = title, 19 | content = content, 20 | createDate = createDate 21 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/response/member/GetNoticeResponse.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.response.member 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.domain.entity.GetNoticeEntity 5 | import com.team_ia.domain.entity.GetNoticeEntity.Notice as DomainNotice 6 | 7 | data class GetNoticeResponse( 8 | @SerializedName("noticeResponses") 9 | val noticeResponses: List 10 | ){ 11 | data class Notice( 12 | @SerializedName("noticeId") 13 | val noticeId: Long, 14 | @SerializedName("title") 15 | val title: String, 16 | @SerializedName("content") 17 | val content: String, 18 | @SerializedName("createDate") 19 | val createDate: String 20 | ) 21 | 22 | fun Notice.toEntity() = DomainNotice( 23 | noticeId = noticeId, 24 | title = title, 25 | content = content, 26 | createDate = createDate 27 | ) 28 | } 29 | 30 | fun GetNoticeResponse.toEntity() = GetNoticeEntity( 31 | noticeResponses = noticeResponses.map { it.toEntity() } 32 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/remote/response/member/MemberResponse.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.remote.response.member 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import com.team_ia.data.remote.model.PostModel 5 | import com.team_ia.data.remote.model.toEntity 6 | import com.team_ia.domain.entity.MemberEntity 7 | 8 | data class MemberResponse( 9 | @SerializedName("email") 10 | val email: String, 11 | @SerializedName("name") 12 | val name: String, 13 | @SerializedName("profileImg") 14 | val profileImg: String? 15 | ) 16 | 17 | fun MemberResponse.toEntity() = MemberEntity( 18 | email = email, 19 | name = name, 20 | profileImg = profileImg 21 | ) -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/repository/AdminRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.repository 2 | 3 | import com.team_ia.data.remote.datasource.admin.AdminDataSource 4 | import com.team_ia.data.remote.model.toEntity 5 | import com.team_ia.data.remote.request.admin.toRequest 6 | import com.team_ia.data.remote.response.admin.toEntity 7 | import com.team_ia.domain.entity.ReadNoticeEntity 8 | import com.team_ia.domain.model.NoticeModel 9 | import com.team_ia.domain.param.EditNoticeParam 10 | import com.team_ia.domain.param.PostNoticeParam 11 | import com.team_ia.domain.repository.AdminRepository 12 | import javax.inject.Inject 13 | 14 | class AdminRepositoryImpl @Inject constructor( 15 | private val adminDataSource: AdminDataSource 16 | ) : AdminRepository { 17 | 18 | override suspend fun postNotice(param: PostNoticeParam) = 19 | adminDataSource.postNotice(param.toRequest()) 20 | 21 | override suspend fun readNotice(): ReadNoticeEntity = 22 | adminDataSource.readNotice().toEntity() 23 | 24 | override suspend fun deleteNotice(noticeId: Long) = 25 | adminDataSource.deleteNotice(noticeId) 26 | 27 | override suspend fun editNotice(noticeId: Long, param: EditNoticeParam) = 28 | adminDataSource.editNotice(noticeId, param.toRequest()) 29 | 30 | override suspend fun detailNotice(noticeId: Long): NoticeModel = 31 | adminDataSource.detailNotice(noticeId).toEntity() 32 | 33 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/repository/ApplicationRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.repository 2 | 3 | import com.team_ia.data.remote.datasource.application.ApplicationDataSource 4 | import com.team_ia.data.remote.response.application.toEntity 5 | import com.team_ia.domain.entity.GetApplicantEntity 6 | import com.team_ia.domain.repository.ApplicationRepository 7 | import javax.inject.Inject 8 | 9 | class ApplicationRepositoryImpl @Inject constructor( 10 | private val applicationDataSource: ApplicationDataSource 11 | ) : ApplicationRepository { 12 | 13 | override suspend fun applicationPost(postId: Long) = 14 | applicationDataSource.applicationPost(postId) 15 | 16 | override suspend fun getApplicant(postId: Long): GetApplicantEntity = 17 | applicationDataSource.getApplicant(postId).toEntity() 18 | 19 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/repository/AuthRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.repository 2 | 3 | import com.team_ia.data.local.datasource.LocalAuthDataSource 4 | import com.team_ia.data.remote.datasource.auth.AuthDataSource 5 | import com.team_ia.data.remote.request.auth.toRequest 6 | import com.team_ia.data.remote.response.auth.toEntity 7 | import com.team_ia.domain.entity.LoginEntity 8 | import com.team_ia.domain.param.LoginParam 9 | import com.team_ia.domain.param.SignupParam 10 | import com.team_ia.domain.repository.AuthRepository 11 | import javax.inject.Inject 12 | 13 | class AuthRepositoryImpl @Inject constructor( 14 | private val authDatasource: AuthDataSource, 15 | private val localAuthDataSource: LocalAuthDataSource 16 | ) : AuthRepository { 17 | override suspend fun login(param: LoginParam): LoginEntity = 18 | authDatasource.login(param.toRequest()).toEntity() 19 | 20 | override suspend fun signup(param: SignupParam) = 21 | authDatasource.signup(param.toRequest()) 22 | 23 | override suspend fun logout() = 24 | authDatasource.logout() 25 | 26 | override suspend fun saveToken(accessToken: String?, refreshToken: String?, expiredAt: String?) = 27 | localAuthDataSource.saveToken(accessToken, refreshToken, expiredAt) 28 | 29 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/repository/EmailRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.repository 2 | 3 | import com.team_ia.data.remote.datasource.email.EmailDataSource 4 | import com.team_ia.data.remote.request.email.toRequest 5 | import com.team_ia.domain.param.SendVerificationCodeParam 6 | import com.team_ia.domain.repository.EmailRepository 7 | import javax.inject.Inject 8 | 9 | class EmailRepositoryImpl @Inject constructor( 10 | private val emailDataSource: EmailDataSource 11 | ) : EmailRepository { 12 | override suspend fun sendVerificationCode(param: SendVerificationCodeParam) = 13 | emailDataSource.sendVerificationCode(param.toRequest()) 14 | 15 | override suspend fun checkVerificationCode(email: String, authKey: Int) = 16 | emailDataSource.checkVerificationCode(email, authKey) 17 | 18 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/repository/ImgRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.repository 2 | 3 | import com.team_ia.data.remote.datasource.img.ImgDataSource 4 | import com.team_ia.data.remote.request.img.toRequest 5 | import com.team_ia.domain.param.ChangeProfilePictureParam 6 | import com.team_ia.domain.param.PostProfilePictureParam 7 | import com.team_ia.domain.repository.ImgRepository 8 | import javax.inject.Inject 9 | 10 | class ImgRepositoryImpl @Inject constructor( 11 | private val imgDataSource: ImgDataSource 12 | ) : ImgRepository { 13 | 14 | override suspend fun postProfilePicture(postProfilePictureParam: PostProfilePictureParam) = 15 | imgDataSource.postProfilePicture(postProfilePictureParam.toRequest()) 16 | 17 | override suspend fun changeProfilePicture(changeProfilePictureParam: ChangeProfilePictureParam) = 18 | imgDataSource.changeProfilePicture(changeProfilePictureParam.toRequest()) 19 | 20 | override suspend fun deleteProfilePicture() = 21 | imgDataSource.deleteProfilePicture() 22 | 23 | } -------------------------------------------------------------------------------- /data/src/main/java/com/team_ia/data/repository/SocialRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data.repository 2 | 3 | import com.team_ia.data.local.datasource.LocalAuthDataSource 4 | import com.team_ia.data.remote.datasource.social.SocialDataSource 5 | import com.team_ia.data.remote.request.auth.toRequest 6 | import com.team_ia.data.remote.response.auth.toEntity 7 | import com.team_ia.domain.entity.LoginEntity 8 | import com.team_ia.domain.param.SocialLoginParam 9 | import com.team_ia.domain.repository.SocialRepository 10 | import javax.inject.Inject 11 | 12 | class SocialRepositoryImpl @Inject constructor( 13 | private val socialDataSource: SocialDataSource, 14 | private val localAuthDataSource: LocalAuthDataSource 15 | ) : SocialRepository { 16 | override suspend fun googleLogin(param: SocialLoginParam): LoginEntity = 17 | socialDataSource.googleLogin(param.toRequest()).toEntity() 18 | 19 | override suspend fun kakaoLogin(param: SocialLoginParam): LoginEntity = 20 | socialDataSource.kakaoLogin(param.toRequest()).toEntity() 21 | 22 | override suspend fun logout() { 23 | socialDataSource.logout() 24 | } 25 | 26 | override suspend fun saveToken(accessToken: String, refreshToken: String, expiredAt: String) { 27 | localAuthDataSource.saveToken(accessToken, refreshToken, expiredAt) 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /data/src/test/java/com/team_ia/data/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.data 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /di/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /di/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Idea-Archive/Idea-Archive-Android/bb44bca1d4c86987563fe15c645b254775c88dd9/di/consumer-rules.pro -------------------------------------------------------------------------------- /di/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /di/src/androidTest/java/com/team_ia/di/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.di 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.team_ia.di.test", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /di/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /di/src/main/java/com/team_ia/di/LocalDataSourceModule.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.di 2 | 3 | import com.team_ia.data.local.datasource.LocalAuthDataSource 4 | import com.team_ia.data.local.datasource.LocalAuthDataSourceImpl 5 | import dagger.Binds 6 | import dagger.Module 7 | import dagger.Provides 8 | import dagger.hilt.InstallIn 9 | import dagger.hilt.components.SingletonComponent 10 | 11 | @Module 12 | @InstallIn(SingletonComponent::class) 13 | abstract class LocalDataSourceModule { 14 | 15 | @Binds 16 | abstract fun provideLocalAuthDataSource( 17 | localAuthDataSourceImpl: LocalAuthDataSourceImpl 18 | ): LocalAuthDataSource 19 | 20 | } -------------------------------------------------------------------------------- /di/src/main/java/com/team_ia/di/RepositoryModule.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.di 2 | 3 | import com.team_ia.data.repository.* 4 | import com.team_ia.domain.repository.* 5 | import dagger.Binds 6 | import dagger.Module 7 | import dagger.hilt.InstallIn 8 | import dagger.hilt.components.SingletonComponent 9 | 10 | @Module 11 | @InstallIn(SingletonComponent::class) 12 | abstract class RepositoryModule { 13 | 14 | @Binds 15 | abstract fun provideAuthRepository( 16 | authRepositoryImpl: AuthRepositoryImpl 17 | ): AuthRepository 18 | 19 | @Binds 20 | abstract fun providePostRepository( 21 | postRepositoryImpl: PostRepositoryImpl 22 | ): PostRepository 23 | 24 | @Binds 25 | abstract fun provideMemberRepository( 26 | memberRepositoryImpl: MemberRepositoryImpl 27 | ): MemberRepository 28 | 29 | @Binds 30 | abstract fun provideEmailRepository( 31 | emailRepositoryImpl: EmailRepositoryImpl 32 | ): EmailRepository 33 | 34 | @Binds 35 | abstract fun provideAdminRepository( 36 | adminRepositoryImpl: AdminRepositoryImpl 37 | ): AdminRepository 38 | 39 | @Binds 40 | abstract fun provideImgRepository( 41 | imgRepositoryImpl: ImgRepositoryImpl 42 | ): ImgRepository 43 | 44 | @Binds 45 | abstract fun provideApplicationRepository( 46 | applicationRepositoryImpl: ApplicationRepositoryImpl 47 | ): ApplicationRepository 48 | 49 | @Binds 50 | abstract fun provideSocialRepository( 51 | socialRepositoryImpl: SocialRepositoryImpl 52 | ): SocialRepository 53 | } -------------------------------------------------------------------------------- /di/src/main/java/com/team_ia/di/SharedPreferenceModule.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.di 2 | 3 | import android.content.Context 4 | import android.content.SharedPreferences 5 | import androidx.preference.PreferenceManager 6 | import dagger.Module 7 | import dagger.Provides 8 | import dagger.hilt.InstallIn 9 | import dagger.hilt.android.qualifiers.ApplicationContext 10 | import dagger.hilt.components.SingletonComponent 11 | 12 | 13 | @Module 14 | @InstallIn(SingletonComponent::class) 15 | class SharedPreferenceModule { 16 | @Provides 17 | fun provideSharedPreference( 18 | @ApplicationContext context: Context 19 | ): SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context) 20 | } -------------------------------------------------------------------------------- /di/src/main/java/com/team_ia/di/StorageModule.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.di 2 | 3 | import com.team_ia.data.local.storage.AuthStorage 4 | import com.team_ia.data.local.storage.AuthStorageImpl 5 | import dagger.Binds 6 | import dagger.Module 7 | import dagger.hilt.InstallIn 8 | import dagger.hilt.components.SingletonComponent 9 | 10 | @Module 11 | @InstallIn(SingletonComponent::class) 12 | abstract class StorageModule { 13 | @Binds 14 | abstract fun provideAuthStorage( 15 | authStorageImpl: AuthStorageImpl 16 | ): AuthStorage 17 | } -------------------------------------------------------------------------------- /di/src/test/java/com/team_ia/di/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.di 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /domain/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /domain/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | id("kotlin-kapt") 5 | } 6 | 7 | android { 8 | namespace = "com.team_ia.domain" 9 | compileSdk = Versions.COMPILE_SDK_VERSION 10 | 11 | defaultConfig { 12 | minSdk = Versions.MIN_SDK_VERSION 13 | targetSdk = Versions.TARGET_SDK_VERSION 14 | 15 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 16 | consumerProguardFiles("consumer-rules.pro") 17 | } 18 | 19 | buildTypes { 20 | release { 21 | isMinifyEnabled = false 22 | proguardFiles( 23 | getDefaultProguardFile("proguard-android-optimize.txt"), 24 | "proguard-rules.pro" 25 | ) 26 | } 27 | } 28 | 29 | buildFeatures { 30 | viewBinding = true 31 | } 32 | 33 | compileOptions { 34 | sourceCompatibility = Versions.JAVA_VERSION 35 | targetCompatibility = Versions.JAVA_VERSION 36 | } 37 | kotlinOptions { 38 | jvmTarget = Versions.JAVA_VERSION.toString() 39 | } 40 | } 41 | 42 | dependencies { 43 | 44 | implementation(Dependency.JavaX.INJECT) 45 | 46 | testImplementation(Dependency.UnitTest.JUNIT) 47 | testImplementation(Dependency.UnitTest.MOCKITO) 48 | implementation(Dependency.Libraries.OKHTTP) 49 | 50 | androidTestImplementation(Dependency.AndroidTest.ANDROID_JUNIT) 51 | androidTestImplementation(Dependency.AndroidTest.ESPRESSO_CORE) 52 | } -------------------------------------------------------------------------------- /domain/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Idea-Archive/Idea-Archive-Android/bb44bca1d4c86987563fe15c645b254775c88dd9/domain/consumer-rules.pro -------------------------------------------------------------------------------- /domain/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /domain/src/androidTest/java/com/team_ia/domain/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.team_ia.domain.test", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /domain/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/entity/GetApplicantEntity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.entity 2 | 3 | data class GetApplicantEntity( 4 | val applicationResponse: List 5 | ) { 6 | data class Member( 7 | val memberId: Long, 8 | val name: String 9 | ) 10 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/entity/GetDetailNoticeEntity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.entity 2 | 3 | data class GetDetailNoticeEntity( 4 | val noticeId: Long, 5 | val title: String, 6 | val content: String, 7 | val createDate: String 8 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/entity/GetDetailPostEntity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.entity 2 | 3 | data class GetDetailPostEntity( 4 | val postId: String, 5 | val title: String, 6 | val content: String, 7 | val category: List, 8 | val member: Member, 9 | val comment: List, 10 | val heartCount: Int, 11 | val commentCount: Int, 12 | val applicantCount: Int, 13 | val views: Int, 14 | val createDate: String 15 | ){ 16 | data class Member( 17 | val memberId: Long, 18 | val name: String 19 | ) 20 | 21 | data class Comment( 22 | val commentId: Long, 23 | val content: String, 24 | val createDate: String, 25 | val member: Member 26 | ) 27 | 28 | fun Comment.toEntity() = GetDetailPostEntity.Comment( 29 | commentId = commentId, 30 | content = content, 31 | createDate = createDate, 32 | member = member 33 | ) 34 | } 35 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/entity/GetNoticeEntity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.entity 2 | 3 | data class GetNoticeEntity( 4 | val noticeResponses: List 5 | ){ 6 | data class Notice( 7 | val noticeId: Long, 8 | val title: String, 9 | val content: String, 10 | val createDate: String 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/entity/LoginEntity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.entity 2 | 3 | data class LoginEntity( 4 | val accessToken: String, 5 | val refreshToken: String, 6 | val expiredAt: String 7 | ) 8 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/entity/MemberEntity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.entity 2 | 3 | import java.io.Serializable 4 | 5 | data class MemberEntity( 6 | val email: String, 7 | val name: String, 8 | val profileImg: String? 9 | ): Serializable 10 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/entity/ReadNoticeEntity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.entity 2 | 3 | import com.team_ia.domain.model.NoticeModel 4 | 5 | data class ReadNoticeEntity( 6 | val notice: List 7 | ) 8 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/exception/HttpException.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.exception 2 | 3 | /** 4 | * 요청이 올바르지 않은 경우 5 | * Http Status 가 400번일 때 사용 6 | * */ 7 | class BadRequestException( 8 | override val message: String? 9 | ) : RuntimeException() 10 | 11 | 12 | /** 13 | * 비인증 되었을 경우 -> 인증을 해야함 14 | * Http Status 가 401번일 때 사용 15 | */ 16 | class UnauthorizedException( 17 | override val message: String? 18 | ) : RuntimeException() 19 | 20 | 21 | /** 22 | * 권한이 없는 경우 23 | * Http Status 가 403번일 때 사용 24 | */ 25 | class ForBiddenException( 26 | override val message: String? 27 | ) : RuntimeException() 28 | 29 | 30 | /** 31 | * 요청 받은 리소스를 찾을 수 없는 경우 32 | * Http Status 가 404번일 때 사용 33 | */ 34 | class NotFoundException( 35 | override val message: String? 36 | ) : RuntimeException() 37 | 38 | 39 | /** 40 | * 에이전트가 정해준 규격에 맞는게 없을 경우 41 | * Http Status 가 406번일 때 사용 42 | */ 43 | class NotAcceptableException( 44 | override val message: String? 45 | ) : RuntimeException() 46 | 47 | /** 48 | * 요청이 너무 오래 걸리는 경우 49 | * Http Status가 408번 일 때 사용 50 | */ 51 | class TimeOutException( 52 | override val message: String? 53 | ) : RuntimeException() 54 | 55 | 56 | /** 57 | * 권한이 없을 경우 58 | * Http Status 가 409일 때 사용 59 | * */ 60 | class ConflictException( 61 | override val message: String? 62 | ) : RuntimeException() 63 | 64 | 65 | /** 66 | * 서버에러가 발생하는 경우 67 | * Http Status 가 50X일 때 사용 68 | */ 69 | class ServerException( 70 | override val message: String? 71 | ) : RuntimeException() 72 | 73 | 74 | /** 75 | * 예상하지 못한 에러가 발생하는 경우 76 | */ 77 | class OtherHttpException( 78 | val code: Int, 79 | override val message: String? 80 | ) : RuntimeException() 81 | 82 | 83 | class UnKnownException( 84 | override val message: String? 85 | ) : RuntimeException() -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/exception/IOException.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.exception 2 | 3 | import java.io.IOException 4 | 5 | class NeedLoginException: IOException() { 6 | override val message: String 7 | get() = "토큰이 만료되었습니다. 다시 로그인 해주세요." 8 | 9 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/exception/NetworkException.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.exception 2 | 3 | class NetworkException: RuntimeException() { 4 | override val message: String 5 | get() = "네트워크가 불안정합니다. 데이터나 와이파이 연결 상태를 확인해 주세요." 6 | 7 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/model/NoticeModel.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.model 2 | 3 | data class NoticeModel( 4 | val noticeId: Long, 5 | val title: String, 6 | val content: String, 7 | val createData: String 8 | ) 9 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/model/PostModel.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.model 2 | 3 | data class PostModel( 4 | val postId: String, 5 | val title: String, 6 | val content: String, 7 | val category: List, 8 | val heartCount: Int, 9 | val commentCount: Int, 10 | val member: Member, 11 | val heart: Boolean, 12 | val createDate: String 13 | ) { 14 | data class Member( 15 | val memberId: Long, 16 | val name: String 17 | ) 18 | 19 | fun Member.toEntity() = PostModel.Member( 20 | memberId = memberId, 21 | name = name 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/ChangeNickNameParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class ChangeNickNameParam( 4 | val newNickname: String 5 | ) 6 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/ChangeProfilePictureParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | import okhttp3.MultipartBody 4 | 5 | data class ChangeProfilePictureParam( 6 | val multipartFiles: MultipartBody.Part 7 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/EditNoticeParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class EditNoticeParam( 4 | val title: String, 5 | val content: String 6 | ) 7 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/FindPasswordParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class FindPasswordParam( 4 | val password: String, 5 | val checkPassword: String 6 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/LoginParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class LoginParam( 4 | val email: String, 5 | val password: String 6 | ) 7 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/PasswordParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class PasswordParam( 4 | val currentPassword: String, 5 | val newPassword: String 6 | ) 7 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/PostCommentParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class PostCommentParam( 4 | val content: String 5 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/PostNoticeParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class PostNoticeParam( 4 | val title: String, 5 | val content: String 6 | ) 7 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/PostProfilePictureParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | import okhttp3.MultipartBody 4 | 5 | data class PostProfilePictureParam( 6 | val multipartFiles: MultipartBody.Part 7 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/SearchPostParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class SearchPostParam ( 4 | val category: List 5 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/SendVerificationCodeParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class SendVerificationCodeParam ( 4 | val email: String 5 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/SignupParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class SignupParam ( 4 | val email: String, 5 | val password: String, 6 | val name: String 7 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/SocialLoginParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class SocialLoginParam( 4 | val code: String 5 | ) 6 | -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/WithdrawalMemberParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | data class WithdrawalMemberParam ( 4 | val email: String, 5 | val password: String 6 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/param/WritePostParam.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.param 2 | 3 | class WritePostParam ( 4 | val title: String, 5 | val content: String, 6 | val category: List 7 | ) -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/repository/AdminRepository.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.repository 2 | 3 | import com.team_ia.domain.entity.* 4 | import com.team_ia.domain.model.NoticeModel 5 | import com.team_ia.domain.param.* 6 | 7 | interface AdminRepository { 8 | suspend fun postNotice(param: PostNoticeParam) 9 | suspend fun readNotice(): ReadNoticeEntity 10 | suspend fun deleteNotice(noticeId: Long) 11 | suspend fun editNotice(noticeId: Long, param: EditNoticeParam) 12 | suspend fun detailNotice(noticeId: Long): NoticeModel 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/repository/ApplicationRepository.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.repository 2 | 3 | import com.team_ia.domain.entity.GetApplicantEntity 4 | 5 | interface ApplicationRepository { 6 | suspend fun applicationPost(postId: Long) 7 | suspend fun getApplicant(postId: Long): GetApplicantEntity 8 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/repository/AuthRepository.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.repository 2 | 3 | import com.team_ia.domain.entity.LoginEntity 4 | import com.team_ia.domain.param.LoginParam 5 | import com.team_ia.domain.param.SignupParam 6 | 7 | interface AuthRepository { 8 | suspend fun login(loginParam: LoginParam): LoginEntity 9 | suspend fun signup(signupParam: SignupParam) 10 | suspend fun logout() 11 | suspend fun saveToken( 12 | accessToken: String?, 13 | refreshToken: String?, 14 | expiredAt: String? 15 | ) 16 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/repository/EmailRepository.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.repository 2 | 3 | import com.team_ia.domain.param.SendVerificationCodeParam 4 | 5 | interface EmailRepository { 6 | suspend fun sendVerificationCode(param: SendVerificationCodeParam) 7 | suspend fun checkVerificationCode(email: String, authKey: Int) 8 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/repository/ImgRepository.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.repository 2 | 3 | import com.team_ia.domain.param.ChangeProfilePictureParam 4 | import com.team_ia.domain.param.PostProfilePictureParam 5 | 6 | interface ImgRepository { 7 | suspend fun postProfilePicture(postProfilePictureParam: PostProfilePictureParam) 8 | suspend fun changeProfilePicture(changeProfilePictureParam: ChangeProfilePictureParam) 9 | suspend fun deleteProfilePicture() 10 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/repository/MemberRepository.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.repository 2 | 3 | import com.team_ia.domain.entity.GetDetailNoticeEntity 4 | import com.team_ia.domain.entity.GetNoticeEntity 5 | import com.team_ia.domain.entity.MemberEntity 6 | import com.team_ia.domain.model.PostModel 7 | import com.team_ia.domain.param.ChangeNickNameParam 8 | import com.team_ia.domain.param.FindPasswordParam 9 | import com.team_ia.domain.param.PasswordParam 10 | import com.team_ia.domain.param.WithdrawalMemberParam 11 | 12 | interface MemberRepository { 13 | suspend fun getProfileInfo(): MemberEntity 14 | suspend fun changePassword(param: PasswordParam) 15 | suspend fun withdrawalMember(param: WithdrawalMemberParam) 16 | suspend fun findPassword(param: FindPasswordParam) 17 | suspend fun changeNickName(param: ChangeNickNameParam) 18 | suspend fun getNotice(): GetNoticeEntity 19 | suspend fun getDetailNotice(noticeId: Long): GetDetailNoticeEntity 20 | suspend fun getMyPost(): List 21 | suspend fun getMyHeartList(): List 22 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/repository/PostRepository.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.repository 2 | 3 | import com.team_ia.domain.entity.GetDetailPostEntity 4 | import com.team_ia.domain.model.PostModel 5 | import com.team_ia.domain.param.PostCommentParam 6 | import com.team_ia.domain.param.SearchPostParam 7 | import com.team_ia.domain.param.WritePostParam 8 | 9 | interface PostRepository { 10 | suspend fun writePost(param: WritePostParam) 11 | suspend fun getPost(): List 12 | suspend fun getDetailPost(postId: Long): GetDetailPostEntity 13 | suspend fun editPost(postId: Long, param: WritePostParam) 14 | suspend fun deletePost(postId: Long) 15 | suspend fun searchPost(keyword: String, param: SearchPostParam): List 16 | suspend fun getPopularPost(): List 17 | suspend fun getCategoryPost(param: SearchPostParam): List 18 | suspend fun postHeart(postId: Long) 19 | suspend fun postComment(postId: Long, param: PostCommentParam) 20 | suspend fun editComment(commentId: Long, param: PostCommentParam) 21 | suspend fun deleteComment(commentId: Long) 22 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/repository/SocialRepository.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.repository 2 | 3 | import com.team_ia.domain.entity.LoginEntity 4 | import com.team_ia.domain.param.SocialLoginParam 5 | 6 | interface SocialRepository { 7 | 8 | suspend fun googleLogin(socialLoginParam: SocialLoginParam):LoginEntity 9 | 10 | suspend fun kakaoLogin(socialLoginParam: SocialLoginParam): LoginEntity 11 | 12 | suspend fun logout() 13 | suspend fun saveToken( 14 | accessToken: String, 15 | refreshToken: String, 16 | expiredAt: String 17 | ) 18 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/admin/DeleteNoticeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.admin 2 | 3 | import com.team_ia.domain.repository.AdminRepository 4 | import javax.inject.Inject 5 | 6 | class DeleteNoticeUseCase @Inject constructor( 7 | private val adminRepository: AdminRepository 8 | ) { 9 | suspend operator fun invoke(noticeId: Long) = kotlin.runCatching { 10 | adminRepository.deleteNotice(noticeId) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/admin/DetailNoticeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.admin 2 | 3 | import com.team_ia.domain.repository.AdminRepository 4 | import javax.inject.Inject 5 | 6 | class DetailNoticeUseCase @Inject constructor( 7 | private val adminRepository: AdminRepository 8 | ) { 9 | suspend operator fun invoke(noticeId: Long) = kotlin.runCatching { 10 | adminRepository.detailNotice(noticeId) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/admin/EditNoticeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.admin 2 | 3 | import com.team_ia.domain.param.EditNoticeParam 4 | import com.team_ia.domain.repository.AdminRepository 5 | import javax.inject.Inject 6 | 7 | class EditNoticeUseCase @Inject constructor( 8 | private val adminRepository: AdminRepository 9 | ) { 10 | suspend operator fun invoke(noticeId: Long, editNoticeParam: EditNoticeParam) = kotlin.runCatching { 11 | adminRepository.editNotice(noticeId, editNoticeParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/admin/PostNoticeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.admin 2 | 3 | import com.team_ia.domain.param.PostNoticeParam 4 | import com.team_ia.domain.repository.AdminRepository 5 | import javax.inject.Inject 6 | 7 | class PostNoticeUseCase @Inject constructor( 8 | private val adminRepository: AdminRepository 9 | ) { 10 | suspend operator fun invoke(postNoticeParam: PostNoticeParam) = kotlin.runCatching { 11 | adminRepository.postNotice(postNoticeParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/admin/ReadNoticeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.admin 2 | 3 | import com.team_ia.domain.repository.AdminRepository 4 | import javax.inject.Inject 5 | 6 | class ReadNoticeUseCase @Inject constructor( 7 | private val adminRepository: AdminRepository 8 | ) { 9 | suspend operator fun invoke() = kotlin.runCatching { 10 | adminRepository.readNotice() 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/application/ApplicationPostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.application 2 | 3 | import com.team_ia.domain.repository.ApplicationRepository 4 | import javax.inject.Inject 5 | 6 | class ApplicationPostUseCase @Inject constructor( 7 | private val applicationRepository: ApplicationRepository 8 | ) { 9 | suspend operator fun invoke(postId: Long) = kotlin.runCatching { 10 | applicationRepository.applicationPost(postId) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/application/GetApplicantUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.application 2 | 3 | import com.team_ia.domain.repository.ApplicationRepository 4 | import javax.inject.Inject 5 | 6 | class GetApplicantUseCase @Inject constructor( 7 | private val applicationRepository: ApplicationRepository 8 | ) { 9 | suspend operator fun invoke(postId: Long) = kotlin.runCatching { 10 | applicationRepository.getApplicant(postId) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/auth/LoginUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.auth 2 | 3 | import com.team_ia.domain.param.LoginParam 4 | import com.team_ia.domain.repository.AuthRepository 5 | import javax.inject.Inject 6 | 7 | class LoginUseCase @Inject constructor( 8 | private val authRepository: AuthRepository 9 | ){ 10 | suspend operator fun invoke(loginParam: LoginParam) = kotlin.runCatching { 11 | authRepository.login(loginParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/auth/LogoutUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.auth 2 | 3 | import com.team_ia.domain.repository.AuthRepository 4 | import javax.inject.Inject 5 | 6 | class LogoutUseCase @Inject constructor( 7 | private val authRepository: AuthRepository 8 | ) { 9 | suspend operator fun invoke() = kotlin.runCatching { 10 | authRepository.logout() 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/auth/SaveTokenUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.auth 2 | 3 | import com.team_ia.domain.repository.AuthRepository 4 | import javax.inject.Inject 5 | 6 | class SaveTokenUseCase @Inject constructor( 7 | private val authRepository: AuthRepository 8 | ) { 9 | suspend operator fun invoke( 10 | accessToken: String? = null, 11 | refreshToken: String? = null, 12 | expiredAt: String? = null 13 | ) = 14 | kotlin.runCatching { 15 | authRepository.saveToken(accessToken, refreshToken, expiredAt) 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/auth/SignupUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.auth 2 | 3 | import com.team_ia.domain.param.SignupParam 4 | import com.team_ia.domain.repository.AuthRepository 5 | import javax.inject.Inject 6 | 7 | class SignupUseCase @Inject constructor( 8 | private val authRepository: AuthRepository 9 | ) { 10 | suspend operator fun invoke(signupParam: SignupParam) = kotlin.runCatching { 11 | authRepository.signup(signupParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/email/CheckVerificationCodeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.email 2 | 3 | import com.team_ia.domain.repository.EmailRepository 4 | import javax.inject.Inject 5 | 6 | class CheckVerificationCodeUseCase @Inject constructor( 7 | private val emailRepository: EmailRepository 8 | ) { 9 | suspend operator fun invoke(email: String, authKey: Int) = kotlin.runCatching { 10 | emailRepository.checkVerificationCode(email = email, authKey = authKey) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/email/SendVerificationCodeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.email 2 | 3 | import com.team_ia.domain.param.SendVerificationCodeParam 4 | import com.team_ia.domain.repository.EmailRepository 5 | import javax.inject.Inject 6 | 7 | class SendVerificationCodeUseCase @Inject constructor( 8 | private val emailRepository: EmailRepository 9 | ) { 10 | suspend operator fun invoke(sendVerificationCodeParam: SendVerificationCodeParam) = kotlin.runCatching { 11 | emailRepository.sendVerificationCode(sendVerificationCodeParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/img/ChangeProfilePictureUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.img 2 | 3 | import com.team_ia.domain.param.ChangeProfilePictureParam 4 | import com.team_ia.domain.repository.ImgRepository 5 | import javax.inject.Inject 6 | 7 | class ChangeProfilePictureUseCase @Inject constructor( 8 | private val imgRepository: ImgRepository 9 | ) { 10 | suspend operator fun invoke(changeProfilePictureParam: ChangeProfilePictureParam) = kotlin.runCatching { 11 | imgRepository.changeProfilePicture(changeProfilePictureParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/img/DeleteProfilePicture.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.img 2 | 3 | import com.team_ia.domain.repository.ImgRepository 4 | import javax.inject.Inject 5 | 6 | class DeleteProfilePicture @Inject constructor( 7 | private val imgRepository: ImgRepository 8 | ) { 9 | suspend operator fun invoke() = kotlin.runCatching { 10 | imgRepository.deleteProfilePicture() 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/img/PostProfilePictureUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.img 2 | 3 | import com.team_ia.domain.param.PostProfilePictureParam 4 | import com.team_ia.domain.repository.ImgRepository 5 | import javax.inject.Inject 6 | 7 | class PostProfilePictureUseCase @Inject constructor( 8 | private val imgRepository: ImgRepository 9 | ) { 10 | suspend operator fun invoke(postProfilePictureParam: PostProfilePictureParam) = kotlin.runCatching { 11 | imgRepository.postProfilePicture(postProfilePictureParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/member/ChangeNickNameUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.member 2 | 3 | import com.team_ia.domain.param.ChangeNickNameParam 4 | import com.team_ia.domain.repository.MemberRepository 5 | import javax.inject.Inject 6 | 7 | class ChangeNickNameUseCase @Inject constructor( 8 | private val memberRepository: MemberRepository 9 | ) { 10 | suspend operator fun invoke(changeNickNameParam: ChangeNickNameParam) = kotlin.runCatching { 11 | memberRepository.changeNickName(changeNickNameParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/member/ChangePasswordUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.member 2 | 3 | import com.team_ia.domain.param.PasswordParam 4 | import com.team_ia.domain.repository.MemberRepository 5 | import javax.inject.Inject 6 | 7 | class ChangePasswordUseCase @Inject constructor( 8 | private val memberRepository: MemberRepository 9 | ) { 10 | suspend operator fun invoke(passwordParam: PasswordParam) = kotlin.runCatching { 11 | memberRepository.changePassword(passwordParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/member/FindPasswordUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.member 2 | 3 | import com.team_ia.domain.param.FindPasswordParam 4 | import com.team_ia.domain.repository.MemberRepository 5 | import javax.inject.Inject 6 | 7 | class FindPasswordUseCase @Inject constructor( 8 | private val memberRepository: MemberRepository 9 | ) { 10 | suspend operator fun invoke(findPasswordParam: FindPasswordParam) = kotlin.runCatching { 11 | memberRepository.findPassword(findPasswordParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/member/GetDetailNoticeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.member 2 | 3 | import com.team_ia.domain.repository.MemberRepository 4 | import javax.inject.Inject 5 | 6 | class GetDetailNoticeUseCase @Inject constructor( 7 | private val memberRepository: MemberRepository 8 | ) { 9 | suspend operator fun invoke(noticeId: Long) = kotlin.runCatching { 10 | memberRepository.getDetailNotice(noticeId) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/member/GetMyHeartListUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.member 2 | 3 | import com.team_ia.domain.repository.MemberRepository 4 | import javax.inject.Inject 5 | 6 | class GetMyHeartListUseCase @Inject constructor( 7 | private val memberRepository: MemberRepository 8 | ) { 9 | suspend operator fun invoke() = kotlin.runCatching { 10 | memberRepository.getMyHeartList() 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/member/GetMyPostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.member 2 | 3 | import com.team_ia.domain.repository.MemberRepository 4 | import javax.inject.Inject 5 | 6 | class GetMyPostUseCase @Inject constructor( 7 | private val memberRepository: MemberRepository 8 | ) { 9 | suspend operator fun invoke() = kotlin.runCatching { 10 | memberRepository.getMyPost() 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/member/GetNoticeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.member 2 | 3 | import com.team_ia.domain.repository.MemberRepository 4 | import javax.inject.Inject 5 | 6 | class GetNoticeUseCase @Inject constructor( 7 | private val memberRepository: MemberRepository 8 | ) { 9 | suspend operator fun invoke() = kotlin.runCatching { 10 | memberRepository.getNotice() 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/member/GetProfileInfoUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.member 2 | 3 | import com.team_ia.domain.repository.MemberRepository 4 | import javax.inject.Inject 5 | 6 | class GetProfileInfoUseCase @Inject constructor( 7 | private val memberRepository: MemberRepository 8 | ) { 9 | suspend operator fun invoke() = kotlin.runCatching { 10 | memberRepository.getProfileInfo() 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/member/WithdrawalMemberUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.member 2 | 3 | import com.team_ia.domain.param.WithdrawalMemberParam 4 | import com.team_ia.domain.repository.MemberRepository 5 | import javax.inject.Inject 6 | 7 | class WithdrawalMemberUseCase @Inject constructor( 8 | private val memberRepository: MemberRepository 9 | ) { 10 | suspend operator fun invoke(withdrawalMemberParam: WithdrawalMemberParam) = kotlin.runCatching { 11 | memberRepository.withdrawalMember(withdrawalMemberParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/DeleteCommentUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.repository.PostRepository 4 | import javax.inject.Inject 5 | 6 | class DeleteCommentUseCase @Inject constructor( 7 | private val postRepository: PostRepository 8 | ) { 9 | suspend operator fun invoke(commentId: Long) = kotlin.runCatching { 10 | postRepository.deleteComment(commentId) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/DeletePostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.repository.PostRepository 4 | import javax.inject.Inject 5 | 6 | class DeletePostUseCase @Inject constructor( 7 | private val postRepository: PostRepository 8 | ) { 9 | suspend operator fun invoke(postId: Long) = kotlin.runCatching { 10 | postRepository.deletePost(postId) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/EditCommentUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.param.PostCommentParam 4 | import com.team_ia.domain.repository.PostRepository 5 | import javax.inject.Inject 6 | 7 | class EditCommentUseCase @Inject constructor( 8 | private val postRepository: PostRepository 9 | ) { 10 | suspend operator fun invoke(commentId: Long, editCommentParam: PostCommentParam) = kotlin.runCatching { 11 | postRepository.editComment(commentId, editCommentParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/EditPostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.param.WritePostParam 4 | import com.team_ia.domain.repository.PostRepository 5 | import javax.inject.Inject 6 | 7 | class EditPostUseCase @Inject constructor( 8 | private val postRepository: PostRepository 9 | ) { 10 | suspend operator fun invoke(postId: Long, editPostParam: WritePostParam) = kotlin.runCatching { 11 | postRepository.editPost(postId, editPostParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/GetCategoryPostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.param.SearchPostParam 4 | import com.team_ia.domain.repository.PostRepository 5 | import javax.inject.Inject 6 | 7 | class GetCategoryPostUseCase @Inject constructor( 8 | private val postRepository: PostRepository 9 | ) { 10 | suspend operator fun invoke(getCategoryPostParam: SearchPostParam) = kotlin.runCatching { 11 | postRepository.getCategoryPost(getCategoryPostParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/GetDetailPostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.repository.PostRepository 4 | import javax.inject.Inject 5 | 6 | class GetDetailPostUseCase @Inject constructor( 7 | private val postRepository: PostRepository 8 | ) { 9 | suspend operator fun invoke(postId: Long) = kotlin.runCatching { 10 | postRepository.getDetailPost(postId) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/GetPopularPostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.repository.PostRepository 4 | import javax.inject.Inject 5 | 6 | class GetPopularPostUseCase @Inject constructor( 7 | private val postRepository: PostRepository 8 | ) { 9 | suspend operator fun invoke() = kotlin.runCatching { 10 | postRepository.getPopularPost() 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/GetPostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.model.PostModel 4 | import com.team_ia.domain.repository.PostRepository 5 | import javax.inject.Inject 6 | 7 | class GetPostUseCase @Inject constructor( 8 | private val postRepository: PostRepository 9 | ) { 10 | suspend operator fun invoke(): Result> = kotlin.runCatching { 11 | postRepository.getPost() 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/PostCommentUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.param.PostCommentParam 4 | import com.team_ia.domain.repository.PostRepository 5 | import javax.inject.Inject 6 | 7 | class PostCommentUseCase @Inject constructor( 8 | private val postRepository: PostRepository 9 | ) { 10 | suspend operator fun invoke(postId: Long, postCommentParam: PostCommentParam) = kotlin.runCatching { 11 | postRepository.postComment(postId, postCommentParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/PostHeartUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.repository.PostRepository 4 | import javax.inject.Inject 5 | 6 | class PostHeartUseCase @Inject constructor( 7 | private val postRepository: PostRepository 8 | ) { 9 | suspend operator fun invoke(postId: Long) = kotlin.runCatching { 10 | postRepository.postHeart(postId) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/SearchPostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.param.SearchPostParam 4 | import com.team_ia.domain.repository.PostRepository 5 | import javax.inject.Inject 6 | 7 | class SearchPostUseCase @Inject constructor( 8 | private val postRepository: PostRepository 9 | ) { 10 | suspend operator fun invoke(keyword: String, searchPostParam: SearchPostParam) = kotlin.runCatching { 11 | postRepository.searchPost(keyword, searchPostParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/post/WritePostUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.post 2 | 3 | import com.team_ia.domain.param.WritePostParam 4 | import com.team_ia.domain.repository.PostRepository 5 | import javax.inject.Inject 6 | 7 | class WritePostUseCase @Inject constructor( 8 | private val postRepository: PostRepository 9 | ) { 10 | suspend operator fun invoke(writePostParam: WritePostParam) = kotlin.runCatching { 11 | postRepository.writePost(writePostParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/social/GoogleLoginUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.social 2 | 3 | import com.team_ia.domain.param.SocialLoginParam 4 | import com.team_ia.domain.repository.SocialRepository 5 | import javax.inject.Inject 6 | 7 | class GoogleLoginUseCase @Inject constructor( 8 | private val socialRepository: SocialRepository 9 | ) { 10 | suspend operator fun invoke(socialLoginParam: SocialLoginParam) = kotlin.runCatching { 11 | socialRepository.googleLogin(socialLoginParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/social/KakaoLoginUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.social 2 | 3 | import com.team_ia.domain.param.SocialLoginParam 4 | import com.team_ia.domain.repository.SocialRepository 5 | import javax.inject.Inject 6 | 7 | class KakaoLoginUseCase @Inject constructor( 8 | private val socialRepository: SocialRepository 9 | ) { 10 | suspend operator fun invoke(socialLoginParam: SocialLoginParam) = kotlin.runCatching { 11 | socialRepository.kakaoLogin(socialLoginParam) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/social/SocialLogoutUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.social 2 | 3 | import com.team_ia.domain.param.SocialLoginParam 4 | import com.team_ia.domain.repository.SocialRepository 5 | import javax.inject.Inject 6 | 7 | class SocialLogoutUseCase @Inject constructor( 8 | private val socialRepository: SocialRepository 9 | ) { 10 | suspend operator fun invoke() = kotlin.runCatching { 11 | socialRepository.logout() 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/usecase/social/SocialSaveTokenUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.usecase.social 2 | 3 | import com.team_ia.domain.repository.SocialRepository 4 | import javax.inject.Inject 5 | 6 | class SocialSaveTokenUseCase @Inject constructor( 7 | private val socialRepository: SocialRepository 8 | ) { 9 | 10 | suspend operator fun invoke( 11 | accessToken: String, 12 | refreshToken: String, 13 | expiredAt: String 14 | ) = 15 | kotlin.runCatching { 16 | socialRepository.saveToken(accessToken, refreshToken, expiredAt) 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /domain/src/main/java/com/team_ia/domain/utils/Result.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain.utils 2 | 3 | sealed class Result{ 4 | object Loading : Result() 5 | object UnLoading : Result() 6 | data class Success(val data: T) : Result() 7 | data class Unauthorized(val throwable: Throwable) : Result() 8 | data class Error(val throwable: Throwable) : Result() 9 | } 10 | -------------------------------------------------------------------------------- /domain/src/test/java/com/team_ia/domain/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.domain 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Kotlin code style for this project: "official" or "obsolete": 19 | kotlin.code.style=official 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Idea-Archive/Idea-Archive-Android/bb44bca1d4c86987563fe15c645b254775c88dd9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Mar 27 21:06:50 KST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /presentation/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /presentation/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle.kts. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /presentation/src/androidTest/java/com/team_ia/idea_archive_android/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.team_ia.idea_archive_android", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/IAApplication.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android 2 | 3 | import android.app.Application 4 | import dagger.hilt.android.HiltAndroidApp 5 | 6 | @HiltAndroidApp 7 | class IAApplication: Application() -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/adapter/CategoryListAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.adapter 2 | 3 | import android.content.Context 4 | import android.view.LayoutInflater 5 | import android.view.ViewGroup 6 | import androidx.recyclerview.widget.ListAdapter 7 | import androidx.recyclerview.widget.RecyclerView 8 | import com.team_ia.domain.model.PostModel 9 | import com.team_ia.idea_archive_android.databinding.ItemCategoryBinding 10 | 11 | class CategoryListAdapter(private val categoryList: List?) : RecyclerView.Adapter() { 12 | 13 | class CategoryListViewHolder(val binding: ItemCategoryBinding) : RecyclerView.ViewHolder(binding.root) { 14 | 15 | fun bind(data: List?, position: Int){ 16 | if (position != 0) { 17 | binding.tvCategory.text = data?.get(position) 18 | } 19 | } 20 | 21 | } 22 | 23 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CategoryListViewHolder { 24 | val binding = ItemCategoryBinding.inflate(LayoutInflater.from(parent.context), parent, false) 25 | return CategoryListViewHolder(binding) 26 | } 27 | 28 | override fun getItemCount(): Int { 29 | val limit = 3 30 | return categoryList?.size?.coerceAtMost(limit) ?: 3 31 | } 32 | 33 | override fun onBindViewHolder(holder: CategoryListViewHolder, position: Int) { 34 | holder.bind(categoryList?.get(position)?.category, position) 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/adapter/MajorFilterListAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.adapter 2 | 3 | import android.view.LayoutInflater 4 | import android.view.ViewGroup 5 | import androidx.recyclerview.widget.RecyclerView 6 | import com.team_ia.idea_archive_android.databinding.ItemMajorFilterBinding 7 | 8 | class MajorFilterListAdapter(private val majorFilterList: List?) : RecyclerView.Adapter() { 9 | class MajorFilterViewHolder(val binding: ItemMajorFilterBinding) : RecyclerView.ViewHolder(binding.root){ 10 | fun bind(data: List?, position: Int){ 11 | binding.btnMajorFilter.text = data?.get(position).toString() 12 | } 13 | } 14 | 15 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MajorFilterViewHolder { 16 | val binding = ItemMajorFilterBinding.inflate(LayoutInflater.from(parent.context), parent, false) 17 | return MajorFilterViewHolder(binding) 18 | } 19 | 20 | override fun getItemCount(): Int { 21 | return majorFilterList?.size ?: 0 22 | } 23 | 24 | override fun onBindViewHolder(holder: MajorFilterViewHolder, position: Int) { 25 | holder.bind(majorFilterList, position) 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/adapter/viewpager/MyViewPagerAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.adapter.viewpager 2 | 3 | import androidx.fragment.app.Fragment 4 | import androidx.fragment.app.FragmentActivity 5 | import androidx.viewpager2.adapter.FragmentStateAdapter 6 | 7 | class MyViewPagerAdapter(fragmentActivity: FragmentActivity) : FragmentStateAdapter(fragmentActivity) { 8 | var fragmentList: ArrayList = ArrayList() 9 | 10 | override fun getItemCount(): Int { 11 | return fragmentList.size 12 | } 13 | 14 | override fun createFragment(position: Int): Fragment { 15 | return fragmentList[position] 16 | } 17 | 18 | fun addFragment(fragment: Fragment){ 19 | fragmentList.add(fragment) 20 | notifyItemInserted(fragmentList.size - 1) 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/base/BaseActivity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.base 2 | 3 | import android.os.Bundle 4 | import android.widget.Toast 5 | import androidx.annotation.LayoutRes 6 | import androidx.appcompat.app.AppCompatActivity 7 | import androidx.databinding.DataBindingUtil 8 | import androidx.databinding.ViewDataBinding 9 | 10 | abstract class BaseActivity( 11 | @LayoutRes private val layoutId: Int 12 | ) : AppCompatActivity() { 13 | protected lateinit var binding: B 14 | 15 | override fun onCreate(savedInstanceState: Bundle?) { 16 | super.onCreate(savedInstanceState) 17 | 18 | binding = DataBindingUtil.setContentView(this, layoutId) 19 | binding.lifecycleOwner = this 20 | 21 | createView() 22 | observeEvent() 23 | } 24 | 25 | abstract fun createView() 26 | 27 | abstract fun observeEvent() 28 | 29 | protected fun shortToast(msg: String){ 30 | Toast.makeText(this, msg, Toast.LENGTH_SHORT).show() 31 | } 32 | 33 | protected fun longToast(msg: String){ 34 | Toast.makeText(this, msg, Toast.LENGTH_LONG).show() 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/base/BaseFragment.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.base 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import android.widget.Toast 8 | import androidx.annotation.LayoutRes 9 | import androidx.databinding.DataBindingUtil 10 | import androidx.databinding.ViewDataBinding 11 | import androidx.fragment.app.Fragment 12 | 13 | abstract class BaseFragment( 14 | @LayoutRes private val layoutRes: Int 15 | ) : Fragment() { 16 | val binding get() = mBinding!! 17 | private var mBinding: B ?= null 18 | 19 | var savedInstanceState: Bundle? = null 20 | 21 | override fun onCreateView( 22 | inflater: LayoutInflater, 23 | container: ViewGroup?, 24 | savedInstanceState: Bundle? 25 | ): View? { 26 | this.savedInstanceState = savedInstanceState 27 | mBinding = DataBindingUtil.inflate(inflater, layoutRes, container, false) 28 | createView() 29 | observeEvent() 30 | return binding.root 31 | } 32 | 33 | abstract fun createView() 34 | 35 | abstract fun observeEvent() 36 | 37 | protected fun shortToast(msg: String){ 38 | Toast.makeText(context, msg, Toast.LENGTH_SHORT).show() 39 | } 40 | 41 | protected fun longToast(msg: String){ 42 | Toast.makeText(context, msg, Toast.LENGTH_LONG).show() 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/main/FindPasswordActivity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.main 2 | 3 | class FindPasswordActivity { 4 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/profile/EditProfileActivity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.profile 2 | 3 | import android.content.Intent 4 | import android.view.View 5 | import com.team_ia.domain.entity.MemberEntity 6 | import com.team_ia.idea_archive_android.R 7 | import com.team_ia.idea_archive_android.databinding.ActivityEditProfileBinding 8 | import com.team_ia.idea_archive_android.ui.base.BaseActivity 9 | import dagger.hilt.android.AndroidEntryPoint 10 | 11 | @AndroidEntryPoint 12 | class EditProfileActivity : BaseActivity(R.layout.activity_edit_profile) { 13 | private var profile: MemberEntity? = null 14 | 15 | override fun createView() { 16 | onClick() 17 | profile = intent.getSerializableExtra("profile") as MemberEntity 18 | } 19 | 20 | override fun observeEvent() { 21 | } 22 | 23 | fun onClickPageButton(view: View) { 24 | finish() 25 | } 26 | 27 | private fun onClick() { 28 | binding.btnEditProfile.setOnClickListener { 29 | startActivity(Intent(this, EditProfileInfoActivity::class.java).putExtra("profile", profile)) 30 | } 31 | binding.btnEditPassword.setOnClickListener { 32 | startActivity(Intent(this, EditPasswordActivity::class.java).putExtra("profile", profile)) 33 | } 34 | binding.btnWithdrawal.setOnClickListener { 35 | startActivity(Intent(this, WithdrawalActivity::class.java)) 36 | } 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/profile/LikedFragment.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.profile 2 | 3 | import androidx.fragment.app.viewModels 4 | import com.team_ia.idea_archive_android.R 5 | import com.team_ia.idea_archive_android.adapter.PostListAdapter 6 | import com.team_ia.idea_archive_android.databinding.FragmentLikedBinding 7 | import com.team_ia.idea_archive_android.ui.base.BaseFragment 8 | import com.team_ia.idea_archive_android.ui.viewmodel.MyViewModel 9 | import com.team_ia.idea_archive_android.utils.ItemDecorator 10 | import dagger.hilt.android.AndroidEntryPoint 11 | 12 | @AndroidEntryPoint 13 | class LikedFragment : BaseFragment(R.layout.fragment_liked) { 14 | private val viewModel by viewModels() 15 | private lateinit var adapter: PostListAdapter 16 | override fun createView() { 17 | initRecyclerView() 18 | } 19 | 20 | override fun observeEvent() { 21 | } 22 | 23 | private fun initRecyclerView() { 24 | adapter = PostListAdapter(viewModel.postData.value) 25 | binding.rvLiked.addItemDecoration(ItemDecorator(8)) 26 | binding.rvLiked.adapter = adapter 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/profile/MyFragment.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.profile 2 | 3 | import androidx.fragment.app.viewModels 4 | import com.team_ia.idea_archive_android.R 5 | import com.team_ia.idea_archive_android.adapter.PostListAdapter 6 | import com.team_ia.idea_archive_android.databinding.FragmentMyBinding 7 | import com.team_ia.idea_archive_android.ui.base.BaseFragment 8 | import com.team_ia.idea_archive_android.ui.viewmodel.MyViewModel 9 | import com.team_ia.idea_archive_android.utils.ItemDecorator 10 | import dagger.hilt.android.AndroidEntryPoint 11 | 12 | @AndroidEntryPoint 13 | class MyFragment : BaseFragment(R.layout.fragment_my) { 14 | private val viewModel by viewModels() 15 | private lateinit var adapter: PostListAdapter 16 | 17 | override fun createView() { 18 | initRecyclerView() 19 | } 20 | 21 | override fun observeEvent() { 22 | } 23 | 24 | private fun initRecyclerView() { 25 | adapter = PostListAdapter(viewModel.postData.value) 26 | binding.rvMyPost.addItemDecoration(ItemDecorator(8)) 27 | binding.rvMyPost.adapter = adapter 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/profile/PostItem.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.profile 2 | 3 | import androidx.activity.viewModels 4 | import com.team_ia.domain.model.PostModel 5 | import com.team_ia.idea_archive_android.R 6 | import com.team_ia.idea_archive_android.adapter.CategoryListAdapter 7 | import com.team_ia.idea_archive_android.databinding.ItemPostBinding 8 | import com.team_ia.idea_archive_android.ui.base.BaseActivity 9 | import com.team_ia.idea_archive_android.ui.viewmodel.MyViewModel 10 | 11 | class PostItem(private val data: PostModel) : BaseActivity(R.layout.item_post) { 12 | private lateinit var adapter: CategoryListAdapter 13 | private val viewModel by viewModels() 14 | 15 | 16 | override fun createView() { 17 | } 18 | 19 | override fun observeEvent() { 20 | TODO("Not yet implemented") 21 | } 22 | 23 | fun initRecycler() { 24 | adapter = CategoryListAdapter(viewModel.postData.value) 25 | binding.rvCategory.adapter = adapter 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/profile/WithdrawalModal.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.profile 2 | 3 | import android.app.AlertDialog 4 | import android.content.Context 5 | import android.graphics.Color 6 | import android.graphics.drawable.ColorDrawable 7 | import android.os.Bundle 8 | import com.team_ia.idea_archive_android.databinding.WithdrawalMemberModalBinding 9 | 10 | class WithdrawalModal(context: Context) : AlertDialog(context) { 11 | 12 | lateinit var binding: WithdrawalMemberModalBinding 13 | 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | binding = WithdrawalMemberModalBinding.inflate(layoutInflater) 17 | viewSetting() 18 | } 19 | 20 | private fun viewSetting() = with(binding) { 21 | setCancelable(true) 22 | window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) 23 | btnQuit.setOnClickListener { 24 | cancel() 25 | } 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/signup/AuthenticationFailedActivity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.signup 2 | 3 | import android.content.Intent 4 | import com.team_ia.idea_archive_android.R 5 | import com.team_ia.idea_archive_android.databinding.ActivityAuthenticationFailedPageBinding 6 | import com.team_ia.idea_archive_android.ui.base.BaseActivity 7 | import com.team_ia.idea_archive_android.ui.login.LoginActivity 8 | import dagger.hilt.android.AndroidEntryPoint 9 | 10 | @AndroidEntryPoint 11 | class AuthenticationFailedActivity: BaseActivity(R.layout.activity_authentication_failed_page){ 12 | override fun createView() { 13 | binding.btnGoBackToLoginPage.setOnClickListener { 14 | startActivity(Intent(this, LoginActivity::class.java)) 15 | finish() 16 | } 17 | } 18 | 19 | override fun observeEvent() { 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/signup/AuthenticationSuccessActivity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.signup 2 | 3 | import android.content.Intent 4 | import com.team_ia.idea_archive_android.R 5 | import com.team_ia.idea_archive_android.databinding.ActivityAuthenticationSuccessPageBinding 6 | import com.team_ia.idea_archive_android.ui.base.BaseActivity 7 | import com.team_ia.idea_archive_android.ui.login.LoginActivity 8 | 9 | 10 | 11 | class AuthenticationSuccessActivity : BaseActivity (R.layout.activity_authentication_success_page) { 12 | override fun createView() { 13 | binding.btnGoBackToLoginPage.setOnClickListener { 14 | startActivity(Intent(this, LoginActivity::class.java)) 15 | finish() 16 | } 17 | } 18 | 19 | override fun observeEvent() { 20 | 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/signup/SignUpActivity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.signup 2 | 3 | import com.team_ia.idea_archive_android.R 4 | import com.team_ia.idea_archive_android.databinding.ActivitySignUpPageBinding 5 | import com.team_ia.idea_archive_android.ui.base.BaseActivity 6 | import dagger.hilt.android.AndroidEntryPoint 7 | 8 | @AndroidEntryPoint 9 | class SignUpActivity : BaseActivity(R.layout.activity_sign_up_page) { 10 | override fun createView() { 11 | 12 | } 13 | 14 | override fun observeEvent() { 15 | 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/viewmodel/ChangePasswordViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.viewmodel 2 | 3 | import androidx.lifecycle.LiveData 4 | import androidx.lifecycle.MutableLiveData 5 | import androidx.lifecycle.ViewModel 6 | import androidx.lifecycle.viewModelScope 7 | import com.team_ia.domain.param.FindPasswordParam 8 | import com.team_ia.domain.usecase.auth.SaveTokenUseCase 9 | import com.team_ia.domain.usecase.member.FindPasswordUseCase 10 | import com.team_ia.idea_archive_android.utils.Event 11 | import com.team_ia.idea_archive_android.utils.errorHandling 12 | import dagger.hilt.android.lifecycle.HiltViewModel 13 | import kotlinx.coroutines.launch 14 | import javax.inject.Inject 15 | 16 | @HiltViewModel 17 | class ChangePasswordViewModel @Inject constructor( 18 | private val findPasswordUseCase: FindPasswordUseCase, 19 | private val saveTokenUseCase: SaveTokenUseCase 20 | ) : ViewModel() { 21 | 22 | private val _changePasswordInfo = MutableLiveData() 23 | val changePasswordInfo: LiveData get() = _changePasswordInfo 24 | 25 | fun changePassword(password: String, newPassword: String) { 26 | viewModelScope.launch { 27 | findPasswordUseCase( 28 | FindPasswordParam( 29 | password, 30 | newPassword 31 | ) 32 | ).onSuccess { 33 | _changePasswordInfo.value = Event.Success 34 | }.onFailure { 35 | _changePasswordInfo.value = 36 | it.errorHandling(unauthorizedAction = { saveTokenUseCase() }) 37 | } 38 | } 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/viewmodel/GoogleSocialLoginViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.viewmodel 2 | 3 | import androidx.lifecycle.ViewModel 4 | import androidx.lifecycle.viewModelScope 5 | import com.team_ia.domain.param.SocialLoginParam 6 | import com.team_ia.domain.usecase.auth.SaveTokenUseCase 7 | import com.team_ia.domain.usecase.social.GoogleLoginUseCase 8 | import com.team_ia.idea_archive_android.utils.Event 9 | import com.team_ia.idea_archive_android.utils.MutableEventFlow 10 | import com.team_ia.idea_archive_android.utils.asEvetFlow 11 | import com.team_ia.idea_archive_android.utils.errorHandling 12 | import dagger.hilt.android.lifecycle.HiltViewModel 13 | import kotlinx.coroutines.launch 14 | import javax.inject.Inject 15 | 16 | 17 | @HiltViewModel 18 | class GoogleSocialLoginViewModel @Inject constructor( 19 | private val googleLoginUseCase: GoogleLoginUseCase, 20 | private val saveTokenUseCase: SaveTokenUseCase 21 | ) : ViewModel() { 22 | private val _eventFlow = MutableEventFlow() 23 | val eventFlow = _eventFlow.asEvetFlow() 24 | 25 | fun checkAuthorizationCode(authorizationCode: String) = viewModelScope.launch { 26 | googleLoginUseCase( 27 | socialLoginParam = SocialLoginParam(authorizationCode) 28 | ).onSuccess { 29 | saveTokenUseCase(it.accessToken, it.refreshToken, it.expiredAt) 30 | event(Event.Success) 31 | }.onFailure { 32 | event(it.errorHandling(notFoundAction = { 33 | saveTokenUseCase() 34 | } 35 | )) 36 | } 37 | 38 | } 39 | 40 | private fun event(event: Event) = viewModelScope.launch { 41 | _eventFlow.emit(event) 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/ui/write/WriteActivity.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.ui.write 2 | 3 | import com.team_ia.idea_archive_android.R 4 | import com.team_ia.idea_archive_android.databinding.ActivityWritePageBinding 5 | import com.team_ia.idea_archive_android.ui.base.BaseActivity 6 | import dagger.hilt.android.AndroidEntryPoint 7 | 8 | @AndroidEntryPoint 9 | class WriteActivity : BaseActivity(R.layout.activity_write_page) { 10 | override fun createView() { 11 | 12 | } 13 | 14 | override fun observeEvent() { 15 | 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/utils/Event.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.utils 2 | 3 | 4 | sealed class Event ( 5 | ) { 6 | 7 | object Loading: Event() 8 | 9 | /** 10 | * 성공 11 | */ 12 | object Success: Event() 13 | 14 | /** 15 | * 400번 요청이 올바르지 않은 경우 16 | */ 17 | object BadRequest: Event() 18 | 19 | /** 20 | * 401번 비인증 요청 21 | */ 22 | object Unauthorized: Event() 23 | 24 | /** 25 | * 403번 권한이 없음 26 | */ 27 | object ForBidden: Event() 28 | 29 | /** 30 | * 404 찾을 수 없는 경우 31 | */ 32 | object NotFound: Event() 33 | 34 | /** 35 | * 406 맞는 규격이 없는 경우 36 | */ 37 | object NotAcceptable: Event() 38 | 39 | /** 40 | * 408 요청이 너무 오래 걸리는 경우 41 | */ 42 | object TimeOut: Event() 43 | 44 | /** 45 | * 409 권한이 없을 때 46 | */ 47 | object Conflict: Event() 48 | 49 | /** 50 | * 50X 서버에러 51 | */ 52 | object Server: Event() 53 | 54 | /** 55 | * 예상치 못한 에러 56 | */ 57 | object UnKnown: Event() 58 | } 59 | 60 | -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/utils/ItemDecorator.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.utils 2 | 3 | import android.graphics.Rect 4 | import android.view.View 5 | import androidx.recyclerview.widget.RecyclerView 6 | 7 | class ItemDecorator(private val divHeight: Int) : RecyclerView.ItemDecoration() { 8 | 9 | override fun getItemOffsets( 10 | outRect: Rect, 11 | view: View, 12 | parent: RecyclerView, 13 | state: RecyclerView.State 14 | ) { 15 | super.getItemOffsets(outRect, view, parent, state) 16 | val position = parent.getChildAdapterPosition(view) 17 | if(position != 0) { 18 | outRect.top = divHeight 19 | } 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/utils/KeyboardEvent.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.utils 2 | 3 | import android.app.Activity 4 | import android.widget.EditText 5 | import androidx.core.view.WindowInsetsCompat 6 | import androidx.core.view.WindowInsetsControllerCompat 7 | 8 | fun keyBoardHide(context: Activity, viewList: List){ 9 | viewList.forEach{ view -> 10 | view.clearFocus() 11 | } 12 | val window = context.window 13 | WindowInsetsControllerCompat(window, window.decorView).hide(WindowInsetsCompat.Type.ime()) 14 | } 15 | 16 | fun keyBoardShow(context: Activity, view: EditText) { 17 | view.requestFocus() 18 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/utils/MutableEventFlow.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.utils 2 | 3 | 4 | import kotlinx.coroutines.flow.Flow 5 | import kotlinx.coroutines.flow.FlowCollector 6 | import kotlinx.coroutines.flow.MutableSharedFlow 7 | import java.util.concurrent.atomic.AtomicBoolean 8 | 9 | interface EventFlow: Flow { 10 | companion object { 11 | const val DEFAULT_REPLAY: Int = 3 12 | } 13 | } 14 | 15 | interface MutableEventFlow: EventFlow, FlowCollector 16 | 17 | @Suppress("FuntionName") 18 | fun MutableEventFlow( 19 | replay: Int = EventFlow.DEFAULT_REPLAY 20 | ): MutableEventFlow = EventFlowImpl(replay) 21 | 22 | fun MutableEventFlow.asEvetFlow(): EventFlow = ReadOnlyEventFlow(this) 23 | 24 | private class ReadOnlyEventFlow(flow: EventFlow): EventFlow by flow 25 | 26 | private class EventFlowImpl( 27 | replay: Int 28 | ): MutableEventFlow{ 29 | private val flow: MutableSharedFlow> = MutableSharedFlow(replay = replay) 30 | 31 | override suspend fun collect(collector: FlowCollector) = flow 32 | .collect{slot -> 33 | if(!slot.markConsumed()){ 34 | collector.emit(slot.value) 35 | } 36 | } 37 | 38 | override suspend fun emit(value: T) { 39 | flow.emit(EventFlowSlot(value)) 40 | } 41 | 42 | } 43 | 44 | private class EventFlowSlot (val value: T){ 45 | private val consumed: AtomicBoolean = AtomicBoolean(false) 46 | 47 | fun markConsumed(): Boolean = consumed.getAndSet(true) 48 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/utils/extension/ButtonExtension.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.utils.extension 2 | 3 | import android.widget.Button 4 | 5 | fun Button.changeAtivatedWithEnabled(activiated: Boolean){ 6 | isActivated = activiated 7 | isEnabled = isActivated 8 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/utils/extension/EditTextExtension.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.utils.extension 2 | 3 | import android.text.Editable 4 | import android.text.TextWatcher 5 | import android.widget.EditText 6 | import androidx.core.widget.addTextChangedListener 7 | 8 | fun EditText.setOnTextChanged(action:(p0: CharSequence?, p1:Int,p2:Int,p3:Int)-> Unit){ 9 | this.addTextChangedListener(object: TextWatcher { 10 | override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int,p3: Int) = Unit 11 | override fun afterTextChanged(p0: Editable?) = Unit 12 | 13 | override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int){ 14 | action(p0, p1, p2, p3) 15 | } 16 | }) 17 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/utils/extension/LifeCycleOwnerExtension.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.utils.extension 2 | 3 | import androidx.lifecycle.Lifecycle 4 | import androidx.lifecycle.LifecycleOwner 5 | import androidx.lifecycle.lifecycleScope 6 | import androidx.lifecycle.repeatOnLifecycle 7 | import kotlinx.coroutines.CoroutineScope 8 | import kotlinx.coroutines.launch 9 | 10 | fun LifecycleOwner.repeatOnStart(block: suspend CoroutineScope.()-> Unit){ 11 | lifecycleScope.launch { 12 | lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED, block) 13 | } 14 | } -------------------------------------------------------------------------------- /presentation/src/main/java/com/team_ia/idea_archive_android/utils/formatTimeDeference.kt: -------------------------------------------------------------------------------- 1 | package com.team_ia.idea_archive_android.utils 2 | 3 | import java.time.LocalDateTime 4 | import java.time.format.DateTimeFormatter 5 | import java.time.temporal.ChronoUnit 6 | 7 | fun String.formatTimeDifference(): String { 8 | val regTime = this 9 | val currentDateTime = LocalDateTime.now() 10 | val formatter = DateTimeFormatter.ISO_DATE_TIME 11 | val regDateTime = LocalDateTime.parse(regTime, formatter) 12 | 13 | val diffMinutes = ChronoUnit.MINUTES.between(regDateTime, currentDateTime) 14 | if (diffMinutes < 1) { 15 | return "방금 전" 16 | } else if (diffMinutes < 60) { 17 | return "${diffMinutes}분 전" 18 | } 19 | 20 | val diffHours = ChronoUnit.HOURS.between(regDateTime, currentDateTime) 21 | if (diffHours < 24) { 22 | return "${diffHours}시간 전" 23 | } 24 | 25 | val diffDays = ChronoUnit.DAYS.between(regDateTime, currentDateTime) 26 | if (diffDays < 30) { 27 | return "${diffDays}일 전" 28 | } 29 | 30 | val diffMonths = (diffDays / 30).toInt() 31 | if (diffMonths < 12) { 32 | return "${diffMonths}달 전" 33 | } 34 | 35 | val diffYears = (diffDays / 365).toInt() 36 | return "${diffYears}년 전" 37 | 38 | } 39 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_bottom_nav.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_category_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 8 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_comment_send_btn.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_confirm.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_content_textview.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_default_profile.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_edittext.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_filter_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_floatingbutton.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_go_to.xml: -------------------------------------------------------------------------------- 1 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_incorrect_edittext.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_input_auth_code_edit_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_item_post.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_quit.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_see_more_ibtn.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_share_btn.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_title_edittext.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_withdrawal_btn.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_withdrawal_modal.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_write_post.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/bg_write_post_bubble.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 12 | 15 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/btn_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/ibtn_back_button.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/ic_add.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/ic_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/ic_comment.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/ic_empty_heart.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/ic_full_heart.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/ic_main_page_menu_bar.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 20 | 27 | 28 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/ic_notice.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/ic_search_button.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/lg_authentication_failed_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/lg_authentication_success_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/lg_github.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/lg_google.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/menu_entire_post_active.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/menu_entire_post_inactive.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/menu_feedback_post_active.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/menu_feedback_post_inactive.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/menu_idea_post_active.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/menu_idea_post_inactive.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/menu_job_opening_post_active.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/menu_job_opening_post_inactive.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/selector_nav_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/selector_nav_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/selector_nav_color_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/selector_nav_text_liked.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/selector_nav_text_my_post.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/src_write_post.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /presentation/src/main/res/drawable/v_vertical_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /presentation/src/main/res/font/font.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 11 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /presentation/src/main/res/font/pretendard_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Idea-Archive/Idea-Archive-Android/bb44bca1d4c86987563fe15c645b254775c88dd9/presentation/src/main/res/font/pretendard_bold.ttf -------------------------------------------------------------------------------- /presentation/src/main/res/font/pretendard_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Idea-Archive/Idea-Archive-Android/bb44bca1d4c86987563fe15c645b254775c88dd9/presentation/src/main/res/font/pretendard_medium.ttf -------------------------------------------------------------------------------- /presentation/src/main/res/font/pretendard_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Idea-Archive/Idea-Archive-Android/bb44bca1d4c86987563fe15c645b254775c88dd9/presentation/src/main/res/font/pretendard_regular.ttf -------------------------------------------------------------------------------- /presentation/src/main/res/font/pretendard_semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Idea-Archive/Idea-Archive-Android/bb44bca1d4c86987563fe15c645b254775c88dd9/presentation/src/main/res/font/pretendard_semibold.ttf -------------------------------------------------------------------------------- /presentation/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | -------------------------------------------------------------------------------- /presentation/src/main/res/layout/activity_sign_up_page.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /presentation/src/main/res/layout/activity_write_page.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /presentation/src/main/res/layout/fragment_liked.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /presentation/src/main/res/layout/fragment_my.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /presentation/src/main/res/layout/item_category.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /presentation/src/main/res/layout/item_major_filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 |