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

πŸ”€ :: 159 - ν”„λ‘œμ νŠΈ μΆ”κ°€ #169

Merged
merged 133 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 124 commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
b1723a1
:sparkles: κΈ°μ‘΄ ν…Œν¬ μŠ€νƒ Model Count λ³€κ²½
Huuuunee Aug 14, 2023
b40be10
:sparkles: κΈ°μ‘΄ ν…Œν¬ μŠ€νƒ Entity Count λ³€κ²½
Huuuunee Aug 14, 2023
fbcb99b
:sparkles: κΈ°μ‘΄ ν…Œν¬ μŠ€νƒ Mapper λ°”λ€λŒ€λ‘œ λ³€κ²½
Huuuunee Aug 14, 2023
f7e6e28
:sparkles: κΈ°μ‘΄ ν…Œν¬ μŠ€νƒ queryAll
Huuuunee Aug 14, 2023
794fef9
:sparkles: κΈ°μ‘΄ ν…Œν¬ μŠ€νƒ 가지고 μ˜€λŠ”κ±° μŠ€νƒ 2 이상인 μ—”ν‹°ν‹°λ§Œ κ°€μ Έμ˜€λ„λ‘
Huuuunee Aug 14, 2023
e739858
:sparkles: StudentTechStack 생성
Huuuunee Aug 14, 2023
882e9e4
:sparkles: StudentTechStack μ—”ν‹°ν‹° 생성
Huuuunee Aug 14, 2023
49f92d3
:sparkles: StudentTechStack Mapper 생성
Huuuunee Aug 14, 2023
5425312
:sparkles: StudentTechStackPersistenceAdapter 생성
Huuuunee Aug 14, 2023
9c723c5
:sparkles: StudentTechStackRepository
Huuuunee Aug 14, 2023
9473d40
:sparkles: λ“€μ—¬μ“°κΈ° μ‚­μ œ
Huuuunee Aug 14, 2023
0d185e6
:sparkles: Student Model에 userId
Huuuunee Aug 14, 2023
b5b3879
:sparkles: userId StudentMapper 에 μΆ”κ°€
Huuuunee Aug 14, 2023
d7d87c3
:sparkles: StudentPersistenceAdapter μΆ”κ°€
Huuuunee Aug 14, 2023
de10ab7
:sparkles: Project Model 생성
Huuuunee Aug 14, 2023
6ce3c01
:sparkles: Project μ—”ν‹°ν‹° 생성
Huuuunee Aug 14, 2023
e219d98
:sparkles: ProjectJpaRepository 생성
Huuuunee Aug 14, 2023
74a6ab5
:sparkles: Project Mapper 생성
Huuuunee Aug 14, 2023
3f14792
:sparkles: ProjectPersistenceAdapter 생성
Huuuunee Aug 14, 2023
5325c3a
:sparkles: CommandProjectService 생성
Huuuunee Aug 14, 2023
8af7312
:sparkles: CommandProjectService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
108e916
:sparkles: CommandProjectPort 생성
Huuuunee Aug 14, 2023
5e74b4f
:sparkles: QueryProjectPort 생성
Huuuunee Aug 14, 2023
3c3891d
:sparkles: GetProjectService 생성
Huuuunee Aug 14, 2023
df12fb8
:sparkles: GetProjectService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
c9fbe1b
:sparkles: Project μ—λŸ¬ μ½”λ“œ 생성
Huuuunee Aug 14, 2023
2883ea7
:sparkles: ProjectNotFound μ—λŸ¬ μΆ”κ°€
Huuuunee Aug 14, 2023
2c6436f
:sparkles: ProjectService μΆ”κ°€
Huuuunee Aug 14, 2023
1d88602
:sparkles: ProjectPort 생성
Huuuunee Aug 14, 2023
b42d30a
:sparkles: ProjectLink Model 생성
Huuuunee Aug 14, 2023
1d7f66d
:sparkles: ProjectLink μ—”ν‹°ν‹° 생성
Huuuunee Aug 14, 2023
08856c9
:sparkles: ProjectLinkJpaRepository 생성
Huuuunee Aug 14, 2023
10a0cb5
:sparkles: ProjectLink Mapper 생성
Huuuunee Aug 14, 2023
224a0ff
:sparkles: ProjectLinkPersistenceAdapter 생성
Huuuunee Aug 14, 2023
ecec2ef
:sparkles: ProjectLinkPort 생성
Huuuunee Aug 14, 2023
6807421
:sparkles: ProjectLinkService 생성
Huuuunee Aug 14, 2023
bbf70cc
:sparkles: QueryProjectLinkPort 생성
Huuuunee Aug 14, 2023
43d3ece
:sparkles: CommandProjectLinkPort 생성
Huuuunee Aug 14, 2023
4f0ab6e
:sparkles: CommandProjectLinkService 생성
Huuuunee Aug 14, 2023
3a4efa0
:sparkles: CommandProjectLinkService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
7f0313f
:sparkles: Image Model 생성
Huuuunee Aug 14, 2023
1b160a4
:sparkles: Image μ—”ν‹°ν‹° 생성
Huuuunee Aug 14, 2023
96dab74
:sparkles: ImageJpaRepository 생성
Huuuunee Aug 14, 2023
a49f0dc
:sparkles: ImageMapper 생성
Huuuunee Aug 14, 2023
95352c4
:sparkles: ImagePersistenceAdapter 생성
Huuuunee Aug 14, 2023
abd01e3
:sparkles: ImagePort 생성
Huuuunee Aug 14, 2023
654c77e
:sparkles: ImageService 생성
Huuuunee Aug 14, 2023
5cc0361
:sparkles: CommandImageService 생성
Huuuunee Aug 14, 2023
d9442fc
:sparkles: CommandImageService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
8eb3e6a
:sparkles: CommandImagePort 생성
Huuuunee Aug 14, 2023
c3e1736
:sparkles: QueryImagePort 생성
Huuuunee Aug 14, 2023
73f7665
:sparkles: GetImageService 생성
Huuuunee Aug 14, 2023
94ad266
:sparkles: GetImageService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
1b1761e
:sparkles: GetProjectLinkService 생성
Huuuunee Aug 14, 2023
3eb124d
:sparkles: GetProjectLinkService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
d7cb494
:sparkles: GetStudentService 생성
Huuuunee Aug 14, 2023
ada4157
:sparkles: GetStudentService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
52c8037
:sparkles: GetStudentService 에 StudentTechStack μΆ”κ°€
Huuuunee Aug 14, 2023
e9fb15d
:sparkles: GetTechStackService 생성
Huuuunee Aug 14, 2023
1329d33
:sparkles: GetTechStackService Count둜 2이상 μ• λ“€λ§Œ 검색
Huuuunee Aug 14, 2023
854e3f7
:sparkles: CommandStudentTechStackPort 생성
Huuuunee Aug 14, 2023
89d7490
:sparkles: CommandStudentTechStackService 생성
Huuuunee Aug 14, 2023
b899c8c
:sparkles: CommandStudentTechStackService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
dd7b795
:sparkles: CommandStudentTechStackPort 생성
Huuuunee Aug 14, 2023
c26fa7c
:sparkles: CommandStudentTechStackService 생성
Huuuunee Aug 14, 2023
610ffb4
:sparkles: CommandStudentTechStackService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
be78571
:sparkles: GetProjectTechStackService 생성
Huuuunee Aug 14, 2023
18af2da
:sparkles: GetProjectTechStackService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
258b1d9
:sparkles: GetStudentTechStackService 생성
Huuuunee Aug 14, 2023
c111c18
:sparkles: GetStudentTechStackService κ΅¬ν˜„μ²΄ 생성
Huuuunee Aug 14, 2023
78d2c83
:sparkles: ProjectTechStack Model 생성
Huuuunee Aug 14, 2023
1f3a0a8
:sparkles: ProjectTechStack μ—”ν‹°ν‹° 생성
Huuuunee Aug 14, 2023
9b9ce7b
:sparkles: ProjectTechStackRepository 생성
Huuuunee Aug 14, 2023
1fa4fd3
:sparkles: ProjectTechStackMapper 생성
Huuuunee Aug 14, 2023
3db69f8
:sparkles: ProjectTechStackPersistenceAdapter 생성
Huuuunee Aug 14, 2023
1401c3b
:sparkles: ProjectTechStackPort 생성
Huuuunee Aug 14, 2023
2823585
:sparkles: ProjectTechStackService 생성
Huuuunee Aug 14, 2023
4316165
:sparkles: QueryProjectTechStackPort 생성
Huuuunee Aug 14, 2023
ca73754
:sparkles: QueryStudentPort 생성
Huuuunee Aug 14, 2023
ca411d5
:sparkles: StudentTechStackPort 생성
Huuuunee Aug 14, 2023
e4920f0
:sparkles: StudentTechStackService 생성
Huuuunee Aug 14, 2023
ee26df1
:sparkles: ProjectLinkResponseData 생성
Huuuunee Aug 14, 2023
de0a346
:sparkles: ProjectResponseData 생성
Huuuunee Aug 14, 2023
39b5a61
:sparkles: ProjectRequestData 생성
Huuuunee Aug 14, 2023
23d83d0
:sparkles: ProjectInProgressResponseData 생성
Huuuunee Aug 14, 2023
b87a642
:sparkles: ProjectInProgressData 생성
Huuuunee Aug 14, 2023
0bc02f8
:sparkles: LinkRequestData 생성
Huuuunee Aug 14, 2023
35c86be
:sparkles: GetRegionServiceImpl 생성
Huuuunee Aug 14, 2023
8176ca0
:sparkles: LanguageCertificatePersistenceAdapter delete ν•¨μˆ˜ μˆ˜μ •
Huuuunee Aug 14, 2023
c5dfb8b
:sparkles: QueryCurrentUserProfileDetailUseCase μˆ˜μ •
Huuuunee Aug 14, 2023
39c306a
:sparkles: CommandCertificatePort delete μˆ˜μ •
Huuuunee Aug 14, 2023
062cb8e
:sparkles: CommandCertificateService delete μˆ˜μ •
Huuuunee Aug 14, 2023
34cf9ac
:sparkles: CommandCertificateServiceImpl delete μˆ˜μ •
Huuuunee Aug 14, 2023
ad7088a
:sparkles: CommandLanguageCertificatePort delete μˆ˜μ •
Huuuunee Aug 14, 2023
2d16818
:sparkles: CommandLanguageCertificateService delete μˆ˜μ •
Huuuunee Aug 14, 2023
5c25c2d
:sparkles: CommandLanguageCertificateService κ΅¬ν˜„μ²΄ delete μˆ˜μ •
Huuuunee Aug 14, 2023
18d00e0
:sparkles: CommandRegionPort κ΅¬ν˜„μ²΄ delete μˆ˜μ •
Huuuunee Aug 14, 2023
05b4e08
:sparkles: CommandRegionPort κ΅¬ν˜„μ²΄ delete μˆ˜μ •
Huuuunee Aug 14, 2023
45e95d9
:sparkles: CommandRegionPort κ΅¬ν˜„μ²΄ delete μˆ˜μ •
Huuuunee Aug 14, 2023
997600c
:sparkles: CommandTechStackPort delete μˆ˜μ •
Huuuunee Aug 14, 2023
783e14c
:sparkles: CommandTechStackService delete μˆ˜μ •
Huuuunee Aug 14, 2023
1e5084b
:sparkles: CommandTechStackService κ΅¬ν˜„μ²΄ delete μˆ˜μ •
Huuuunee Aug 14, 2023
483f969
:sparkles: CertificatePersistenceAdapter delete μˆ˜μ •
Huuuunee Aug 14, 2023
1a3ac68
:sparkles: QueryStudentPort μˆ˜μ •
Huuuunee Aug 14, 2023
64351e7
:sparkles: Count 둜 검색 ν•¨μˆ˜ 생성
Huuuunee Aug 14, 2023
49eccc5
:sparkles: RegionPersistenceAdapter delete μˆ˜μ •
Huuuunee Aug 14, 2023
7225c75
:sparkles: νšŒμ›κ°€μž… ROLE_STUDENT만 κ²€μ‚¬ν•˜λŠ”κ±°μ—μ„œ ROLE_TEACHERκ°€ μ•„λ‹λ•Œλ§Œ λ˜λ„λ‘ λ³€κ²½
Huuuunee Aug 14, 2023
22dcc83
:sparkles: μ •λ³΄κΈ°μž… λΆ€λΆ„ ν”„λ‘œμ νŠΈ μˆ˜μ •
Huuuunee Aug 14, 2023
9ef48b9
:sparkles: Dto μˆ˜μ •λœκ²ƒ Adapter μ—μ„œ μˆ˜μ •
Huuuunee Aug 14, 2023
2131cba
:sparkles: νšŒμ› νƒˆν‡΄ ν”„λ‘œμ νŠΈλ„ 적용
Huuuunee Aug 14, 2023
d83d7f5
:sparkles: λͺ¨λ“  μœ μ € λ³€κ²½λœλŒ€λ‘œ μˆ˜μ •
Huuuunee Aug 14, 2023
2a93c4b
:sparkles: DetailStudentInfoTeacherResponseData ν”„λ‘œμ νŠΈ μΆ”κ°€
Huuuunee Aug 14, 2023
8014f9f
:sparkles: DetailStudentInfoTeacherWebResponse ν”„λ‘œμ νŠΈ μΆ”κ°€
Huuuunee Aug 14, 2023
3c44edc
:sparkles: SignUpRequestData ν”„λ‘œμ νŠΈ μΆ”κ°€
Huuuunee Aug 14, 2023
bfe7979
:sparkles: SignUpWebRequest ν”„λ‘œμ νŠΈ μΆ”κ°€
Huuuunee Aug 14, 2023
67abce3
:sparkles: StudentInfoAnonymousUseCase ν…Œν¬ μŠ€νƒ λ³€κ²½λœλŒ€λ‘œ λ³€κ²½
Huuuunee Aug 14, 2023
090af3e
:sparkles: StudentInfoDetailUseCase ν…Œν¬ μŠ€νƒ λ³€κ²½λœλŒ€λ‘œ λ³€κ²½
Huuuunee Aug 14, 2023
cb1edfe
:sparkles: StudentInfoTeacherUseCase ν…Œν¬ μŠ€νƒ + ν”„λ‘œμ νŠΈ λ³€κ²½ 사항 μˆ˜μ •
Huuuunee Aug 14, 2023
9f82ff9
:sparkles: StudentTechStackPersistenceAdapter λͺ¨λ“  StudentTechStack κ°€μ Έμ˜€β€¦
Huuuunee Aug 14, 2023
81a259a
:sparkles: StudentWebAdapter ν”„λ‘œμ νŠΈ + ν…Œν¬μŠ€νƒ 변경사항 μˆ˜μ •
Huuuunee Aug 14, 2023
edf0a15
:sparkles: UserProfileDetailResponseData ν”„λ‘œμ νŠΈ + ν…Œν¬μŠ€νƒ μΆ”κ°€
Huuuunee Aug 14, 2023
7ec929b
:sparkles: UserProfileDetailWebResponse ν”„λ‘œμ νŠΈ + ν…Œν¬μŠ€νƒ μΆ”κ°€
Huuuunee Aug 14, 2023
323d383
:twisted_rightwards_arrows: 병합
Huuuunee Aug 14, 2023
0fff8cc
:recycle: μΉ΄μš΄νŠΈκ°€ 2이상인 λ°μ΄ν„°λ§Œ κ°€μ Έμ˜€λ„λ‘ λ³€κ²½
Huuuunee Aug 14, 2023
b2cc96e
:recycle: λ°˜λ³΅λ˜λŠ” forEachλ¬Έ ν•¨μˆ˜λ‘œ λΉΌλ²„λ ΈμŠ΅λ‹ˆλ‹€.
Huuuunee Aug 17, 2023
aa696bf
:recycle: studentTechStack 을 λ°˜ν™˜ν•˜λŠ” 뢀뢄을 ν•¨μˆ˜λ‘œ λΊμŠ΅λ‹ˆλ‹€
Huuuunee Aug 17, 2023
ff075b6
:recycle: κΈ°μ‘΄ ROLE에 따라 ν•™λ²ˆμ„ 받을지 말지 κ²€μ‚¬ν•˜λŠ” 뢀뢄을 ν•¨μˆ˜λ‘œ λΉΌλ²„λ ΈμŠ΅λ‹ˆλ‹€
Huuuunee Aug 17, 2023
ed11345
:recycle: μ›λž˜ κ·œμΉ™λŒ€λ‘œ κ³ μ°¨ν•¨μˆ˜λ₯Ό μ μš©ν•˜μ˜€μŠ΅λ‹ˆλ‹€
Huuuunee Aug 17, 2023
153f59d
:recycle: λ“€μ—¬μ“°κΈ° μ΄μƒν•œ 뢀뢄을 μˆ˜μ •ν•˜μ˜€μŠ΅λ‹ˆλ‹€
Huuuunee Aug 17, 2023
deba0e6
:recycle: κΈ°μ‘΄ ν”„λ‘œμ νŠΈ Response λ₯Ό λ°˜ν™˜ν•˜λŠ” ν•¨μˆ˜κ°€ μ€‘λ³΅λ˜μ–΄ Util 둜 κ΄€λ¦¬ν•˜λ„λ‘ ν–ˆμŠ΅λ‹ˆλ‹€
Huuuunee Aug 17, 2023
d6a20cf
:recycle: Util 둜 λΊΈ ν•¨μˆ˜ 적용
Huuuunee Aug 17, 2023
f4f8c4f
:recycle: Util 둜 λΊΈ ν•¨μˆ˜ 적용
Huuuunee Aug 17, 2023
d9d1f99
:recycle: stuNumValid -> getStuNumValid 둜 λ³€κ²½
Huuuunee Aug 17, 2023
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 @@ -37,7 +37,7 @@ class SignInUseCase(
User(
name = gAuthUserInfo.name,
email = gAuthUserInfo.email,
stuNum = if (role.name == "ROLE_STUDENT") "${gAuthUserInfo.grade}${gAuthUserInfo.classNum}" + if (gAuthUserInfo.num < 10) {
stuNum = if (role.name != "ROLE_TEACHER") "${gAuthUserInfo.grade}${gAuthUserInfo.classNum}" + if (gAuthUserInfo.num < 10) {
Huuuunee marked this conversation as resolved.
Show resolved Hide resolved
"0${gAuthUserInfo.num}"
} else gAuthUserInfo.num else "",
roles = mutableListOf(role)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,52 @@
package team.msg.sms.domain.auth.usecase

import org.springframework.transaction.annotation.Transactional
import team.msg.sms.common.annotation.UseCase
import team.msg.sms.domain.certificate.service.CertificateService
import team.msg.sms.domain.file.service.ImageService
import team.msg.sms.domain.languagecertificate.service.LanguageCertificateService
import team.msg.sms.domain.project.service.ProjectLinkService
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.service.StudentService
import team.msg.sms.domain.techstack.service.TechStackService
import team.msg.sms.domain.student.service.StudentTechStackService
import team.msg.sms.domain.user.service.UserService

@UseCase
class WithdrawalUseCase(
private val userService: UserService,
private val studentService: StudentService,
private val techStackService: TechStackService,
private val projectService: ProjectService,
private val projectTechStackService: ProjectTechStackService,
private val regionService: RegionService,
private val studentTechStackService: StudentTechStackService,
private val languageCertificateService: LanguageCertificateService,
private val certificateService: CertificateService
private val imageService: ImageService,
private val certificateService: CertificateService,
private val projectLinkService: ProjectLinkService
) {
fun execute() {
val user = userService.getCurrentUser()
if (user.roles[0].name == "ROLE_STUDENT") {
val student = studentService.getStudentByUser(user)
val project = projectService.getAllProjectByStudentId(student.id)

listOf(
techStackService::deleteAllByStudent,
projectLinkService::deleteAllByProjects,
projectTechStackService::deleteAllByProjects,
imageService::deleteAllByProjects
).forEach { service ->
service(project)
}

listOf(
projectService::deleteAllByStudent,
regionService::deleteAllByStudent,
languageCertificateService::deleteAllByStudent,
certificateService::deleteAllByStudent
certificateService::deleteAllByStudent,
studentTechStackService::deleteAllByStudent
).forEach { service ->
service(student, user)
service(student)
Huuuunee marked this conversation as resolved.
Show resolved Hide resolved
}

studentService.deleteByUuid(studentId = student.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import team.msg.sms.domain.user.model.User

interface CommandCertificateService {
fun saveAll(certificate: List<Certificate>, student: Student, user: User): List<Certificate>
fun deleteAllByStudent(student: Student, user: User)
fun deleteAllByStudent(student: Student)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class CommandCertificateServiceImpl(
override fun saveAll(certificate: List<Certificate>, student: Student, user: User): List<Certificate> =
certificatePort.saveAll(certificate, student, user)

override fun deleteAllByStudent(student: Student, user: User) =
certificatePort.deleteAllByStudent(student, user)

override fun deleteAllByStudent(student: Student) =
certificatePort.deleteAllByStudent(student)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import team.msg.sms.domain.user.model.User

interface CommandCertificatePort {
fun saveAll(certificate: List<Certificate>, student: Student, user: User): List<Certificate>
fun deleteAllByStudent(student: Student, user: User)
fun deleteAllByStudent(student: Student)
}
10 changes: 10 additions & 0 deletions sms-core/src/main/kotlin/team/msg/sms/domain/file/model/Image.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package team.msg.sms.domain.file.model

import team.msg.sms.common.annotation.Aggregate

@Aggregate
data class Image(
val id: Long,
val imageUrl: String,
val projectId: Long
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package team.msg.sms.domain.file.service

import team.msg.sms.domain.file.model.Image
import team.msg.sms.domain.project.model.Project

interface CommandImageService {
fun saveAll(images: List<Image>)
fun deleteAllByProjects(projects: List<Project>)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package team.msg.sms.domain.file.service

import team.msg.sms.domain.file.model.Image

interface GetImageService {
fun getAllByProjectId(projectId: Long): List<Image>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package team.msg.sms.domain.file.service

import team.msg.sms.common.annotation.Service

@Service
class ImageService(
commandImageService: CommandImageService,
getImageService: GetImageService
) : CommandImageService by commandImageService,
GetImageService by getImageService
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package team.msg.sms.domain.file.service.impl

import team.msg.sms.common.annotation.Service
import team.msg.sms.domain.file.model.Image
import team.msg.sms.domain.file.service.CommandImageService
import team.msg.sms.domain.file.spi.ImagePort
import team.msg.sms.domain.project.model.Project

@Service
class CommandImageServiceImp(
private val imagePort: ImagePort
) : CommandImageService {
override fun saveAll(images: List<Image>) =
imagePort.saveAll(images)

override fun deleteAllByProjects(projects: List<Project>) =
imagePort.deleteAllByProjects(projects)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package team.msg.sms.domain.file.service.impl

import team.msg.sms.common.annotation.Service
import team.msg.sms.domain.file.model.Image
import team.msg.sms.domain.file.service.GetImageService
import team.msg.sms.domain.file.spi.ImagePort

@Service
class GetImageServiceImpl(
private val imagePort: ImagePort
) : GetImageService{
Huuuunee marked this conversation as resolved.
Show resolved Hide resolved
override fun getAllByProjectId(projectId: Long): List<Image> =
imagePort.queryAllByProjectId(projectId)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package team.msg.sms.domain.file.spi

import team.msg.sms.domain.file.model.Image
import team.msg.sms.domain.project.model.Project

interface CommandImagePort {
fun saveAll(images: List<Image>)
fun deleteAllByProjects(projects: List<Project>)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package team.msg.sms.domain.file.spi

interface ImagePort :
CommandImagePort,
QueryImagePort
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package team.msg.sms.domain.file.spi

import team.msg.sms.domain.file.model.Image

interface QueryImagePort {
fun queryAllByProjectId(projectId: Long): List<Image>
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import team.msg.sms.domain.user.model.User

interface CommandLanguageCertificateService {
fun saveAll(languageCertificate: List<LanguageCertificate>, student: Student, user: User): List<LanguageCertificate>
fun deleteAllByStudent(student: Student, user: User)
fun deleteAllByStudent(student: Student)
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CommandLanguageCertificateServiceImpl(
): List<LanguageCertificate> =
languageCertificatePort.saveAll(languageCertificate, student, user)

override fun deleteAllByStudent(student: Student, user: User) =
languageCertificatePort.deleteAllByStudent(student, user)
override fun deleteAllByStudent(student: Student) =
languageCertificatePort.deleteAllByStudent(student)

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import team.msg.sms.domain.user.model.User

interface CommandLanguageCertificatePort {
fun saveAll(region: List<LanguageCertificate>, student: Student, user: User): List<LanguageCertificate>
fun deleteAllByStudent(student: Student, user: User)
fun deleteAllByStudent(student: Student)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package team.msg.sms.domain.project.dto.req

data class LinkRequestData(
val name: String,
val url: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package team.msg.sms.domain.project.dto.req

data class ProjectInProgressData(
val start: String,
val end: String?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package team.msg.sms.domain.project.dto.req

data class ProjectRequestData(
val name: String,
val icon: String,
val previewImages: List<String>,
val description: String,
val links: List<LinkRequestData>,
val techStacks: List<String>,
val myActivity : String,
val inProgress: ProjectInProgressData
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package team.msg.sms.domain.project.dto.res

data class ProjectInProgressResponseData(
val start: String,
val end: String?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package team.msg.sms.domain.project.dto.res

data class ProjectLinkResponseData(
val id: Long,
val name: String,
val url: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package team.msg.sms.domain.project.dto.res

data class ProjectResponseData(
val id: Long,
val name: String,
val previewImages: List<String>,
val description: String,
val links: List<ProjectLinkResponseData>,
val projectTechStacks: List<String>,
val myActivity: String?,
val inProgress: ProjectInProgressResponseData
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package team.msg.sms.domain.project.exception

import team.msg.sms.common.error.SmsException
import team.msg.sms.domain.project.exception.error.ProjectErrorCode

object ProjectNotFoundException : SmsException(
ProjectErrorCode.PROJECT_NOT_FOUND
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package team.msg.sms.domain.project.exception.error

import team.msg.sms.common.error.ErrorProperty
import team.msg.sms.common.error.ErrorStatus

enum class ProjectErrorCode(
private val status: Int,
private val message: String
) : ErrorProperty {

PROJECT_NOT_FOUND(ErrorStatus.NOT_FOUND, "ν”„λ‘œμ νŠΈκ°€ μ‘΄μž¬ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€."),
;

override fun status(): Int = status
override fun message(): String = message
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package team.msg.sms.domain.project.model

import team.msg.sms.common.annotation.Aggregate
import java.util.UUID

@Aggregate
data class Project(
val id: Long,
val title: String,
val projectIconUrl: String,
val description: String,
val myActivity: String?,
val startDate: String,
val endDate: String?,
val studentId: UUID
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package team.msg.sms.domain.project.model

import team.msg.sms.common.annotation.Aggregate

@Aggregate
data class ProjectLink(
val id: Long,
val name: String,
val url: String,
val projectId: Long
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package team.msg.sms.domain.project.model

import team.msg.sms.common.annotation.Aggregate

@Aggregate
data class ProjectTechStack(
val id: Long,
val projectId: Long,
val techStackId: Long
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package team.msg.sms.domain.project.service

import team.msg.sms.domain.project.model.Project
import team.msg.sms.domain.project.model.ProjectLink

interface CommandProjectLinkService {
fun saveAll(projectLinks: List<ProjectLink>)
fun deleteAllByProjects(projects: List<Project>)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package team.msg.sms.domain.project.service

import team.msg.sms.domain.project.model.Project
import team.msg.sms.domain.student.model.Student

interface CommandProjectService {
fun save(project: Project): Project
fun deleteAllByStudent(student: Student)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package team.msg.sms.domain.project.service

import team.msg.sms.domain.project.model.Project
import team.msg.sms.domain.project.model.ProjectTechStack


interface CommandProjectTechStackService {
fun save(projectTechStack: ProjectTechStack)
fun deleteAllByProjects(projects: List<Project>)
}
Loading