Skip to content

Commit

Permalink
不要モジュール削除
Browse files Browse the repository at this point in the history
  • Loading branch information
eve00 committed Dec 22, 2023
1 parent 562751c commit a5f3ae5
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 145 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ dependencies {


testImplementation ("org.http4k:http4k-client-jetty:4.48.0.0")
testImplementation( "org.jsoup:jsoup:1.12.1")
}

tasks.test {
Expand Down
8 changes: 0 additions & 8 deletions src/main/kotlin/auth/Authenticator.kt

This file was deleted.

1 change: 0 additions & 1 deletion src/main/kotlin/data/repository/CoursesRepository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ interface CoursesRepository {
suspend fun findAll() : List<Course>
suspend fun findById(courseId: CourseId) : Course
suspend fun findByFaculty(faculty: Faculty) : List<Course>
suspend fun save(course:Course)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ typealias StudentId = Identifier<Student, String>



sealed class User()
class Student(
data class Student(
private val id: StudentId,
private val name: String,
private val grade: Int,
private val faculty: Faculty,
): User() {
) {

fun getId(): StudentId {
return id
Expand All @@ -24,8 +23,4 @@ class Student(
fun getFaculty(): Faculty {
return faculty
}
}



class Teacher(): User()
}
4 changes: 2 additions & 2 deletions src/main/kotlin/domain/service/CourseManagementService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ interface CourseRegistrationService {

suspend fun drawingAndRegisterMembers(courseId: CourseId)

suspend fun registerMembers(courseId:CourseId)
}
suspend fun registerMembers(courseId: CourseId)
}
15 changes: 0 additions & 15 deletions src/main/kotlin/domain/service/CourseService.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@ package domain.service.impl

import data.repository.CourseMembersRepository
import data.repository.CourseTakingApplicationsRepository
import data.repository.CoursesRepository
import data.repository.StudentsRepository
import domain.entity.CourseId
import domain.entity.CourseTakingApplication
import domain.entity.State
import domain.service.CourseRegistrationService
import domain.service.CourseService
import domain.service.CourseTakingApplicationService

class CourseRegistrationServiceImpl(
private val courseService: CourseService,
private val courseTakingApplicationService: CourseTakingApplicationService,
private val courseTakingApplicationsRepository: CourseTakingApplicationsRepository,
private val courseMembersRepository: CourseMembersRepository,
private val coursesRepository: CoursesRepository,
private val studentsRepository: StudentsRepository
) : CourseRegistrationService {
override suspend fun drawingAndRegisterMembers(courseId: CourseId) {
/*抽選*/
val max = courseService.getCourse(courseId).getMax()
val max = coursesRepository.findById(courseId).getMax()
val drawedCourseTakingApplications = getCourseTakingApplications(courseId).shuffled()
.subList(0, max - 1)
drawedCourseTakingApplications.forEach {
Expand Down
23 changes: 0 additions & 23 deletions src/main/kotlin/domain/service/impl/CourseServiceImpl.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package domain.service.impl

import data.repository.CourseTakingApplicationsRepository
import data.repository.CoursesRepository
import domain.entity.Course
import domain.entity.CourseId
import domain.service.CourseService
import domain.service.FirstServedManagementService

class FirstServedManagementServiceImpl(
val repository: CourseTakingApplicationsRepository,
val courseService: CourseService
val coursesRepository: CoursesRepository
) : FirstServedManagementService {
override suspend fun checkCanTake(courseId: CourseId): Boolean {
return repository.findByCourseId(courseId).size < courseService.getCourse(courseId).getMax()
return repository.findByCourseId(courseId).size < coursesRepository.findById(courseId).getMax()
}

override suspend fun getCoursesCanTake(): List<Course> {
return courseService.getCourses()
return coursesRepository.findAll()
.filter { course ->
repository.findByCourseId(course.getId()).size < course.getMax()
}
Expand Down
32 changes: 3 additions & 29 deletions src/main/kotlin/webServer/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,15 @@ package webServer

fun main(args: Array<String>) {

/*
val hub = CourseTakingApplicationHub( commandHandler)
/* CourseTakingAndRegistration(
).asServer(Jetty(8080)).start()*/

CourseTaking(hub).asServer(Jetty(8080)).start()
*/

println("Server started at http://localhost:8080")

}

/*TODO: 1. Simple Type*/
/*値オブジェクトに仕様を語らせる*/

/*TODO: 2. implement steps*/


/*TODO: 3. create Events*/

/*TODO: 4. composing the pipeline*/

/*TODO: 5. injecting dependencies*/

/*
API: ApplyCourseTakingApi
Request -> UnValidatedCourseTaking -> ValidatedCourseTaking -> Result<Event> -> Response
validateCourseTaking... その学生の情報から申請が有効なのかを検証する
Event:CourseTakingApplied 履修登録が申請された
*/





Expand Down
Loading

0 comments on commit a5f3ae5

Please sign in to comment.