WIP: Restructing auth api and service
Some checks failed
Backend Check Build (NixCN CMS) TeamCity build failed
Client CMS Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-28 18:19:24 +08:00
parent e3c0b60337
commit 89e7f1a41a
33 changed files with 773 additions and 1301 deletions

0
api/auth/exchange.go Normal file
View File

0
api/auth/magic.go Normal file
View File

0
api/auth/redirect.go Normal file
View File

0
api/auth/refresh.go Normal file
View File

0
api/auth/token.go Normal file
View File

View 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,
}

View File

@@ -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))

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,
}