-
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.
- Loading branch information
1 parent
8d0f4d3
commit 21ddc3c
Showing
2 changed files
with
25 additions
and
1 deletion.
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
18 changes: 18 additions & 0 deletions
18
src/main/kotlin/org/meogo/domain/review/service/QueryMatchService.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,18 @@ | ||
package org.meogo.domain.review.service | ||
|
||
import org.meogo.domain.user.exception.UserNotFoundException | ||
import org.meogo.domain.user.facade.UserFacade | ||
import org.springframework.stereotype.Service | ||
import org.springframework.transaction.annotation.Transactional | ||
|
||
@Service | ||
class QueryMatchService( | ||
private val userFacade: UserFacade | ||
) { | ||
|
||
@Transactional(readOnly = true) | ||
fun execute(schoolId: Int): Boolean { | ||
val user = userFacade.currentUser() ?: throw UserNotFoundException | ||
return user.enrolledSchool == schoolId | ||
} | ||
} |