Skip to content

portfolioUrl 필수값으로 응답하도록 수정 #402

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

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import team.msg.sms.domain.student.model.MilitaryService
data class DetailStudentInfoTeacherResponseData(
val name: String,
val introduce: String,
val portfolioUrl: String?,
val portfolioUrl: String,
val portfolioFileUrl: String?,
val grade: Int,
val classNum: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import team.msg.sms.domain.student.model.MilitaryService
data class DetailStudentInfoTokenResponseData(
val name: String,
val introduce: String,
val portfolioUrl: String?,
val portfolioUrl: String,
val portfolioFileUrl: String?,
val grade: Int,
val classNum: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ModifyStudentInfoUseCase(
val checkStudentMismatch = studentService.checkStudentDataMismatch(student, modifyStudentInfoDataModel)
if (checkStudentMismatch) {
val portfolioFileUrl =
if(student.portfolioUrl != modifyStudentInfoDataModel.portfolioUrl
if(student.portfolioUrl != modifyStudentInfoDataModel.portfolioUrl // true && true) //해당 데이터가 다르면서 수정 데이터는 있으면 null
&& modifyStudentInfoData.portfolioUrl != null) null
else student.portfolioFileUrl

Expand Down Expand Up @@ -299,6 +299,7 @@ class ModifyStudentInfoUseCase(
}

else -> when (departmentCode) {
"0" -> Department.SW_DEVELOPMENT
"1", "2" -> Department.SW_DEVELOPMENT
"3", "4" -> Department.SMART_IOT_DEVELOPMENT
else -> throw StuNumNotRightException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import team.msg.sms.domain.project.service.ProjectService
import team.msg.sms.domain.project.service.ProjectTechStackService
import team.msg.sms.domain.region.service.RegionService
import team.msg.sms.domain.student.dto.res.DetailStudentInfoTeacherResponseData
import team.msg.sms.domain.student.model.Student
import team.msg.sms.domain.student.model.StudentTechStack
import team.msg.sms.domain.student.service.StudentService
import team.msg.sms.domain.student.service.StudentTechStackService
Expand Down Expand Up @@ -48,7 +49,7 @@ class StudentInfoTeacherUseCase(
return DetailStudentInfoTeacherResponseData(
name = student.name,
introduce = student.introduce,
portfolioUrl = student.portfolioUrl,
portfolioUrl = getStudentPortfolioUrl(student),
portfolioFileUrl = student.portfolioFileUrl,
grade = student.stuNum.substring(0, 1).toInt(),
classNum = student.stuNum.substring(1, 2).toInt(),
Expand Down Expand Up @@ -90,5 +91,13 @@ class StudentInfoTeacherUseCase(

private fun toStudentTechStacks(techStacks: List<TechStack>, studentTechStack: StudentTechStack): TechStack? =
techStacks.find { it.id == studentTechStack.techStackId }

private fun getStudentPortfolioUrl(student: Student.StudentWithUserInfo): String {
return when {
!student.portfolioUrl.isNullOrBlank() -> student.portfolioUrl
!student.portfolioFileUrl.isNullOrBlank() -> student.portfolioFileUrl
else -> ""
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class StudentInfoTokenUseCase(
return DetailStudentInfoTokenResponseData(
name = student.name,
introduce = student.introduce,
portfolioUrl = student.portfolioUrl,
portfolioUrl = getStudentPortfolioUrl(student),
portfolioFileUrl = student.portfolioFileUrl,
grade = student.stuNum.substring(0, 1).toInt(),
classNum = student.stuNum.substring(1, 2).toInt(),
Expand Down Expand Up @@ -94,5 +94,13 @@ class StudentInfoTokenUseCase(

private fun toStudentTechStacks(techStacks: List<TechStack>, studentTechStack: StudentTechStack): TechStack? =
techStacks.find { it.id == studentTechStack.techStackId }

private fun getStudentPortfolioUrl(student: Student.StudentWithUserInfo): String {
return when {
!student.portfolioUrl.isNullOrBlank() -> student.portfolioUrl
!student.portfolioFileUrl.isNullOrBlank() -> student.portfolioFileUrl
else -> ""
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import team.msg.sms.domain.student.model.MilitaryService
data class UserProfileDetailResponseData(
val name: String,
val introduce: String,
val portfolioUrl: String?,
val portfolioUrl: String,
val portfolioFileUrl: String?,
val grade: Int,
val classNum: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class QueryCurrentUserProfileDetailUseCase(
UserProfileDetailResponseData(
name = student.name,
introduce = student.introduce,
portfolioUrl = student.portfolioUrl,
portfolioUrl = getStudentPortfolioUrl(student),
portfolioFileUrl = student.portfolioFileUrl,
grade = student.stuNum.substring(0, 1).toInt(),
classNum = student.stuNum.substring(1, 2).toInt(),
Expand Down Expand Up @@ -113,4 +113,12 @@ class QueryCurrentUserProfileDetailUseCase(

private fun toStudentTechStacks(techStacks: List<TechStack>, studentTechStack: StudentTechStack): TechStack? =
techStacks.find { it.id == studentTechStack.techStackId }

private fun getStudentPortfolioUrl(student: Student.StudentWithUserInfo): String {
return when {
!student.portfolioUrl.isNullOrBlank() -> student.portfolioUrl
!student.portfolioFileUrl.isNullOrBlank() -> student.portfolioFileUrl
else -> ""
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import team.msg.sms.domain.student.model.MilitaryService
data class DetailStudentInfoTeacherWebResponse(
val name: String,
val introduce: String,
val portfolioUrl: String?,
val portfolioUrl: String,
val portfolioFileUrl: String?,
val grade: Int,
val classNum: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import team.msg.sms.domain.student.model.MilitaryService
data class DetailStudentInfoTokenWebResponse(
val name: String,
val introduce: String,
val portfolioUrl: String?,
val portfolioUrl: String,
val portfolioFileUrl: String?,
val grade: Int,
val classNum: Int,
Expand Down
Loading