-
Notifications
You must be signed in to change notification settings - Fork 0
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
π :: (#224) - standard λΆλΆ λ€νΈμν¬ μΈν μ νμ΅λλ€. #225
Conversation
Walkthroughμ΄ λ³κ²½ μ¬νμ Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Warning Rate limit exceeded@audgns10 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 44 seconds before requesting another review. β How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. π¦ How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 10
π§Ή Outside diff range and nitpick comments (19)
core/model/src/main/java/com/school_of_company/model/entity/standard/StandardAttendListResponseEntity.kt (2)
9-10
: μκ° νλμ νμ κ³Ό κ²μ¦ λ‘μ§ κ°μ μ΄ νμν©λλ€.entryTimeκ³Ό leaveTimeμ String νμ μΌλ‘ μ²λ¦¬νκ³ μλλ°, λ€μκ³Ό κ°μ κ°μ μ¬νμ κ³ λ €ν΄λ³΄μκΈ° λ°λλλ€:
- LocalDateTimeμ΄λ ZonedDateTime μ¬μ©μ κ³ λ €ν΄λ³΄μΈμ.
- μκ° νμμ λν μ ν¨μ± κ²μ¬κ° νμν κ² κ°μ΅λλ€.
8-8
: status νλμ μλ―Έλ₯Ό λͺ νν ν΄μ£ΌμΈμ.statusλΌλ νλλͺ μ΄ λΆλͺ νν©λλ€. μ°Έμ μνλ₯Ό λνλ΄λ κ²μ΄λΌλ©΄ isPresentλ isAttendingκ³Ό κ°μ΄ λ ꡬ체μ μΈ μ΄λ¦μ μ¬μ©νλ κ²μ΄ μ’κ² μ΅λλ€.
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/DeleteStandardProgramListUseCase.kt (1)
9-11
: μμΈ μ²λ¦¬λ₯Ό λ ꡬ체μ μΌλ‘ κ°μ ν΄ μ£ΌμΈμ
runCatching
μ μ¬μ©ν κΈ°λ³Έμ μΈ μμΈ μ²λ¦¬λ μ’μ΅λλ€λ§, νΉμ μμΈ μν©(μ: νλ‘κ·Έλ¨μ΄ μ‘΄μ¬νμ§ μλ κ²½μ°)μ λν μ²λ¦¬κ° μμ΅λλ€. ꡬ체μ μΈ μμΈ μ²λ¦¬λ₯Ό μΆκ°νλ κ²μ΄ μ’κ² μ΅λλ€.operator fun invoke(standardProId: Long) = runCatching { repository.deleteStandardProgram(standardProId = standardProId) +}.onFailure { throwable -> + when (throwable) { + is NoSuchElementException -> throw StandardProgramNotFoundException(standardProId) + else -> throw throwable + } }core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramListUseCase.kt (1)
8-10
: KDoc λ¬Έμνκ° νμν©λλ€ν΄λμ€μ λ©μλμ λν λ¬Έμνκ° μμ΅λλ€. μ¬μ© λͺ©μ κ³Ό 맀κ°λ³μμ λν μ€λͺ μ μΆκ°ν΄ μ£ΌμΈμ.
+/** + * νμ€ νλ‘κ·Έλ¨ λͺ©λ‘μ μ‘°ννλ UseCase + * + * @property repository νμ€ νλ‘κ·Έλ¨ μ μ₯μ + */ class StandardProgramListUseCase @Inject constructor( private val repository: StandardRepository )core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramAttendListUseCase.kt (1)
8-10
: μν€ν μ² κ΄μ μμ μ± μ λΆλ¦¬λ₯Ό κ²ν ν΄ μ£ΌμΈμμΆμ λͺ©λ‘ μ‘°νλ λ³λμ λλ©μΈμΌλ‘ λΆλ¦¬νλ κ²μ΄ μ’μ μ μμ΅λλ€.
AttendanceRepository
λ₯Ό μλ‘ λ§λ€μ΄ κ΄λ¦¬νλ κ²μ κ³ λ €ν΄ λ³΄μΈμ.core/domain/src/main/java/com/school_of_company/domain/usecase/standard/RegisterStandardListProgramUseCase.kt (1)
10-18
: μλ¬ μ²λ¦¬ λ° λ‘κΉ κ°μ μ΄ νμν©λλ€.λλμ λ°μ΄ν°λ₯Ό μ²λ¦¬νλ λ§νΌ, λ μμΈν μλ¬ μ²λ¦¬μ λ‘κΉ μ΄ νμν©λλ€:
- κ°λ³ νλͺ© μ€ν¨ μ μ²λ¦¬ λ°©λ²
- λΆλΆ μ±κ³΅μ λν μ²λ¦¬
- μ§ν μν© λͺ¨λν°λ§
core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardAttendListResponseMapper.kt (1)
6-15
: λ μμ μ± κ°μ μ κ³ λ €ν΄λ³΄μΈμ.νμ¬ κ΅¬νμ κ°λ¨νμ§λ§, λ€μκ³Ό κ°μ κ°μ μ¬νμ μ μλ립λλ€:
- κ° νλμ λν λ μ²΄ν¬ μΆκ°
- κΈ°λ³Έκ° μ€μ μ ν΅ν μμ ν λ°μ΄ν° λ³ν
μμ μ½λ:
fun StandardAttendListResponse.toModel(): StandardAttendListResponseEntity = StandardAttendListResponseEntity( - name = this.name, + name = this.name ?: "", - affiliation = this.affiliation, + affiliation = this.affiliation ?: "", - position = this.position, + position = this.position ?: "", // ... λλ¨Έμ§ νλλ€λ λμΌνκ² μ μ© )core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSource.kt (2)
8-15
: μΈν°νμ΄μ€ λ¬Έμν λ° λ§€κ°λ³μ μ΄λ¦ κ°μ μ΄ νμν©λλ€.κ° λ©μλμ λͺ©μ κ³Ό λμμ λͺ νν μ΄ν΄ν μ μλλ‘ KDoc λ¬Έμνλ₯Ό μΆκ°νκ³ , 맀κ°λ³μ μ΄λ¦μ λ ꡬ체μ μΌλ‘ λ³κ²½νλ κ²μ΄ μ’κ² μ΅λλ€.
μμ:
interface StandardDataSource { /** * μλ‘μ΄ νμ€ νλ‘κ·Έλ¨μ λ±λ‘ν©λλ€. * @param expositionId λ°λν κ³ μ μλ³μ * @param programRequest λ±λ‘ν νλ‘κ·Έλ¨ μ 보 * @return λ±λ‘ μ±κ³΅ μ¬λΆ */ fun registerStandardProgram( expositionId: String, programRequest: StandardRequest ): Flow<Unit> // λλ¨Έμ§ λ©μλλ€λ λμΌνκ² λ¬Έμν μ μ© }
9-12
: λ©μλ λ°ν νμ μ λν κ²ν κ° νμν©λλ€.νμ¬ λͺ¨λ λ³κ²½ μμ (λ±λ‘, μμ , μμ )μ΄
Flow<Unit>
μ λ°ννκ³ μμ΅λλ€. μμ κ²°κ³Όλ μνλ₯Ό λ λͺ νν μ λ¬νκΈ° μν΄ λ€μκ³Ό κ°μ κ°μ μ κ³ λ €ν΄λ³΄μΈμ:
- μ±κ³΅/μ€ν¨ μ¬λΆλ₯Ό λνλ΄λ Result νμ μ¬μ©
- μμ μλ£ ν μ λ°μ΄νΈλ λ°μ΄ν° λ°ν
μμ:
fun registerStandardProgram( expoId: String, body: StandardRequest ): Flow<Result<StandardProgramResponse>>core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepository.kt (1)
8-15
: μΈν°νμ΄μ€ μ€κ³κ° κΉλνκ³ μΌκ΄μ±μ΄ μμ΅λλ€!Flowλ₯Ό μ¬μ©ν λΉλκΈ° μ²λ¦¬μ ν¨κ» νμ€ νλ‘κ·Έλ¨ κ΄λ¦¬λ₯Ό μν CRUD μμ μ΄ μ μ μλμ΄ μμ΅λλ€.
λ€λ§, λ€μ μ¬νλ€μ κ³ λ €ν΄λ³΄μλ©΄ μ’μ κ² κ°μ΅λλ€:
- λ©μλμ λν KDoc λ¬Έμν μΆκ°
- κ° λ©μλμ μμΈ μ²λ¦¬ λ°©μ λͺ μ
core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSourceImpl.kt (1)
1-43
: μλ¬ μ²λ¦¬ κ°μ νμνμ¬
performApiRequest
λ₯Ό ν΅ν κΈ°λ³Έμ μΈ μλ¬ μ²λ¦¬λ§ λμ΄μμ΅λλ€. νΉμ λΉμ¦λμ€ μΌμ΄μ€μ λν μΆκ°μ μΈ μλ¬ μ²λ¦¬κ° νμν μ μμ΅λλ€.λ€μ μ¬νλ€μ κ³ λ €ν΄λ³΄μκΈ° λ°λλλ€:
- λ€νΈμν¬ νμμμ μ€μ
- μ¬μλ μ μ± κ΅¬ν
- λΉμ¦λμ€ λ‘μ§ κ΄λ ¨ μμΈ μ²λ¦¬ (μ: μ€λ³΅ λ±λ‘, κΆν λΆμ‘± λ±)
core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepositoryImpl.kt (3)
47-49
: μΊμ± μ λ΅ λμ κ³ λ €
standardProgramList
λ©μλμ κ²½μ° μμ£Ό νΈμΆλ μ μμΌλ―λ‘, μΊμ±μ ν΅ν μ±λ₯ μ΅μ νλ₯Ό κ³ λ €ν΄λ³Ό μ μμ΅λλ€.λ€μκ³Ό κ°μ μΊμ± μ λ΅μ κ³ λ €ν΄λ³΄μΈμ:
- λ©λͺ¨λ¦¬ μΊμ μΆκ°
- μΊμ λ§λ£ μ μ± μ€μ
- μΊμ 무ν¨ν 쑰건 μ μ (μ: νλ‘κ·Έλ¨ μμ /μμ μ)
51-53
: μλ¬ μ²λ¦¬ λ° λ‘κΉ κ°μ νμ
standardProgramAttendList
λ©μλμμ λ°μν μ μλ μμΈ μν©μ λν μ²λ¦¬κ° νμν©λλ€.λ€μκ³Ό κ°μ κ°μ μ μ μν©λλ€:
override fun standardProgramAttendList(standardProId: Long): Flow<List<StandardAttendListResponseEntity>> { + require(standardProId > 0) { "standardProId must be positive" } return dataSource.standardProgramAttendList(standardProId = standardProId) + .catch { exception -> + // λ‘κΉ μΆκ° + throw exception + } .transform { list -> emit(list.map { it.toModel() }) } }
23-31
: λλ λ°μ΄ν° μ²λ¦¬ μ΅μ ν νμ
registerStandardListProgram
λ©μλμμ λλμ λ°μ΄ν°λ₯Ό μ²λ¦¬ν λ λ°μν μ μλ μ±λ₯ μ΄μλ₯Ό κ³ λ €ν΄μΌ ν©λλ€.λ€μ μ¬νλ€μ κ³ λ €ν΄λ³΄μκΈ° λ°λλλ€:
- λ°°μΉ μ²λ¦¬ ν¬κΈ° μ ν
- μ²ν¬ λ¨μ μ²λ¦¬ ꡬν
- μ§ν μν© λͺ¨λν°λ§
feature/expo/src/main/java/com/school_of_company/expo/viewmodel/ExpoViewModel.kt (1)
339-358
: νμ€ νλ‘κ·Έλ¨ λͺ©λ‘ λ±λ‘ λ‘μ§ κ°μ μ΄ νμν©λλ€.νμ¬ κ΅¬νμ κΈ°λ₯μ μΌλ‘λ λ¬Έμ κ° μμΌλ, λ€μκ³Ό κ°μ κ°μ μ¬νμ μ μλ립λλ€:
- μλ¬ μ²λ¦¬λ₯Ό λ ꡬ체μ μΌλ‘ ν νμκ° μμ΅λλ€.
- λΉ λͺ©λ‘μ λν μ ν¨μ± κ²μ¬κ° νμν©λλ€.
λ€μκ³Ό κ°μ΄ μμ νλ κ²μ μ μλ립λλ€:
internal fun registerStandardProgramList( expoId: String, body: List<StandardRequestModel> ) = viewModelScope.launch { + if (body.isEmpty()) { + _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Error( + IllegalArgumentException("νλ‘κ·Έλ¨ λͺ©λ‘μ΄ λΉμ΄μμ΅λλ€.") + ) + return@launch + } _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Loading registerStandardProgramListUseCase( expoId = expoId, body = body ) .onSuccess { it.catch { remoteError -> + val errorMessage = when (remoteError) { + is IllegalStateException -> "λ±λ‘ μ²λ¦¬ μ€ μ€λ₯κ° λ°μνμ΅λλ€" + is IllegalArgumentException -> "μλͺ»λ λ°μ΄ν°κ° μ λ¬λμμ΅λλ€" + else -> "μ μ μλ μ€λ₯κ° λ°μνμ΅λλ€" + } _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Error(remoteError) }.collect { _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Success } } .onFailure { error -> _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Error(error) } }core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardProgramListResponse.kt (2)
10-11
: λ μ§ μ²λ¦¬ λ°©μ κ°μ μ΄ νμν©λλ€
startedAt
κ³ΌendedAt
μ΄ λ¨μ String νμ μΌλ‘ μ²λ¦¬λκ³ μμ΅λλ€. λ μ§ λ°μ΄ν°μ μμ ν μ²λ¦¬λ₯Ό μν΄ μ μ ν λ μ§ νμ μ¬μ©μ κΆμ₯λ립λλ€.λ€μκ³Ό κ°μ κ°μ μ μ μλ립λλ€:
java.time.LocalDateTime
λλjava.time.Instant
μ¬μ©- Moshi μ΄λν°λ₯Ό ν΅ν λ μ§ μ§λ ¬ν/μμ§λ ¬ν μ²λ¦¬
μμ μ½λ:
@JsonClass(generateAdapter = true) data class StandardProgramListResponse( @Json(name = "id") val id: Long?, @Json(name = "title") val title: String?, @Json(name = "startedAt") @ISO8601DateTime val startedAt: Instant?, @Json(name = "endedAt") @ISO8601DateTime val endedAt: Instant?, )
6-7
: ν΄λμ€ λ¬Έμνκ° νμν©λλ€ν΄λμ€μ λͺ©μ κ³Ό μ¬μ© μ¬λ‘λ₯Ό μ€λͺ νλ KDoc λ¬Έμνκ° λλ½λμ΄ μμ΅λλ€.
λ€μκ³Ό κ°μ λ¬Έμνλ₯Ό μΆκ°νλ κ²μ μ μλ립λλ€:
/** * νμ€ νλ‘κ·Έλ¨ λͺ©λ‘ API μλ΅μ μν DTO * * @property id νλ‘κ·Έλ¨ κ³ μ μλ³μ * @property title νλ‘κ·Έλ¨ μ λͺ© * @property startedAt νλ‘κ·Έλ¨ μμ μκ° (ISO-8601 νμ) * @property endedAt νλ‘κ·Έλ¨ μ’ λ£ μκ° (ISO-8601 νμ) */ @JsonClass(generateAdapter = true) data class StandardProgramListResponse(core/network/src/main/java/com/school_of_company/network/mapper/standard/request/StandardRequestMapper.kt (1)
6-11
: KDoc λ¬Έμν μΆκ°λ₯Ό μ μλ립λλ€.ν¨μμ λͺ©μ κ³Ό μ¬μ© μ¬λ‘λ₯Ό λͺ νν νκΈ° μν΄ KDoc λ¬Έμλ₯Ό μΆκ°νλ κ²μ΄ μ’μ κ² κ°μ΅λλ€.
λ€μκ³Ό κ°μ λ¬Έμνλ₯Ό μ μλ립λλ€:
+/** + * StandardRequestModelμ λ€νΈμν¬ ν΅μ μ© DTOμΈ StandardRequestλ‘ λ³νν©λλ€. + * + * @return λ³νλ StandardRequest κ°μ²΄ + */ fun StandardRequestModel.toDto(): StandardRequest =core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardProgramListResponseMapper.kt (1)
6-12
: 맀ν λ‘μ§μ΄ λͺ ννκ² κ΅¬νλμ΄ μμ΅λλ€.νμ₯ ν¨μλ₯Ό μ¬μ©ν ꡬνμ΄ κΉλνλ©°, κ° μμ±μ΄ μ¬λ°λ₯΄κ² 맀νλμ΄ μμ΅λλ€. λ€λ§, λ€μκ³Ό κ°μ κ°μ μ¬νμ μ μλ립λλ€:
ν¨μμ KDoc λ¬Έμλ₯Ό μΆκ°νλ©΄ μ’μ κ² κ°μ΅λλ€:
+/** + * StandardProgramListResponse DTOλ₯Ό StandardProgramListResponseEntityλ‘ λ³νν©λλ€. + * + * @return StandardProgramListResponseEntity λ³νλ μν°ν° κ°μ²΄ + */ fun StandardProgramListResponse.toModel(): StandardProgramListResponseEntity = StandardProgramListResponseEntity( id = this.id, title = this.title, startedAt = this.startedAt, endedAt = this.endedAt, )
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
π Files selected for processing (25)
core/data/src/main/java/com/school_of_company/data/di/RepositoryModule.kt
(2 hunks)core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepository.kt
(1 hunks)core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepositoryImpl.kt
(1 hunks)core/domain/src/main/java/com/school_of_company/domain/usecase/standard/DeleteStandardProgramListUseCase.kt
(1 hunks)core/domain/src/main/java/com/school_of_company/domain/usecase/standard/ModifyStandardProgramUseCase.kt
(1 hunks)core/domain/src/main/java/com/school_of_company/domain/usecase/standard/RegisterStandardListProgramUseCase.kt
(1 hunks)core/domain/src/main/java/com/school_of_company/domain/usecase/standard/RegisterStandardProgramUseCase.kt
(1 hunks)core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramAttendListUseCase.kt
(1 hunks)core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramListUseCase.kt
(1 hunks)core/model/src/main/java/com/school_of_company/model/entity/standard/StandardAttendListResponseEntity.kt
(1 hunks)core/model/src/main/java/com/school_of_company/model/entity/standard/StandardProgramListResponseEntity.kt
(1 hunks)core/model/src/main/java/com/school_of_company/model/model/standard/StandardRequestModel.kt
(1 hunks)core/network/src/main/java/com/school_of_company/network/api/StandardAPI.kt
(1 hunks)core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSource.kt
(1 hunks)core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSourceImpl.kt
(1 hunks)core/network/src/main/java/com/school_of_company/network/di/NetworkModule.kt
(2 hunks)core/network/src/main/java/com/school_of_company/network/di/RemoteDataSourceModule.kt
(2 hunks)core/network/src/main/java/com/school_of_company/network/dto/standard/request/StandardRequest.kt
(1 hunks)core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardAttendListResponse.kt
(1 hunks)core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardProgramListResponse.kt
(1 hunks)core/network/src/main/java/com/school_of_company/network/mapper/standard/request/StandardRequestMapper.kt
(1 hunks)core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardAttendListResponseMapper.kt
(1 hunks)core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardProgramListResponseMapper.kt
(1 hunks)feature/expo/src/main/java/com/school_of_company/expo/viewmodel/ExpoViewModel.kt
(5 hunks)feature/expo/src/main/java/com/school_of_company/expo/viewmodel/uistate/RegisterStandardProgramListUiState.kt
(1 hunks)
β Files skipped from review due to trivial changes (2)
- core/model/src/main/java/com/school_of_company/model/entity/standard/StandardProgramListResponseEntity.kt
- core/model/src/main/java/com/school_of_company/model/model/standard/StandardRequestModel.kt
π Additional comments (15)
feature/expo/src/main/java/com/school_of_company/expo/viewmodel/uistate/RegisterStandardProgramListUiState.kt (1)
3-7
: UI μν κ΄λ¦¬κ° μ ꡬνλμ΄ μμ΅λλ€!
UI μνλ₯Ό Loading, Success, Errorλ‘ λͺ ννκ² κ΅¬λΆνμ¬ μ²λ¦¬ν μ μ΄ μ’μ΅λλ€. νΉν Error μνμμ Throwableμ ν¬ν¨νμ¬ μμΈ μ²λ¦¬λ₯Ό ν μ μλλ‘ ν κ²μ΄ μ μ ν©λλ€.
core/network/src/main/java/com/school_of_company/network/dto/standard/request/StandardRequest.kt (1)
6-11
: Moshi μ΄λ
Έν
μ΄μ
μ΄ μ μ μ©λμ΄ μμ΅λλ€.
JSON μ§λ ¬νλ₯Ό μν Moshi μ€μ μ΄ μ μ νκ² λμ΄ μμ΅λλ€. generateAdapterλ₯Ό trueλ‘ μ€μ νμ¬ μ±λ₯ μ΅μ νλ μ λμ΄ μλ€μ.
core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardAttendListResponse.kt (1)
8-14
: Nullable νλ κ²ν κ° νμν©λλ€.
νμ¬ λͺ¨λ νλκ° non-nullλ‘ μ μλμ΄ μμ΅λλ€. μ€μ API μλ΅μμ μΌλΆ νλκ° nullμΌ μ μλ κ²½μ°λ₯Ό κ³ λ €νμ¬, ν΄λΉ νλλ€μ nullableλ‘ μ μνλ κ²μ΄ μμ ν μ μμ΅λλ€.
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/ModifyStandardProgramUseCase.kt (1)
7-20
: ν΄λ¦° μν€ν
μ² ν¨ν΄μ μ μ€μνμ΅λλ€!
UseCase ꡬνμ΄ κΉλνλ©°, λ€μκ³Ό κ°μ μ₯μ λ€μ΄ μμ΅λλ€:
- μμ‘΄μ± μ£Όμ μ ν΅ν λμ¨ν κ²°ν©
- runCatchingμ μ¬μ©ν μ μ ν μλ¬ μ²λ¦¬
- operator ν¨μλ₯Ό νμ©ν κ°λ μ± μλ μΈν°νμ΄μ€
core/network/src/main/java/com/school_of_company/network/api/StandardAPI.kt (1)
32-45
: μλ΅ νμ
κ³Ό μλ¬ μ²λ¦¬ κ²ν κ° νμν©λλ€.
λ€μ μ¬νλ€μ κ³ λ €ν΄λ³΄μλ©΄ μ’μ κ² κ°μ΅λλ€:
- μμ μμ μ±κ³΅/μ€ν¨ μ¬λΆλ₯Ό λͺ νν νκΈ° μν μλ΅ νμ μΆκ°
- νμ€ μλ¬ μλ΅ νμ μ μ
- HTTP μν μ½λμ λ°λ₯Έ μμΈ μ²λ¦¬ λ°©μ λ¬Έμν
μλ μ€ν¬λ¦½νΈλ‘ νμ¬ μλ¬ μ²λ¦¬ λ°©μμ νμΈν΄λ³΄κ² μ΅λλ€:
core/data/src/main/java/com/school_of_company/data/di/RepositoryModule.kt (1)
48-52
: Repository λ°μΈλ©μ΄ κΈ°μ‘΄ ν¨ν΄μ μ λ°λ₯΄κ³ μμ΅λλ€!
SingletonComponentλ₯Ό μ¬μ©ν μμ‘΄μ± μ£Όμ μ€μ μ΄ μ μ νκ² κ΅¬νλμ΄ μμ΅λλ€.
core/network/src/main/java/com/school_of_company/network/di/RemoteDataSourceModule.kt (1)
48-52
: λ°μΈλ© ꡬνμ΄ μ μ ν©λλ€!
κΈ°μ‘΄μ λ€λ₯Έ DataSource λ°μΈλ©κ³Ό μΌκ΄λ ν¨ν΄μ λ°λ₯΄κ³ μμΌλ©°, Dagger/Hilt DI ꡬνμ΄ μ¬λ°λ₯΄κ² λμ΄μμ΅λλ€.
core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSourceImpl.kt (1)
14-18
: π οΈ Refactor suggestion
맀κ°λ³μ μ ν¨μ± κ²μ¬ μΆκ° νμ
expoIdκ° λΉμ΄μκ±°λ μ ν¨νμ§ μμ κ²½μ°μ λν μ²λ¦¬κ° νμν©λλ€.
λ€μκ³Ό κ°μ μ ν¨μ± κ²μ¬ μΆκ°λ₯Ό μ μν©λλ€:
override fun registerStandardProgram(expoId: String, body: StandardRequest): Flow<Unit> =
+ require(expoId.isNotBlank()) { "expoId must not be blank" }
performApiRequest { service.registerStandardProgram(
expoId = expoId,
body = body
) }
core/network/src/main/java/com/school_of_company/network/di/NetworkModule.kt (1)
11-11
: μ½λκ° μ μ ν ꡬνλμμ΅λλ€!
StandardAPIλ₯Ό μ 곡νλ λ©μλκ° κΈ°μ‘΄ API μ 곡 λ©μλλ€κ³Ό μΌκ΄λ ν¨ν΄μΌλ‘ ꡬνλμμ΅λλ€.
Also applies to: 112-115
feature/expo/src/main/java/com/school_of_company/expo/viewmodel/ExpoViewModel.kt (3)
16-16
: μμ‘΄μ± μΆκ°κ° μ μ ν©λλ€!
νμν UseCaseμ λͺ¨λΈ ν΄λμ€λ€μ΄ μ¬λ°λ₯΄κ² import λμμ΅λλ€.
Also applies to: 29-29, 33-33
55-55
: UseCase μ£Όμ
μ΄ μ¬λ°λ₯΄κ² ꡬνλμμ΅λλ€!
RegisterStandardListProgramUseCaseκ° ViewModel μμ±μμ μ μ ν μ£Όμ λμμ΅λλ€.
110-111
: UI μν κ΄λ¦¬κ° μ μ ν ꡬνλμμ΅λλ€!
RegisterStandardProgramListUiStateμ μ΄κΈ° μνκ° LoadingμΌλ‘ μ¬λ°λ₯΄κ² μ€μ λμμ΅λλ€.
core/network/src/main/java/com/school_of_company/network/mapper/standard/request/StandardRequestMapper.kt (2)
6-11
: κΈ°λ³Έ ꡬνμ΄ μ λμ΄μμ΅λλ€.
맀ν λ‘μ§μ΄ λͺ ννκ³ κ°λ¨νκ² κ΅¬νλμ΄ μμ΅λλ€.
6-11
: Null μμ μ± κ²μ¬ μΆκ°λ₯Ό κ³ λ €ν΄λ³΄μΈμ.
νλκ°μ΄ nullμΌ μ μλ κ²½μ°λ₯Ό λλΉνμ¬ μμ μ± κ²μ¬λ₯Ό μΆκ°νλ κ²μ΄ μ’μ κ² κ°μ΅λλ€.
λ€μ μ€ν¬λ¦½νΈλ‘ λͺ¨λΈ ν΄λμ€μ νλ nullable μ¬λΆλ₯Ό νμΈν΄λ³΄κ² μ΅λλ€:
core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardProgramListResponseMapper.kt (1)
1-5
: ν¨ν€μ§ ꡬ쑰μ μν¬νΈκ° μ ꡬμ±λμ΄ μμ΅λλ€!
λ€νΈμν¬ κ³μΈ΅μ 맀νΌλ‘μ μ μ ν μμΉμ μμΌλ©°, νμν ν΄λμ€λ€λ§ μν¬νΈνκ³ μμ΅λλ€.
@Json(name = "title") val title: String, | ||
@Json(name = "startedAt") val startedAt: String, | ||
@Json(name = "endedAt") val endedAt: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π‘ Codebase verification
μκ° νλμ λν κ²μ¦μ΄ νμνλ©° λ¬Έμνκ° λ―Έν‘ν©λλ€.
μ½λλ² μ΄μ€ λΆμ κ²°κ³Ό λ€μκ³Ό κ°μ λ¬Έμ μ λ€μ΄ λ°κ²¬λμμ΅λλ€:
startedAt
κ³ΌendedAt
νλλ "yyyy-MM-dd" νμμΌλ‘ μ²λ¦¬λκ³ μμΌλ, μ΄μ λν λͺ μμ μΈ λ¬Έμνκ° DTOμ μμ΅λλ€.formatServerDate()
μ νΈλ¦¬ν°λ μμ§λ§, λ μ§μ μ ν¨μ±μ κ²μ¦νλ λ‘μ§μ΄ μμ΅λλ€.startedAt
μ΄endedAt
λ³΄λ€ μ΄μ μκ°μΈμ§ νμΈνλ κ²μ¦ λ‘μ§μ΄ μμ΅λλ€.
κ°μ κΆμ₯μ¬ν:
- DTO ν΄λμ€μ λ μ§ νμμ λν λͺ
νν λ¬Έμν μΆκ° (μ:
@Json
μ΄λ Έν μ΄μ μμ KDoc μ£ΌμμΌλ‘ "yyyy-MM-dd" νμμμ λͺ μ) - λ μ§ μ ν¨μ± κ²μ¦ λ‘μ§ κ΅¬ν
- μμμΌμ΄ μ’ λ£μΌλ³΄λ€ μ΄μ μΈμ§ νμΈνλ κ²μ¦ λ‘μ§ μΆκ°
π Analysis chain
μκ° νλμ λν μ ν¨μ± κ²μ¬μ λ¬Έμνκ° νμν©λλ€.
startedAtκ³Ό endedAt νλμ κ΄λ ¨νμ¬ λ€μ μ¬νλ€μ κ³ λ €ν΄μ£ΌμΈμ:
- μκ° νμμ λν λͺ νν λ¬Έμνκ° νμν©λλ€ (μ: ISO 8601 νμ μ¬μ© μ¬λΆ).
- startedAtμ΄ endedAtλ³΄λ€ μ΄μ μκ°μΈμ§ κ²μ¦νλ λ‘μ§μ΄ νμν κ² κ°μ΅λλ€.
λ€μ μ€ν¬λ¦½νΈλ‘ μκ° κ΄λ ¨ κ²μ¦ λ‘μ§μ μ‘΄μ¬ μ¬λΆλ₯Ό νμΈν μ μμ΅λλ€:
Let's search more broadly to understand the context and validation patterns in the codebase.
Let's search for date/time validation and formatting related code to better understand how dates are handled in the codebase.
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for time validation logic in the codebase
# Search for time validation patterns
rg -i "validate.*time|time.*validate|check.*time|time.*check"
# Search for date/time utility functions
ast-grep --pattern 'fun $_($$TIME|$$Date|$$DateTime)$_($$$) { $$$ }'
Length of output: 134
Script:
#!/bin/bash
# Search for any date/time related validation or utility code
rg -i "date|time" -A 3 --type kotlin
# Search specifically in the network module
fd . "core/network" -e kt -x cat {}
# Look for validation related code
rg -i "validate|check" -A 3 --type kotlin
Length of output: 100877
Script:
#!/bin/bash
# Let's check for date/time validation and formatting utilities
rg -i "format.*date|date.*format|parse.*date|date.*parse" -A 3
# Look for any date/time related utilities or helper functions
fd . "core/ui/src/main/java" -e kt -x cat {}
# Check for any validation related code in the codebase
ast-grep --pattern 'fun $_validate$_($$$) { $$$ }'
Length of output: 5945
class DeleteStandardProgramListUseCase @Inject constructor( | ||
private val repository: StandardRepository | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
ν΄λμ€ μ΄λ¦μ΄ κΈ°λ₯κ³Ό μΌμΉνμ§ μμ΅λλ€
νμ¬ ν΄λμ€ μ΄λ¦μ DeleteStandardProgramListUseCase
μ΄μ§λ§ μ€μ λ‘λ λ¨μΌ νλ‘κ·Έλ¨μ μμ νλ κΈ°λ₯μ μνν©λλ€. λ λͺ
νν μλ―Έ μ λ¬μ μν΄ DeleteStandardProgramUseCase
λ‘ λ³κ²½νλ κ²μ΄ μ’κ² μ΅λλ€.
-class DeleteStandardProgramListUseCase @Inject constructor(
+class DeleteStandardProgramUseCase @Inject constructor(
private val repository: StandardRepository
)
π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
class DeleteStandardProgramListUseCase @Inject constructor( | |
private val repository: StandardRepository | |
) { | |
class DeleteStandardProgramUseCase @Inject constructor( | |
private val repository: StandardRepository | |
) { |
operator fun invoke(expoId: String) : Flow<List<StandardProgramListResponseEntity>> = | ||
repository.standardProgramList(expoId = expoId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
μ λ ₯κ° κ²μ¦μ΄ νμν©λλ€
expoId
μ λν μ ν¨μ± κ²μ¬κ° μμ΅λλ€. λΉ λ¬Έμμ΄μ΄λ μλͺ»λ νμμ IDκ° μ
λ ₯λ κ²½μ° μ²λ¦¬κ° νμν©λλ€.
operator fun invoke(expoId: String) : Flow<List<StandardProgramListResponseEntity>> =
+ require(expoId.isNotBlank()) { "expoIdλ λΉμ΄μμ μ μμ΅λλ€" }
repository.standardProgramList(expoId = expoId)
π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
operator fun invoke(expoId: String) : Flow<List<StandardProgramListResponseEntity>> = | |
repository.standardProgramList(expoId = expoId) | |
operator fun invoke(expoId: String) : Flow<List<StandardProgramListResponseEntity>> = | |
require(expoId.isNotBlank()) { "expoIdλ λΉμ΄μμ μ μμ΅λλ€" } | |
repository.standardProgramList(expoId = expoId) |
operator fun invoke(standardProId: Long) : Flow<List<StandardAttendListResponseEntity>> = | ||
repository.standardProgramAttendList(standardProId = standardProId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
μ λ ₯κ° κ²μ¦κ³Ό μμΈ μ²λ¦¬κ° νμν©λλ€
standardProId
κ° μ ν¨νμ§ νμΈνλ λ‘μ§μ΄ μμΌλ©°, μ‘΄μ¬νμ§ μλ νλ‘κ·Έλ¨μ λν μμΈ μ²λ¦¬κ° νμν©λλ€.
operator fun invoke(standardProId: Long) : Flow<List<StandardAttendListResponseEntity>> =
+ require(standardProId > 0) { "standardProIdλ 0λ³΄λ€ μ»€μΌ ν©λλ€" }
repository.standardProgramAttendList(standardProId = standardProId)
+ .catch { throwable ->
+ when (throwable) {
+ is NoSuchElementException -> throw StandardProgramNotFoundException(standardProId)
+ else -> throw throwable
+ }
+ }
Committable suggestion skipped: line range outside the PR's diff.
@Json(name = "entryTime") val entryTime: String, | ||
@Json(name = "leaveTime") val leaveTime: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π‘ Codebase verification
μκ° λ°μ΄ν° μ²λ¦¬μ λν νμ€νκ° νμν©λλ€.
μ½λλ² μ΄μ€ λΆμ κ²°κ³Ό, FormatServerDate.kt
μμ λ μ§ ν¬λ§·ν
μ μν μ νΈλ¦¬ν°λ μμΌλ μκ° μ²λ¦¬λ₯Ό μν νμ€νλ λ°©μμ΄ μλ κ²μΌλ‘ νμΈλ©λλ€. λ€μκ³Ό κ°μ κ°μ μ΄ νμν©λλ€:
core/ui/util
ν¨ν€μ§μ μκ° ν¬λ§·ν μ μν μ νΈλ¦¬ν° ν΄λμ€ μΆκ°entryTime
κ³ΌleaveTime
μLocalDateTime
λλZonedDateTime
μΌλ‘ νμ±νλ λ‘μ§ κ΅¬ν- μκ°λ μ²λ¦¬λ₯Ό μν νμ€ ν¬λ§· μ μ
νμ¬ λ¬Έμμ΄λ‘ μ²λ¦¬λλ μκ° λ°μ΄ν°λ μΌκ΄μ± μλ ν¬λ§·ν κ³Ό κ²μ¦μ΄ μ΄λ €μ°λ―λ‘, μ μ¬νλ€μ ꡬνμ κΆμ₯λ립λλ€.
π Analysis chain
μκ° νλμ νμ κ²ν κ° νμν©λλ€.
entryTime
κ³Ό leaveTime
νλκ° String νμ
μΌλ‘ μ μλμ΄ μμ΅λλ€. μκ° λ°μ΄ν°μ μΌκ΄μ±κ³Ό μ ν¨μ±μ 보μ₯νκΈ° μν΄ λ€μ μ¬νλ€μ κ³ λ €ν΄λ³΄μκΈ° λ°λλλ€:
- ISO 8601 νμ μ¬μ©
- LocalDateTime λλ ZonedDateTimeμΌλ‘ νμ±
- μκ°λ(timezone) μ²λ¦¬ λ°©μ
μκ° νμ κ²μ¦μ μν μ€ν¬λ¦½νΈ:
Let me generate additional scripts to check for any time-related utilities or formatters in the codebase:
This will help us understand if there are any existing time handling utilities or standardized approaches in the codebase before making the final recommendation.
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: μκ° κ΄λ ¨ νλμ μ¬μ© ν¨ν΄ νμΈ
# μκ° νλ μ¬μ© ν¨ν΄ κ²μ
rg "entryTime|leaveTime" -A 3 -B 3
Length of output: 5265
Script:
#!/bin/bash
# Description: Check for time-related utilities and formatters
# Search for date/time related imports and utilities
rg "import.*time|import.*date|TimeFormat|DateFormat|ZonedDateTime|LocalDateTime" -g "*.kt"
# Search for any custom time formatting or validation logic
rg "fun.*Time|class.*Time|object.*Time" -g "*.kt"
Length of output: 14508
) = runCatching { | ||
repository.registerStandardProgram( | ||
expoId = expoId, | ||
body = body | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
μλ¬ μ²λ¦¬ κ°μ μ΄ νμν©λλ€.
νμ¬ runCatching
λ§μΌλ‘λ ꡬ체μ μΈ μλ¬ μ²λ¦¬κ° λΆμ‘±ν μ μμ΅λλ€. λ€μκ³Ό κ°μ κ°μ μ¬νμ κ³ λ €ν΄λ³΄μΈμ:
- ꡬ체μ μΈ μμΈ νμ μ μ
- λΉμ¦λμ€ λ‘μ§ μ€ν¨μ λν μ²λ¦¬
- λ€νΈμν¬ μ€λ₯ ꡬλΆ
μμ μ½λ:
- ) = runCatching {
+ ) = runCatching {
+ require(expoId.isNotBlank()) { "expoIdλ λΉμ΄μμ μ μμ΅λλ€" }
+ require(body.isValid()) { "μ ν¨νμ§ μμ μμ²μ
λλ€" }
+
repository.registerStandardProgram(
expoId = expoId,
body = body
)
+ }.onFailure { throwable ->
+ when (throwable) {
+ is IllegalArgumentException -> throw BusinessException(throwable)
+ is IOException -> throw NetworkException(throwable)
+ else -> throw throwable
+ }
}
Committable suggestion skipped: line range outside the PR's diff.
class RegisterStandardListProgramUseCase @Inject constructor( | ||
private val repository: StandardRepository | ||
) { | ||
operator fun invoke( | ||
expoId: String, | ||
body: List<StandardRequestModel> | ||
) = runCatching { | ||
repository.registerStandardListProgram( | ||
expoId = expoId, | ||
body = body | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
μ½λ μ€λ³΅ λ° μ±λ₯ κ°μ μ΄ νμν©λλ€.
-
μ½λ μ€λ³΅:
RegisterStandardProgramUseCase
μ μ μ¬ν κ΅¬μ‘°κ° μ€λ³΅λμ΄ μμ΅λλ€.- κ³΅ν΅ λ‘μ§μ μΆμ ν΄λμ€λ μΈν°νμ΄μ€λ‘ λΆλ¦¬νλ κ²μ κ³ λ €ν΄λ³΄μΈμ.
-
μ±λ₯ κ³ λ €μ¬ν:
- λλμ λ°μ΄ν° μ²λ¦¬ μ λ°°μΉ ν¬κΈ° μ νμ΄ μμ΅λλ€.
- λ³λ ¬ μ²λ¦¬ λ°©μμ΄ κ³ λ €λμ§ μμμ΅λλ€.
μμ μ½λ:
operator fun invoke(
expoId: String,
body: List<StandardRequestModel>
) = runCatching {
+ require(body.size <= MAX_BATCH_SIZE) { "μ΅λ μ²λ¦¬ κ°λ₯ν ν¬κΈ°λ₯Ό μ΄κ³Όνμ΅λλ€" }
+
+ body.chunked(OPTIMAL_CHUNK_SIZE)
+ .asFlow()
+ .flatMapMerge { chunk ->
repository.registerStandardListProgram(
expoId = expoId,
- body = body
+ body = chunk
)
+ }
}
+companion object {
+ private const val MAX_BATCH_SIZE = 1000
+ private const val OPTIMAL_CHUNK_SIZE = 100
+}
Committable suggestion skipped: line range outside the PR's diff.
@POST("/standard/{expo_id}") | ||
suspend fun registerStandardProgram( | ||
@Path("expo_id") expoId: String, | ||
@Body body: StandardRequest | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
API μλν¬μΈνΈ κ²½λ‘μ μΌκ΄μ± κ²ν κ° νμν©λλ€.
μλν¬μΈνΈ κ²½λ‘μμ λ€μκ³Ό κ°μ λΉμΌκ΄μ±μ΄ λ°κ²¬λ©λλ€:
/standard/{expo_id}
vs/standard/list/{expo_id}
vs/standard/{standardPro_id}
expo_id
μstandardPro_id
μ λ€μ΄λ° 컨벀μ μ΄ λ€λ¦ λλ€ (snake_case vs camelCase)
λ€μκ³Ό κ°μ΄ μμ νλ κ²μ μ μλ립λλ€:
- @POST("/standard/{expo_id}")
+ @POST("/standard/program/{expoId}")
suspend fun registerStandardProgram(
- @Path("expo_id") expoId: String,
+ @Path("expoId") expoId: String,
@Body body: StandardRequest
)
- @POST("/standard/list/{expo_id}")
+ @POST("/standard/program/list/{expoId}")
suspend fun registerStandardListProgram(
- @Path("expo_id") expoId: String,
+ @Path("expoId") expoId: String,
@Body body: List<StandardRequest>
)
- @POST("/standard/{standardPro_id}")
+ @POST("/standard/program/{standardProId}")
suspend fun modifyStandardProgram(
- @Path("standardPro_id") standardProId: Long,
+ @Path("standardProId") standardProId: Long,
@Body body: StandardRequest
)
Also applies to: 20-24, 26-30
override fun modifyStandardProgram(standardProId: Long, body: StandardRequest): Flow<Unit> = | ||
performApiRequest { service.modifyStandardProgram( | ||
standardProId = standardProId, | ||
body = body | ||
) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
Long νμ 맀κ°λ³μ μ ν¨μ± κ²μ¬ μΆκ° νμ
standardProIdκ° 0λ³΄λ€ μμ κ²½μ°μ λν μ²λ¦¬κ° νμν©λλ€.
λ€μκ³Ό κ°μ μ ν¨μ± κ²μ¬ μΆκ°λ₯Ό μ μν©λλ€:
override fun modifyStandardProgram(standardProId: Long, body: StandardRequest): Flow<Unit> =
+ require(standardProId > 0) { "standardProId must be positive" }
performApiRequest { service.modifyStandardProgram(
standardProId = standardProId,
body = body
) }
π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
override fun modifyStandardProgram(standardProId: Long, body: StandardRequest): Flow<Unit> = | |
performApiRequest { service.modifyStandardProgram( | |
standardProId = standardProId, | |
body = body | |
) } | |
override fun modifyStandardProgram(standardProId: Long, body: StandardRequest): Flow<Unit> = | |
require(standardProId > 0) { "standardProId must be positive" } | |
performApiRequest { service.modifyStandardProgram( | |
standardProId = standardProId, | |
body = body | |
) } |
data class StandardProgramListResponse( | ||
@Json(name = "id") val id: Long, | ||
@Json(name = "title") val title: String, | ||
@Json(name = "startedAt") val startedAt: String, | ||
@Json(name = "endedAt") val endedAt: String, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
νλμ Null μμ μ± κ°μ μ΄ νμν©λλ€
νμ¬ λͺ¨λ νλκ° non-nullableλ‘ μ μΈλμ΄ μμ΅λλ€. APIμμ null κ°μ λ°νν κ²½μ° λ°νμ μμΈκ° λ°μν μ μμ΅λλ€.
λ€μκ³Ό κ°μ΄ μμ νλ κ²μ κΆμ₯λ립λλ€:
@JsonClass(generateAdapter = true)
data class StandardProgramListResponse(
- @Json(name = "id") val id: Long,
- @Json(name = "title") val title: String,
- @Json(name = "startedAt") val startedAt: String,
- @Json(name = "endedAt") val endedAt: String,
+ @Json(name = "id") val id: Long?,
+ @Json(name = "title") val title: String?,
+ @Json(name = "startedAt") val startedAt: String?,
+ @Json(name = "endedAt") val endedAt: String?,
)
λ§μ½ νμ¬ νλλ€μ΄ λ°λμ non-nullμμ΄ λ³΄μ₯λλ€λ©΄, μ΄λ₯Ό λͺ μνλ λ¬Έμνκ° νμν©λλ€.
π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
data class StandardProgramListResponse( | |
@Json(name = "id") val id: Long, | |
@Json(name = "title") val title: String, | |
@Json(name = "startedAt") val startedAt: String, | |
@Json(name = "endedAt") val endedAt: String, | |
) | |
@JsonClass(generateAdapter = true) | |
data class StandardProgramListResponse( | |
@Json(name = "id") val id: Long?, | |
@Json(name = "title") val title: String?, | |
@Json(name = "startedAt") val startedAt: String?, | |
@Json(name = "endedAt") val endedAt: String?, | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
π‘ κ°μ
π μμ λ΄μ©
π λ³κ²½μ¬ν
πββοΈ μ§λ¬Έμ¬ν
π΄ μ¬μ©λ°©λ²
πΈ κΈ°ν
Summary by CodeRabbit