Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT/#143] 판매 취소 API 구현 #144

Merged
merged 9 commits into from
Oct 5, 2024
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ object Constants {
const val compileSdk = 34
const val minSdk = 28
const val targetSdk = 34
const val versionCode = 10
const val versionName = "1.1.3"
const val versionCode = 11
const val versionName = "1.1.4"
}
25 changes: 25 additions & 0 deletions core/src/main/java/co/orange/core/custom/MultiLineTextView.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package co.orange.core.custom

import android.content.Context
import android.graphics.Canvas
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatTextView

class MultiLineTextView
@JvmOverloads
constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0,
) : AppCompatTextView(context, attrs, defStyleAttr) {
// 텍스트가 그려지기 전에 줄바꿈 공백 제거
override fun onDraw(canvas: Canvas) {
val text = text?.toString()?.replace(leadingWhitespaceRegex, "$1")
setText(text)
super.onDraw(canvas)
}

companion object {
private val leadingWhitespaceRegex = Regex("(^|\n)\\s+")
}
}
6 changes: 6 additions & 0 deletions core/src/main/res/drawable/shape_gray1_fill_5_rect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/gray_1" />
<corners
android:radius="5dp" />
</shape>
5 changes: 5 additions & 0 deletions core/src/main/res/drawable/shape_gray2_line_rect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="1dp" />
<stroke android:color="@color/gray_2" />
</shape>
6 changes: 6 additions & 0 deletions core/src/main/res/values/appearances.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,10 @@
<item name="android:paddingVertical">1sp</item>
</style>

<style name="TextAppearance.DDanzi.Regular">
<item name="fontFamily">@font/font_pretendard_regular</item>
<item name="android:textSize">14sp</item>
<item name="android:paddingVertical">2sp</item>
</style>

</resources>
1 change: 1 addition & 0 deletions core/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<color name="button_blue">#3527D7</color>
<color name="hyper_link_blue">#315EFB</color>
<color name="emphasize_red">#FF002E</color>
<color name="discount_red">#E65454</color>
<color name="emphasize_yellow">#FFFDF0</color>

<!-- Transparent -->
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<string name="home_btn_sell">판매하기</string>

<string name="ex_item_title">퓨어 오일 퍼퓸 10 ml 긴제목테스트트트트트</string>
<string name="ex_item_title">푸드장 프리미엄 구이 선물세트1.15kg(부채살+살치살+토시살+소목등심(척아이롤))</string>
<string name="ex_item_real_price"><strike>54,000원</strike></string>
<string name="ex_item_now_price">48,900원</string>
<string name="ex_item_like">999+</string>
Expand Down Expand Up @@ -198,13 +198,16 @@
<string name="sell_info_tv_pay_real_title">판매가</string>
<string name="sell_info_btn_fix_sell">판매 확정하기</string>
<string name="sell_info_tv_pay_total">최종 판매 금액</string>
<string name="sell_info_msg_cancel">판매 취소하기</string>
<string name="sell_info_msg_on_sale">판매 중</string>
<string name="sell_info_msg_ordered">입금 완료</string>
<string name="sell_info_btn_fix">판매 확정하기</string>
<string name="sell_info_btn_shipping">배송 중인 상품입니다.</string>
<string name="sell_delete_success_toast">상품 판매가 취소되었습니다.</string>

<string name="sell_confirm_tv_title">판매 확정</string>
<string name="sell_confirm_tv_subtitle">카카오톡으로 이동해서\n배송지를 입력해주세요!</string>
<string name="sell_confirm_tv_warning">해당 과정에서의 <u>입력 실수 및 누락</u>은 책임지지 않습니다.\n입력 완료 버튼 클릭 시 판매 확정이 완료됩니다.</string>
<string name="sell_confirm_btn_guide"><u>가이드 보러가기</u></string>
<string name="sell_confirm_tv_buyer">구매자 정보</string>
<string name="sell_confirm_tv_option">선택 옵션</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ interface SellDataSource {
suspend fun getBuyerInfo(orderId: String): BaseResponse<SellBuyerInfoDto>

suspend fun patchOrderConfirm(orderId: String): BaseResponse<OrderConfirmDto>

suspend fun deleteSellingItem(itemId: String): BaseResponse<Boolean>
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ data class SellDateSourceImpl
override suspend fun getBuyerInfo(orderId: String): BaseResponse<SellBuyerInfoDto> = sellService.getBuyerInfo(orderId)

override suspend fun patchOrderConfirm(orderId: String): BaseResponse<OrderConfirmDto> = sellService.patchOrderConfirm(orderId)

override suspend fun deleteSellingItem(itemId: String): BaseResponse<Boolean> = sellService.deleteSellingItem(itemId)
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ class SellRepositoryImpl
runCatching {
sellDataSource.patchOrderConfirm(orderId).data.toModel()
}

override suspend fun deleteSellingItem(itemId: String): Result<Boolean> =
runCatching {
sellDataSource.deleteSellingItem(itemId).data
}
}
6 changes: 6 additions & 0 deletions data/src/main/java/co/orange/data/service/SellService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import co.orange.data.dto.response.SellProductDto
import co.orange.data.dto.response.SellRegisteredDto
import co.orange.data.dto.response.SignedUrlDto
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.PATCH
import retrofit2.http.POST
Expand Down Expand Up @@ -52,4 +53,9 @@ interface SellService {
suspend fun patchOrderConfirm(
@Path("id") orderId: String,
): BaseResponse<OrderConfirmDto>

@DELETE("/api/v1/item/{id}")
suspend fun deleteSellingItem(
@Path("id") itemId: String,
): BaseResponse<Boolean>
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ interface SellRepository {
suspend fun getBuyerInfo(orderId: String): Result<SellBuyerInfoModel>

suspend fun patchOrderConfirm(orderId: String): Result<OrderConfirmModel>

suspend fun deleteSellingItem(itemId: String): Result<Boolean>
}
2 changes: 1 addition & 1 deletion feature/buy/src/main/res/layout/activity_buy_finished.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:text="우리집" />

<TextView
<co.orange.core.custom.MultiLineTextView
android:id="@+id/tv_finished_delivery_address"
style="@style/TextAppearance.DDanzi.Body5"
android:layout_width="0dp"
Expand Down
2 changes: 1 addition & 1 deletion feature/buy/src/main/res/layout/activity_buy_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:text="우리집" />

<TextView
<co.orange.core.custom.MultiLineTextView
android:id="@+id/tv_info_delivery_address"
style="@style/TextAppearance.DDanzi.Body5"
android:layout_width="0dp"
Expand Down
2 changes: 1 addition & 1 deletion feature/buy/src/main/res/layout/activity_buy_progress.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:text="김상호" />

<TextView
<co.orange.core.custom.MultiLineTextView
android:id="@+id/tv_delivery_address"
style="@style/TextAppearance.DDanzi.Body5"
android:layout_width="0dp"
Expand Down
Loading
Loading