Skip to content

Commit

Permalink
feat: add groupService to InstanceCenter
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiinaKin committed Sep 24, 2024
1 parent 08f03a9 commit 181eaf4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/src/main/kotlin/io/sakurasou/config/InstanceCenter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import io.sakurasou.service.auth.AuthService
import io.sakurasou.service.auth.AuthServiceImpl
import io.sakurasou.service.common.CommonService
import io.sakurasou.service.common.CommonServiceImpl
import io.sakurasou.service.group.GroupService
import io.sakurasou.service.group.GroupServiceImpl
import io.sakurasou.service.image.ImageService
import io.sakurasou.service.role.RoleService
import io.sakurasou.service.role.RoleServiceImpl
Expand Down Expand Up @@ -55,6 +57,7 @@ object InstanceCenter {

lateinit var authService: AuthService
lateinit var userService: UserService
lateinit var groupService: GroupService
lateinit var imageService: ImageService
lateinit var albumService: AlbumService

Expand Down Expand Up @@ -83,6 +86,7 @@ object InstanceCenter {
fun initService() {
albumService = AlbumServiceImpl(albumDao)
settingService = SettingServiceImpl(settingDao)
groupService = GroupServiceImpl(groupDao)
strategyService = StrategyServiceImpl(strategyDao)
authService = AuthServiceImpl(userDao, relationDao)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ import io.sakurasou.controller.vo.GroupVO
import io.sakurasou.controller.vo.PageResult
import io.sakurasou.extension.pageRequest
import io.sakurasou.plugins.AuthorizationPlugin
import io.sakurasou.service.group.GroupService

/**
* @author Shiina Kin
* 2024/9/9 08:58
*/
fun Route.groupRoute() {
fun Route.groupRoute(groupService: GroupService) {
route("group", {
protected = true
}) {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/kotlin/io/sakurasou/plugins/Routing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import io.ktor.server.routing.*
import io.ktor.util.logging.*
import io.sakurasou.config.InstanceCenter.authService
import io.sakurasou.config.InstanceCenter.commonService
import io.sakurasou.config.InstanceCenter.groupService
import io.sakurasou.config.InstanceCenter.roleService
import io.sakurasou.config.InstanceCenter.settingService
import io.sakurasou.config.InstanceCenter.strategyService
Expand Down Expand Up @@ -54,7 +55,7 @@ fun Application.configureRouting() {
strategyRoute(strategyService)
settingRoute(settingService)
userRoute(userService)
groupRoute()
groupRoute(groupService)
roleRoute(roleService)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ package io.sakurasou.service.group
* 2024/9/13 14:47
*/
interface GroupService {
fun saveGroup()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.sakurasou.service.group
/**
* @author Shiina Kin
* 2024/9/24 12:41
*/
class GroupServiceImpl(
private val groupDao: GroupDao
) : GroupService {
}

0 comments on commit 181eaf4

Please sign in to comment.