WIP: Restructing auth api and service
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
0
api/auth/exchange.go
Normal file
0
api/auth/exchange.go
Normal file
0
api/auth/magic.go
Normal file
0
api/auth/magic.go
Normal file
0
api/auth/redirect.go
Normal file
0
api/auth/redirect.go
Normal file
0
api/auth/refresh.go
Normal file
0
api/auth/refresh.go
Normal file
0
api/auth/token.go
Normal file
0
api/auth/token.go
Normal file
@@ -2,14 +2,14 @@ package user
|
||||
|
||||
import (
|
||||
"nixcn-cms/internal/exception"
|
||||
"nixcn-cms/service"
|
||||
"nixcn-cms/service/service_user"
|
||||
"nixcn-cms/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (self *UserHandler) Full(c *gin.Context) {
|
||||
userTablePayload := &service.UserTablePayload{
|
||||
userTablePayload := &service_user.UserTablePayload{
|
||||
Context: c,
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,17 @@ package user
|
||||
|
||||
import (
|
||||
"nixcn-cms/middleware"
|
||||
"nixcn-cms/service"
|
||||
"nixcn-cms/service/service_user"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type UserHandler struct {
|
||||
svc service.UserService
|
||||
svc service_user.UserService
|
||||
}
|
||||
|
||||
func ApiHandler(r *gin.RouterGroup) {
|
||||
userSvc := service.NewUserService()
|
||||
userSvc := service_user.NewUserService()
|
||||
userHandler := &UserHandler{userSvc}
|
||||
|
||||
r.Use(middleware.ApiVersionCheck(), middleware.JWTAuth(), middleware.Permission(5))
|
||||
|
||||
@@ -2,7 +2,7 @@ package user
|
||||
|
||||
import (
|
||||
"nixcn-cms/internal/exception"
|
||||
"nixcn-cms/service"
|
||||
"nixcn-cms/service/service_user"
|
||||
"nixcn-cms/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -39,7 +39,7 @@ func (self *UserHandler) Info(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
UserInfoPayload := &service.UserInfoPayload{
|
||||
UserInfoPayload := &service_user.UserInfoPayload{
|
||||
Context: c,
|
||||
UserId: userId,
|
||||
Data: nil,
|
||||
|
||||
@@ -2,7 +2,7 @@ package user
|
||||
|
||||
import (
|
||||
"nixcn-cms/internal/exception"
|
||||
"nixcn-cms/service"
|
||||
"nixcn-cms/service/service_user"
|
||||
"nixcn-cms/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -29,7 +29,7 @@ func (self *UserHandler) List(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
userListPayload := &service.UserListPayload{
|
||||
userListPayload := &service_user.UserListPayload{
|
||||
Context: c,
|
||||
Limit: query.Limit,
|
||||
Offset: query.Offset,
|
||||
|
||||
@@ -2,7 +2,7 @@ package user
|
||||
|
||||
import (
|
||||
"nixcn-cms/internal/exception"
|
||||
"nixcn-cms/service"
|
||||
"nixcn-cms/service/service_user"
|
||||
"nixcn-cms/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -38,7 +38,7 @@ func (self *UserHandler) Update(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
userInfoPayload := &service.UserInfoPayload{
|
||||
userInfoPayload := &service_user.UserInfoPayload{
|
||||
Context: c,
|
||||
UserId: userId,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user