generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #312 from GSM-MSG/feature/311-master-teacher-merge
master에 develop 변경사항 반영
- Loading branch information
Showing
48 changed files
with
687 additions
and
31 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
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
6 changes: 6 additions & 0 deletions
6
...e/src/main/kotlin/team/msg/sms/domain/teacher/dto/req/SignUpHomeroomTeacherRequestData.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 team.msg.sms.domain.teacher.dto.req | ||
|
||
data class SignUpHomeroomTeacherRequestData( | ||
val grade: Int, | ||
val classNum: Int | ||
) |
8 changes: 8 additions & 0 deletions
8
.../src/main/kotlin/team/msg/sms/domain/teacher/exception/HomeroomTeacherAlreadyException.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,8 @@ | ||
package team.msg.sms.domain.teacher.exception | ||
|
||
import team.msg.sms.common.error.SmsException | ||
import team.msg.sms.domain.teacher.exception.error.TeacherErrorCode | ||
|
||
object HomeroomTeacherAlreadyException : SmsException( | ||
TeacherErrorCode.HOMEROOM_TEACHER_ALREADY | ||
) |
8 changes: 8 additions & 0 deletions
8
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/exception/TeacherAlreadyException.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,8 @@ | ||
package team.msg.sms.domain.teacher.exception | ||
|
||
import team.msg.sms.common.error.SmsException | ||
import team.msg.sms.domain.teacher.exception.error.TeacherErrorCode | ||
|
||
object TeacherAlreadyException: SmsException( | ||
TeacherErrorCode.TEACHER_ALREADY | ||
) |
17 changes: 17 additions & 0 deletions
17
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/exception/error/TeacherErrorCode.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,17 @@ | ||
package team.msg.sms.domain.teacher.exception.error | ||
|
||
import team.msg.sms.common.error.ErrorProperty | ||
import team.msg.sms.common.error.ErrorStatus | ||
|
||
enum class TeacherErrorCode( | ||
private val status: Int, | ||
private val message: String | ||
) : ErrorProperty { | ||
|
||
TEACHER_ALREADY(ErrorStatus.CONFLICT, "선생님 정보가 존재하는 유저입니다."), | ||
HOMEROOM_TEACHER_ALREADY(ErrorStatus.CONFLICT, "동일 정보의 담임선생님이 존재합니다."), | ||
; | ||
|
||
override fun status(): Int = status | ||
override fun message(): String = message | ||
} |
12 changes: 12 additions & 0 deletions
12
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/model/HomeroomTeacher.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,12 @@ | ||
package team.msg.sms.domain.teacher.model | ||
|
||
import team.msg.sms.common.annotation.Aggregate | ||
import java.util.* | ||
|
||
@Aggregate | ||
data class HomeroomTeacher ( | ||
val id: Long = 0, | ||
val grade: Int, | ||
val classNum: Int, | ||
val teacherId: UUID, | ||
) |
10 changes: 10 additions & 0 deletions
10
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/model/Teacher.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,10 @@ | ||
package team.msg.sms.domain.teacher.model | ||
|
||
import team.msg.sms.common.annotation.Aggregate | ||
import java.util.UUID | ||
|
||
@Aggregate | ||
data class Teacher ( | ||
val id: UUID, | ||
val userId: UUID, | ||
) |
5 changes: 5 additions & 0 deletions
5
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/service/CheckHomeroomTeacherService.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,5 @@ | ||
package team.msg.sms.domain.teacher.service | ||
|
||
interface CheckHomeroomTeacherService { | ||
fun checkHomeroomTeacherExistsByGradeAndClassNum(grade: Int, classNum: Int) | ||
} |
8 changes: 8 additions & 0 deletions
8
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/service/CheckTeacherService.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,8 @@ | ||
package team.msg.sms.domain.teacher.service | ||
|
||
import team.msg.sms.domain.user.model.User | ||
|
||
interface CheckTeacherService{ | ||
fun checkTeacherExistsByUser(user: User) | ||
fun checkNewTeacher(user: User): Boolean | ||
} |
9 changes: 9 additions & 0 deletions
9
...core/src/main/kotlin/team/msg/sms/domain/teacher/service/CommandHomeroomTeacherService.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 team.msg.sms.domain.teacher.service | ||
|
||
import team.msg.sms.domain.teacher.model.HomeroomTeacher | ||
import team.msg.sms.domain.teacher.model.Teacher | ||
import team.msg.sms.domain.user.model.User | ||
|
||
interface CommandHomeroomTeacherService { | ||
fun saveHomeroomTeacher(homeroomTeacher: HomeroomTeacher, teacher: Teacher, user: User): HomeroomTeacher | ||
} |
11 changes: 11 additions & 0 deletions
11
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/service/CommandTeacherService.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,11 @@ | ||
package team.msg.sms.domain.teacher.service | ||
|
||
import team.msg.sms.domain.teacher.model.Teacher | ||
import team.msg.sms.domain.user.model.User | ||
|
||
interface CommandTeacherService { | ||
fun saveTeacher(teacher: Teacher, user: User): Teacher | ||
fun saveDirectorTeacher(teacher: Teacher, user: User): Teacher | ||
fun saveDeputyPrincipalTeacher(teacher: Teacher, user: User): Teacher | ||
fun savePrincipalTeacher(teacher: Teacher, user: User): Teacher | ||
} |
10 changes: 10 additions & 0 deletions
10
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/service/HomeroomTeacherService.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,10 @@ | ||
package team.msg.sms.domain.teacher.service | ||
|
||
import team.msg.sms.common.annotation.Service | ||
|
||
@Service | ||
class HomeroomTeacherService ( | ||
checkHomeroomTeacherService: CheckHomeroomTeacherService, | ||
commandHomeroomTeacherService: CommandHomeroomTeacherService | ||
) : CheckHomeroomTeacherService by checkHomeroomTeacherService, | ||
CommandHomeroomTeacherService by commandHomeroomTeacherService |
10 changes: 10 additions & 0 deletions
10
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/service/TeacherService.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,10 @@ | ||
package team.msg.sms.domain.teacher.service | ||
|
||
import team.msg.sms.common.annotation.Service | ||
|
||
@Service | ||
class TeacherService ( | ||
checkTeacherService: CheckTeacherService, | ||
commandTeacherService: CommandTeacherService | ||
) : CheckTeacherService by checkTeacherService, | ||
CommandTeacherService by commandTeacherService |
16 changes: 16 additions & 0 deletions
16
...c/main/kotlin/team/msg/sms/domain/teacher/service/impl/CheckHomeroomTeacherServiceImpl.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 team.msg.sms.domain.teacher.service.impl | ||
|
||
import team.msg.sms.common.annotation.Service | ||
import team.msg.sms.domain.teacher.exception.HomeroomTeacherAlreadyException | ||
import team.msg.sms.domain.teacher.service.CheckHomeroomTeacherService | ||
import team.msg.sms.domain.teacher.spi.HomeroomTeacherPort | ||
|
||
@Service | ||
class CheckHomeroomTeacherServiceImpl( | ||
private val homeroomTeacherPort: HomeroomTeacherPort | ||
) : CheckHomeroomTeacherService { | ||
override fun checkHomeroomTeacherExistsByGradeAndClassNum(grade: Int, classNum: Int) { | ||
if (homeroomTeacherPort.existsHomeroomTeacherByGradeAndClassNum(grade, classNum)) | ||
throw HomeroomTeacherAlreadyException | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/service/impl/CheckTeacherServiceImpl.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,20 @@ | ||
package team.msg.sms.domain.teacher.service.impl | ||
|
||
import team.msg.sms.common.annotation.Service | ||
import team.msg.sms.domain.teacher.exception.TeacherAlreadyException | ||
import team.msg.sms.domain.teacher.service.CheckTeacherService | ||
import team.msg.sms.domain.teacher.spi.TeacherPort | ||
import team.msg.sms.domain.user.model.User | ||
|
||
@Service | ||
class CheckTeacherServiceImpl( | ||
private val teacherPort: TeacherPort | ||
) : CheckTeacherService { | ||
override fun checkTeacherExistsByUser(user: User) { | ||
if (teacherPort.existsTeacherByUser(user)) | ||
throw TeacherAlreadyException | ||
} | ||
|
||
override fun checkNewTeacher(user: User) = | ||
teacherPort.existsTeacherByUser(user) | ||
} |
16 changes: 16 additions & 0 deletions
16
...main/kotlin/team/msg/sms/domain/teacher/service/impl/CommandHomeroomTeacherServiceImpl.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 team.msg.sms.domain.teacher.service.impl | ||
|
||
import team.msg.sms.common.annotation.Service | ||
import team.msg.sms.domain.teacher.model.HomeroomTeacher | ||
import team.msg.sms.domain.teacher.model.Teacher | ||
import team.msg.sms.domain.teacher.service.CommandHomeroomTeacherService | ||
import team.msg.sms.domain.teacher.spi.HomeroomTeacherPort | ||
import team.msg.sms.domain.user.model.User | ||
|
||
@Service | ||
class CommandHomeroomTeacherServiceImpl( | ||
private val homeroomTeacherPort: HomeroomTeacherPort | ||
) : CommandHomeroomTeacherService { | ||
override fun saveHomeroomTeacher(homeroomTeacher: HomeroomTeacher, teacher: Teacher, user: User) = | ||
homeroomTeacherPort.saveHomeroomTeacher(homeroomTeacher, teacher, user) | ||
} |
24 changes: 24 additions & 0 deletions
24
...ore/src/main/kotlin/team/msg/sms/domain/teacher/service/impl/CommandTeacherServiceImpl.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,24 @@ | ||
package team.msg.sms.domain.teacher.service.impl | ||
|
||
import team.msg.sms.common.annotation.Service | ||
import team.msg.sms.domain.teacher.model.Teacher | ||
import team.msg.sms.domain.teacher.service.CommandTeacherService | ||
import team.msg.sms.domain.teacher.spi.TeacherPort | ||
import team.msg.sms.domain.user.model.User | ||
|
||
@Service | ||
class CommandTeacherServiceImpl( | ||
private val teacherPort: TeacherPort | ||
) : CommandTeacherService { | ||
override fun saveTeacher(teacher: Teacher, user: User) = | ||
teacherPort.saveTeacher(teacher, user) | ||
|
||
override fun saveDirectorTeacher(teacher: Teacher, user: User) = | ||
saveTeacher(teacher, user) | ||
|
||
override fun saveDeputyPrincipalTeacher(teacher: Teacher, user: User) = | ||
saveTeacher(teacher, user) | ||
|
||
override fun savePrincipalTeacher(teacher: Teacher, user: User) = | ||
saveTeacher(teacher, user) | ||
} |
9 changes: 9 additions & 0 deletions
9
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/spi/CommandHomeroomTeacherPort.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 team.msg.sms.domain.teacher.spi | ||
|
||
import team.msg.sms.domain.teacher.model.HomeroomTeacher | ||
import team.msg.sms.domain.teacher.model.Teacher | ||
import team.msg.sms.domain.user.model.User | ||
|
||
interface CommandHomeroomTeacherPort { | ||
fun saveHomeroomTeacher(homeroomTeacher: HomeroomTeacher, teacher: Teacher, user: User): HomeroomTeacher | ||
} |
8 changes: 8 additions & 0 deletions
8
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/spi/CommandTeacherPort.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,8 @@ | ||
package team.msg.sms.domain.teacher.spi | ||
|
||
import team.msg.sms.domain.teacher.model.Teacher | ||
import team.msg.sms.domain.user.model.User | ||
|
||
interface CommandTeacherPort { | ||
fun saveTeacher(teacher: Teacher, user: User): Teacher | ||
} |
5 changes: 5 additions & 0 deletions
5
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/spi/HomeroomTeacherPort.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,5 @@ | ||
package team.msg.sms.domain.teacher.spi | ||
|
||
interface HomeroomTeacherPort : | ||
QueryHomeroomTeacherPort, | ||
CommandHomeroomTeacherPort |
5 changes: 5 additions & 0 deletions
5
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/spi/QueryHomeroomTeacherPort.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,5 @@ | ||
package team.msg.sms.domain.teacher.spi | ||
|
||
interface QueryHomeroomTeacherPort { | ||
fun existsHomeroomTeacherByGradeAndClassNum(grade: Int, classNum: Int): Boolean | ||
} |
9 changes: 9 additions & 0 deletions
9
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/spi/QueryTeacherPort.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 team.msg.sms.domain.teacher.spi | ||
|
||
import team.msg.sms.domain.user.model.User | ||
import java.util.* | ||
|
||
interface QueryTeacherPort { | ||
fun existsTeacherById(uuid: UUID): Boolean | ||
fun existsTeacherByUser(user: User): Boolean | ||
} |
5 changes: 5 additions & 0 deletions
5
sms-core/src/main/kotlin/team/msg/sms/domain/teacher/spi/TeacherPort.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,5 @@ | ||
package team.msg.sms.domain.teacher.spi | ||
|
||
interface TeacherPort : | ||
QueryTeacherPort, | ||
CommandTeacherPort |
Oops, something went wrong.