diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md new file mode 100644 index 0000000..8727937 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -0,0 +1,15 @@ +--- +name: Issue template +about: 이슈 템플릿 +title: '' +labels: '' +assignees: '' + +--- + +ISSUE +- + +To-Do +- [ ] +- [ ] diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..ca47e7e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ +관련 이슈 +- closed # + +작업 사진/동영상 (선택) +- + +작업한 내용 +- + +PR 포인트 +- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f476b22 --- /dev/null +++ b/.gitignore @@ -0,0 +1,187 @@ +# Created by https://www.toptal.com/developers/gitignore/api/kotlin,android,androidstudio +# Edit at https://www.toptal.com/developers/gitignore?templates=kotlin,android,androidstudio + +### Android ### +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Log/OS Files +*.log + +# Android Studio generated files and folders +captures/ +.externalNativeBuild/ +.cxx/ +*.apk +output.json + +# IntelliJ +*.iml +.idea/ +misc.xml +deploymentTargetDropDown.xml +render.experimental.xml + +# Keystore files +*.jks +*.keystore + +# Google Services (e.g. APIs or Firebase) +google-services.json + +# Android Profiling +*.hprof + +### Android Patch ### +gen-external-apklibs + +# Replacement of .externalNativeBuild directories introduced +# with Android Studio 3.5. + +### Kotlin ### +# Compiled class file +*.class + +# Log file + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### AndroidStudio ### +# Covers files to be ignored for android development using Android Studio. + +# Built application files +*.ap_ +*.aab + +# Files for the ART/Dalvik VM +*.dex + +# Java class files + +# Generated files +bin/ +gen/ +out/ + +# Gradle files +.gradle + +# Signing files +.signing/ + +# Local configuration file (sdk path, etc) + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files + +# Android Studio +/*/build/ +/*/local.properties +/*/out +/*/*/build +/*/*/production +.navigation/ +*.ipr +*~ +*.swp + +# Keystore files + +# Google Services (e.g. APIs or Firebase) +# google-services.json + +# Android Patch + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild + +# NDK +obj/ + +# IntelliJ IDEA +*.iws +/out/ + +# User-specific configurations +.idea/caches/ +.idea/libraries/ +.idea/shelf/ +.idea/workspace.xml +.idea/tasks.xml +.idea/.name +.idea/compiler.xml +.idea/copyright/profiles_settings.xml +.idea/encodings.xml +.idea/misc.xml +.idea/modules.xml +.idea/scopes/scope_settings.xml +.idea/dictionaries +.idea/vcs.xml +.idea/jsLibraryMappings.xml +.idea/datasources.xml +.idea/dataSources.ids +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml +.idea/assetWizardSettings.xml +.idea/gradle.xml +.idea/jarRepositories.xml +.idea/navEditor.xml + +# Legacy Eclipse project files +.classpath +.project +.cproject +.settings/ + +# Mobile Tools for Java (J2ME) + +# Package Files # + +# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml) + +## Plugin-specific files: + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Mongo Explorer plugin +.idea/mongoSettings.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### AndroidStudio Patch ### + +!/gradle/wrapper/gradle-wrapper.jar + +# End of https://www.toptal.com/developers/gitignore/api/kotlin,android,androidstudio \ No newline at end of file diff --git a/README.md b/README.md index ddc463c..edf9e1e 100644 --- a/README.md +++ b/README.md @@ -1 +1,46 @@ -# Android \ No newline at end of file +# GO SOPT 합동 세미나 모바일 10조 + +## Convention 💚 + +### [Github Convention](https://www.notion.so/go-sopt/Github-Convention-5599c15d7eb44acba2f51c7b6c242428?pvs=4) + +### [브랜치 전략](https://www.notion.so/go-sopt/Branch-e7b86beed63449e4974b9b14965c4693?pvs=4) + +### [코드 컨벤션](https://www.notion.so/go-sopt/a9f5f8bce193487a8116b4cdfc89eeec?v=bc3e59b09ae544e6bcbda22fdca68266&pvs=4) + +## 구현 결과물 💙 + +### 업체 리스트 + + + +### 업체 상세 + + + +### 메뉴 상세 + +menu-detail + +### 리뷰 필터링 목록 + + + +### 리뷰 필터링 바텀시트 + +bottom-sheet + +### 장바구니 + +cart1 + +cart2 + +
+ +## Contributors 💛 + +| 김하정([@hajeong67](https://github.com/hajeong67)) | 윤주영([@jooyyoo](https://github.com/jooyyoo)) | 이하은([@leeeha](https://github.com/leeeha)) | +|:------------------------------------------------------------------------------:|:---------------------------------------------------------------------------:|:---------------------------------------------------------------------------:| +| ||| +| 업체 상세 화면
리뷰 필터링 목록 | 업체 리스트
메뉴상세
리뷰 필터링 바텀시트 | 장바구니 | \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..da3a9c5 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,114 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'kotlin-kapt' + id 'kotlin-parcelize' + id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.21' +} + +Properties properties = new Properties() +properties.load(project.rootProject.file('local.properties').newDataInputStream()) + +android { + namespace 'com.sopt.baemin' + compileSdk 33 + + defaultConfig { + applicationId "com.sopt.baemin" + minSdk 28 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + buildConfigField "String", "BASE_URL", properties["base.url"] + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + buildFeatures { + viewBinding true + dataBinding true + } +} + +dependencies { + // ktx + implementation "androidx.fragment:fragment-ktx:1.5.7" + + // app compat + implementation "androidx.appcompat:appcompat:1.6.1" + + // material + implementation "com.google.android.material:material:1.9.0" + + // constraint layout + implementation "androidx.constraintlayout:constraintlayout:2.1.4" + + // test + testImplementation "junit:junit:4.13.2" + androidTestImplementation "androidx.test.ext:junit:1.1.5" + androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1" + + // lifecycle + implementation "androidx.legacy:legacy-support-v4:1.0.0" + implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion" + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion" + implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion" + + // coroutine + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion" + + // network + implementation "com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11" + implementation "com.google.code.gson:gson:2.10.1" + implementation "com.squareup.retrofit2:retrofit:2.9.0" + + // coil + implementation "io.coil-kt:coil:2.4.0" + + // serialization + implementation "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1" + + // timber + implementation "com.jakewharton.timber:timber:5.0.1" + + // shared preference + implementation "androidx.security:security-crypto-ktx:1.1.0-alpha06" + + // splash screen + implementation "androidx.core:core-splashscreen:1.0.1" + + // Glide + implementation "com.github.bumptech.glide:glide:4.15.1" + kapt "com.github.bumptech.glide:compiler:4.15.1" + + // Sticky Scroll View + implementation "com.github.amarjain07:StickyScrollView:1.0.3" + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.4' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' + + //noinspection GradleCompatible + implementation 'com.android.support:design:28.0.0' + + // Coroutines + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0' + + implementation 'de.hdodenhof:circleimageview:3.1.0' +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/sopt/baemin/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/sopt/baemin/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..299accf --- /dev/null +++ b/app/src/androidTest/java/com/sopt/baemin/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.sopt.baemin + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.assertEquals +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.sopt.baemin", appContext.packageName) + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a690cb5 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/BaeminApplication.kt b/app/src/main/java/com/sopt/baemin/BaeminApplication.kt new file mode 100644 index 0000000..226210f --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/BaeminApplication.kt @@ -0,0 +1,14 @@ +package com.sopt.baemin + +import android.app.Application +import timber.log.Timber + +class BaeminApplication: Application() { + override fun onCreate() { + super.onCreate() + + if(BuildConfig.DEBUG){ + Timber.plant(Timber.DebugTree()) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/api/ApiFactory.kt b/app/src/main/java/com/sopt/baemin/data/api/ApiFactory.kt new file mode 100644 index 0000000..996b376 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/api/ApiFactory.kt @@ -0,0 +1,43 @@ +package com.sopt.baemin.data.api + +import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory +import com.sopt.baemin.BuildConfig.* +import com.sopt.baemin.data.service.* +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.json.Json +import okhttp3.MediaType.Companion.toMediaType +import okhttp3.OkHttpClient +import okhttp3.logging.HttpLoggingInterceptor +import retrofit2.Retrofit + +object ApiFactory { + private const val CONTENT_TYPE = "application/json" + + private val okHttpClient = OkHttpClient.Builder() + .addInterceptor( + HttpLoggingInterceptor().apply { + if (DEBUG) HttpLoggingInterceptor.Level.BODY + else HttpLoggingInterceptor.Level.NONE + }) + .build() + + val retrofit: Retrofit = Retrofit.Builder() + .baseUrl(BASE_URL) + .addConverterFactory(Json.asConverterFactory(CONTENT_TYPE.toMediaType())) + .client(okHttpClient) + .build() + + inline fun create(): T = retrofit.create(T::class.java) + + object ServicePool { + val baeminService = create() + val foodListReviewService = create() + val menuDetailService = create() + + val menuService = create() + val reviewService = create() + + val cartService = create() + + } +} diff --git a/app/src/main/java/com/sopt/baemin/data/entity/FoodDummy.kt b/app/src/main/java/com/sopt/baemin/data/entity/FoodDummy.kt new file mode 100644 index 0000000..8646e9f --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/entity/FoodDummy.kt @@ -0,0 +1,12 @@ +package com.sopt.baemin.data.entity + +import androidx.annotation.DrawableRes + +data class FoodDummy( + val id: Int, + val name: String, + val price: Int, + @DrawableRes + val imgRes: Int, + val num: Int +) \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/entity/StoreDummy.kt b/app/src/main/java/com/sopt/baemin/data/entity/StoreDummy.kt new file mode 100644 index 0000000..f672de2 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/entity/StoreDummy.kt @@ -0,0 +1,10 @@ +package com.sopt.baemin.data.entity + + +data class StoreDummy( + val id: Int, + val name: String, + val deliveryFee: Int, + val foods: List, + val totalPrice: Int, +) diff --git a/app/src/main/java/com/sopt/baemin/data/model/request/RestaurantListRequest.kt b/app/src/main/java/com/sopt/baemin/data/model/request/RestaurantListRequest.kt new file mode 100644 index 0000000..438684a --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/model/request/RestaurantListRequest.kt @@ -0,0 +1,2 @@ +package com.sopt.baemin.data.model.request + diff --git a/app/src/main/java/com/sopt/baemin/data/model/response/BaseResponse.kt b/app/src/main/java/com/sopt/baemin/data/model/response/BaseResponse.kt new file mode 100644 index 0000000..29c6d2c --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/model/response/BaseResponse.kt @@ -0,0 +1,16 @@ +package com.sopt.baemin.data.model.response + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class BaseResponse( + @SerialName("status") + val status: Int, + @SerialName("success") + val success: Boolean, + @SerialName("message") + val message: String, + @SerialName("data") + val data: T? = null +) diff --git a/app/src/main/java/com/sopt/baemin/data/model/response/Food.kt b/app/src/main/java/com/sopt/baemin/data/model/response/Food.kt new file mode 100644 index 0000000..74d1e4b --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/model/response/Food.kt @@ -0,0 +1,13 @@ +package com.sopt.baemin.data.model.response + +import kotlinx.serialization.Serializable + +@Serializable +data class Food( + val foodId: Int, + val foodName: String, + val price: Int, + val foodImageUrl: String, + val foodDescription: String, + val foodCount: Int +) \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/model/response/MenuResponse.kt b/app/src/main/java/com/sopt/baemin/data/model/response/MenuResponse.kt new file mode 100644 index 0000000..e64297b --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/model/response/MenuResponse.kt @@ -0,0 +1,45 @@ +package com.sopt.baemin.data.model.response + +import kotlinx.serialization.Serializable + +@Serializable +data class MenuResponse( + val status: Int, + val success: Boolean, + val message: String, + val data: StoreData +) + +@Serializable +data class StoreData( + val storeInfo: StoreInfomation, + val foods: List +) + +@Serializable +data class StoreInfomation( + val storeId: Int, + val storeTypeId: Int, + val storeType: String, + val storeName: String, + val deliveryTime: String, + val description: String, + val minOrderPrice: Int, + val deliveryFee: Int, + val rate: Double, + val firstImageUrl: String, + val secondImageUrl: String, + val thirdImageUrl: String, + val couponExist: Boolean, + val new: Boolean +) + +@Serializable +data class Foods( + val foodId: Int, + val foodName: String, + val price: Int, + val foodDescription: String, + val foodImageUrl: String, + val best: Boolean +) diff --git a/app/src/main/java/com/sopt/baemin/data/model/response/ResponseGetMenuDetailDto.kt b/app/src/main/java/com/sopt/baemin/data/model/response/ResponseGetMenuDetailDto.kt new file mode 100644 index 0000000..0a61626 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/model/response/ResponseGetMenuDetailDto.kt @@ -0,0 +1,18 @@ +package com.sopt.baemin.data.model.response + +import kotlinx.serialization.* +import kotlinx.serialization.json.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +@Serializable +data class ResponseGetMenuDetailDto ( + @SerialName("status") + val status: Long? = null, + @SerialName("success") + val success: Boolean? = null, + @SerialName("message") + val message: String? = null, + @SerialName("data") + val data: Food? = null +) \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/model/response/ResponseGetReviewFilterFoodDto.kt b/app/src/main/java/com/sopt/baemin/data/model/response/ResponseGetReviewFilterFoodDto.kt new file mode 100644 index 0000000..595ad94 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/model/response/ResponseGetReviewFilterFoodDto.kt @@ -0,0 +1,36 @@ +package com.sopt.baemin.data.model.response + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class ResponseGetReviewFilterFoodDto ( + val status: Long? = null, + val success: Boolean? = null, + val message: String? = null, + val data: ReviewFilterFood? = null +) + +@Serializable +data class ReviewFilterFood ( + val storeInfo: StoreInfo? = null, + val foods: List? = null +) + +@Serializable +data class StoreInfo ( + @SerialName("storeId") + val storeID: Long? = null, + @SerialName("storeTypeId") + val storeTypeID: Long? = null, + val storeType: String? = null, + val storeName: String? = null, + val deliveryTime: String? = null, + val description: String? = null, + val minOrderPrice: Long? = null, + val deliveryFee: Long? = null, + val rate: Double? = null, + val storeImages: List? = null, + val couponExist: Boolean? = null, + val new: Boolean? = null +) \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/model/response/ResponseGetStoreListDto.kt b/app/src/main/java/com/sopt/baemin/data/model/response/ResponseGetStoreListDto.kt new file mode 100644 index 0000000..fbc475e --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/model/response/ResponseGetStoreListDto.kt @@ -0,0 +1,22 @@ +package com.sopt.baemin.data.model.response + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class ResponseGetStoreListDto( + val status: Int, + val success: Boolean, + val message: String, + @SerialName("data") + val stores: List +) + +@Serializable +data class Store( + val storeId: Int, + val storeName: String, + val deliveryFee: Int, + val minOrderPrice: Int, + val foods: List +) \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/model/response/RestaurantListResponse.kt b/app/src/main/java/com/sopt/baemin/data/model/response/RestaurantListResponse.kt new file mode 100644 index 0000000..85f9975 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/model/response/RestaurantListResponse.kt @@ -0,0 +1,52 @@ +package com.sopt.baemin.data.model.response + + +import kotlinx.serialization.* +import kotlinx.serialization.json.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +@Serializable +data class RestaurantListResponse( + val status: Long?, + val success: Boolean?, + val message: String?, + val data: List? +) + +@Serializable +data class Datum( + @SerialName("storeId") + val storeID: Long?, + @SerialName("storeTypeId") + val storeTypeID: Long?, + val storeType: StoreType?, + val storeName: String?, + val deliveryTime: String?, + val description: String?, + val minOrderPrice: Long?, + val deliveryFee: Long?, + val rate: Double?, + val storeImages: List?, + val new: Boolean?, + val couponExist: Boolean? +) + +@Serializable +enum class StoreImage(val value: String) { + @SerialName("url1") + Url1("url1"), + @SerialName("url2") + Url2("url2"), + @SerialName("url3") + Url3("url3"); +} + +@Serializable +enum class StoreType(val value: String) { + @SerialName("카페.디저트") + 카페디저트("카페.디저트"); +} + + + diff --git a/app/src/main/java/com/sopt/baemin/data/model/response/ReviewResponse.kt b/app/src/main/java/com/sopt/baemin/data/model/response/ReviewResponse.kt new file mode 100644 index 0000000..cf84d7e --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/model/response/ReviewResponse.kt @@ -0,0 +1,20 @@ +package com.sopt.baemin.data.model.response + +import kotlinx.serialization.Serializable + +@Serializable +data class ReviewResponse( + val status: Int, + val success: Boolean, + val message: String, + val data: List +) + +@Serializable +data class Review( + val reviewId: Int, + val nickname: String, + val reviewRate: Double, + val reviewImageUrl: String, + val content: String +) diff --git a/app/src/main/java/com/sopt/baemin/data/service/BaeminService.kt b/app/src/main/java/com/sopt/baemin/data/service/BaeminService.kt new file mode 100644 index 0000000..b778b14 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/service/BaeminService.kt @@ -0,0 +1,14 @@ +package com.sopt.baemin.data.service + +import com.sopt.baemin.data.model.response.RestaurantListResponse +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Query + +/*/store?type="type*/ +interface BaeminService { + @GET("store") + fun getRestaurntList( + @Query("type") type:Int + ): Call +} \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/service/CartService.kt b/app/src/main/java/com/sopt/baemin/data/service/CartService.kt new file mode 100644 index 0000000..2514f36 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/service/CartService.kt @@ -0,0 +1,12 @@ +package com.sopt.baemin.data.service + +import com.sopt.baemin.data.model.response.ResponseGetStoreListDto +import retrofit2.http.GET +import retrofit2.http.Path + +interface CartService { + @GET("cart/{userId}") + suspend fun getStoreList( + @Path("userId") userId: Int + ): ResponseGetStoreListDto +} \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/service/FoodListReviewService.kt b/app/src/main/java/com/sopt/baemin/data/service/FoodListReviewService.kt new file mode 100644 index 0000000..b26d0ad --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/service/FoodListReviewService.kt @@ -0,0 +1,11 @@ +package com.sopt.baemin.data.service + +import com.sopt.baemin.data.model.response.ResponseGetReviewFilterFoodDto +import retrofit2.Response +import retrofit2.http.GET + +interface FoodListReviewService { + @GET("/1") + fun getFoodListReview( + ):Response +} \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/service/MenuDetailService.kt b/app/src/main/java/com/sopt/baemin/data/service/MenuDetailService.kt new file mode 100644 index 0000000..270fb77 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/service/MenuDetailService.kt @@ -0,0 +1,11 @@ +package com.sopt.baemin.data.service + +import com.sopt.baemin.data.model.response.ResponseGetMenuDetailDto +import retrofit2.Call +import retrofit2.http.GET + +interface MenuDetailService { + @GET("food/1") + fun getMenuDetail( + ): Call +} \ No newline at end of file diff --git a/app/src/main/java/com/sopt/baemin/data/service/MenuService.kt b/app/src/main/java/com/sopt/baemin/data/service/MenuService.kt new file mode 100644 index 0000000..8bb0efe --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/service/MenuService.kt @@ -0,0 +1,13 @@ +package com.sopt.baemin.data.service + +import com.sopt.baemin.data.model.response.MenuResponse +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Path + +interface MenuService { + @GET("store/{storeId}") + fun getMenu( + @Path("storeId") storeId: Int + ): Call +} diff --git a/app/src/main/java/com/sopt/baemin/data/service/ReviewService.kt b/app/src/main/java/com/sopt/baemin/data/service/ReviewService.kt new file mode 100644 index 0000000..c1905d6 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/data/service/ReviewService.kt @@ -0,0 +1,13 @@ +package com.sopt.baemin.data.service + +import com.sopt.baemin.data.model.response.ReviewResponse +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Path + +interface ReviewService { + @GET("review/{storeId}") + fun getReview( + @Path("storeId") storeId: Int + ): Call +} diff --git a/app/src/main/java/com/sopt/baemin/presentation/bottomsheet/BottomSheetActivity.kt b/app/src/main/java/com/sopt/baemin/presentation/bottomsheet/BottomSheetActivity.kt new file mode 100644 index 0000000..9084907 --- /dev/null +++ b/app/src/main/java/com/sopt/baemin/presentation/bottomsheet/BottomSheetActivity.kt @@ -0,0 +1,52 @@ +package com.sopt.baemin.presentation.bottomsheet + +import android.content.Context +import android.os.Bundle +import android.util.Log +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Button +import android.widget.Toast +import com.google.android.material.bottomsheet.BottomSheetDialogFragment +import com.sopt.baemin.R +import com.sopt.baemin.data.api.ApiFactory +import com.sopt.baemin.databinding.ActivityReviewFilterBinding + +class BottomSheetActivity(context: Context) : BottomSheetDialogFragment() { + private val foodService = ApiFactory.ServicePool.foodListReviewService + private var _binding: ActivityReviewFilterBinding? = null + val binding: ActivityReviewFilterBinding + get() = requireNotNull(_binding) { "이렇게 쓰면 안됩니다~" } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + super.onCreateView(inflater, container, savedInstanceState) + return inflater.inflate(R.layout.activity_review_filter, container, false) + } + + override fun onActivityCreated(savedInstanceState: Bundle?) { + super.onActivityCreated(savedInstanceState) + view?.findViewById