-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
38 changed files
with
947 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
data/src/main/java/com/going/data/dto/request/TodoChangeRequestDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.going.data.dto.request | ||
|
||
import com.going.domain.entity.request.TodoChangeRequestModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TodoChangeRequestDto( | ||
@SerialName("title") | ||
val title: String, | ||
@SerialName("endDate") | ||
val endDate: String, | ||
@SerialName("allocators") | ||
val allocators: List<Long>, | ||
@SerialName("memo") | ||
val memo: String?, | ||
@SerialName("secret") | ||
val secret: Boolean | ||
) | ||
|
||
fun TodoChangeRequestModel.toTodoChangeRequestDto(): TodoChangeRequestDto = | ||
TodoChangeRequestDto(title, endDate, allocators, memo, secret) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
data/src/main/java/com/going/data/dto/response/TodoListAllocatorResponseDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.going.data.dto.response | ||
|
||
import com.going.domain.entity.response.TodoListAllocatorModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TodoListAllocatorResponseDto( | ||
@SerialName("name") | ||
val name: String, | ||
@SerialName("isOwner") | ||
val isOwner: Boolean | ||
) { | ||
fun toTodoListAllocatorModel() = | ||
TodoListAllocatorModel(name, isOwner) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
domain/src/main/kotlin/com/going/domain/entity/request/TodoChangeRequestModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.going.domain.entity.request | ||
|
||
data class TodoChangeRequestModel( | ||
val title: String, | ||
val endDate: String, | ||
val allocators: List<Long>, | ||
val memo: String?, | ||
val secret: Boolean | ||
) |
6 changes: 4 additions & 2 deletions
6
domain/src/main/kotlin/com/going/domain/entity/response/TodoAllocatorModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package com.going.domain.entity.response | ||
|
||
data class TodoAllocatorModel( | ||
val participantId: Long, | ||
val name: String, | ||
val isOwner: Boolean | ||
) | ||
val isOwner: Boolean, | ||
var isAllocated: Boolean | ||
) |
6 changes: 6 additions & 0 deletions
6
domain/src/main/kotlin/com/going/domain/entity/response/TodoListAllocatorModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.going.domain.entity.response | ||
|
||
data class TodoListAllocatorModel( | ||
val name: String, | ||
val isOwner: Boolean | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
presentation/src/main/java/com/going/presentation/todo/change/TodoAllocatorAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.going.presentation.todo.change | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.ListAdapter | ||
import com.going.domain.entity.response.TodoAllocatorModel | ||
import com.going.presentation.databinding.ItemTodoCreateNameBinding | ||
import com.going.ui.util.ItemDiffCallback | ||
|
||
class TodoAllocatorAdapter( | ||
private val itemClick: (Int) -> Unit | ||
) : ListAdapter<TodoAllocatorModel, TodoAllocatorViewHolder>(diffUtil) { | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TodoAllocatorViewHolder { | ||
val binding: ItemTodoCreateNameBinding = | ||
ItemTodoCreateNameBinding.inflate(LayoutInflater.from(parent.context), parent, false) | ||
return TodoAllocatorViewHolder(binding, itemClick) | ||
} | ||
|
||
override fun onBindViewHolder(holder: TodoAllocatorViewHolder, position: Int) { | ||
holder.onBind(getItem(position), position) | ||
} | ||
|
||
companion object { | ||
private val diffUtil = ItemDiffCallback<TodoAllocatorModel>( | ||
onItemsTheSame = { old, new -> old.participantId == new.participantId }, | ||
onContentsTheSame = { old, new -> old == new }, | ||
) | ||
} | ||
} |
Oops, something went wrong.