diff --git a/src/main/kotlin/com/msksbr/bookmgr/controller/AdminBookController.kt b/src/main/kotlin/com/msksbr/bookmgr/controller/AdminBookController.kt new file mode 100644 index 0000000..5b3e480 --- /dev/null +++ b/src/main/kotlin/com/msksbr/bookmgr/controller/AdminBookController.kt @@ -0,0 +1,7 @@ +package com.msksbr.bookmgr.controller + +import org.springframework.web.bind.annotation.RestController + +@RestController +class AdminBookController { +} \ No newline at end of file diff --git a/src/main/kotlin/com/msksbr/bookmgr/controller/AdminBorrowController.kt b/src/main/kotlin/com/msksbr/bookmgr/controller/AdminBorrowController.kt new file mode 100644 index 0000000..aff4ef5 --- /dev/null +++ b/src/main/kotlin/com/msksbr/bookmgr/controller/AdminBorrowController.kt @@ -0,0 +1,7 @@ +package com.msksbr.bookmgr.controller + +import org.springframework.web.bind.annotation.RestController + +@RestController +class AdminBorrowController { +} \ No newline at end of file diff --git a/src/main/kotlin/com/msksbr/bookmgr/controller/AuthController.kt b/src/main/kotlin/com/msksbr/bookmgr/controller/AuthController.kt new file mode 100644 index 0000000..4b9d9a0 --- /dev/null +++ b/src/main/kotlin/com/msksbr/bookmgr/controller/AuthController.kt @@ -0,0 +1,24 @@ +package com.msksbr.bookmgr.controller + +import com.msksbr.bookmgr.service.AuthService +import jakarta.servlet.http.HttpSession +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RestController + +// 管理登录、登出 +@RestController +class AuthController( + val authService: AuthService +) { + @PostMapping("/api/auth/login") + fun login(username: String?, password: String?) :String? { + return TODO("提供返回值") + } + @PostMapping("/api/auth/logout") + fun logout(session: HttpSession): String? { + // 直接销毁session + session.invalidate() + return TODO("Need json template") + } +} \ No newline at end of file diff --git a/src/main/kotlin/com/msksbr/bookmgr/controller/BookController.kt b/src/main/kotlin/com/msksbr/bookmgr/controller/BookController.kt new file mode 100644 index 0000000..2db09c3 --- /dev/null +++ b/src/main/kotlin/com/msksbr/bookmgr/controller/BookController.kt @@ -0,0 +1,7 @@ +package com.msksbr.bookmgr.controller + +import org.springframework.web.bind.annotation.RestController + +@RestController +class BookController { +} \ No newline at end of file diff --git a/src/main/kotlin/com/msksbr/bookmgr/controller/BorrowController.kt b/src/main/kotlin/com/msksbr/bookmgr/controller/BorrowController.kt new file mode 100644 index 0000000..e00638a --- /dev/null +++ b/src/main/kotlin/com/msksbr/bookmgr/controller/BorrowController.kt @@ -0,0 +1,7 @@ +package com.msksbr.bookmgr.controller + +import org.springframework.web.bind.annotation.RestController + +@RestController +class BorrowController { +} \ No newline at end of file diff --git a/src/main/kotlin/com/msksbr/bookmgr/controller/DashBoardController.kt b/src/main/kotlin/com/msksbr/bookmgr/controller/DashBoardController.kt new file mode 100644 index 0000000..1e2e882 --- /dev/null +++ b/src/main/kotlin/com/msksbr/bookmgr/controller/DashBoardController.kt @@ -0,0 +1,7 @@ +package com.msksbr.bookmgr.controller + +import org.springframework.web.bind.annotation.RestController + +@RestController +class DashBoardController { +} \ No newline at end of file diff --git a/src/main/kotlin/com/msksbr/bookmgr/service/AuthService.kt b/src/main/kotlin/com/msksbr/bookmgr/service/AuthService.kt new file mode 100644 index 0000000..0ab2058 --- /dev/null +++ b/src/main/kotlin/com/msksbr/bookmgr/service/AuthService.kt @@ -0,0 +1,5 @@ +package com.msksbr.bookmgr.service + +interface AuthService { + fun login(username: String?, password: String?): String? +} \ No newline at end of file diff --git a/src/main/kotlin/com/msksbr/bookmgr/service/impl/AuthServiceImpl.kt b/src/main/kotlin/com/msksbr/bookmgr/service/impl/AuthServiceImpl.kt new file mode 100644 index 0000000..fcacb49 --- /dev/null +++ b/src/main/kotlin/com/msksbr/bookmgr/service/impl/AuthServiceImpl.kt @@ -0,0 +1,11 @@ +package com.msksbr.bookmgr.service.impl + +import com.msksbr.bookmgr.service.AuthService +import org.springframework.stereotype.Service + +@Service +class AuthServiceImpl: AuthService { + override fun login(username: String?, password: String?): String? { + TODO("Not yet implemented") + } +} \ No newline at end of file