重构迁移核心数据结构到认证模块;完善中间件初始化逻辑以及 logger 记录过程

This commit is contained in:
2025-05-08 13:18:54 +08:00
parent c93d0bf467
commit e2cc318560
24 changed files with 353 additions and 215 deletions

View File

@@ -22,7 +22,7 @@ type ListChannelsReq struct {
func ListChannels(c *fiber.Ctx) error {
// 检查权限
authContext, err := auth.Protect(c, []s.PayloadType{s.PayloadUser}, []string{})
authContext, err := auth.Protect(c, []auth.PayloadType{auth.PayloadUser}, []string{})
if err != nil {
return err
}
@@ -99,7 +99,7 @@ type CreateChannelReq struct {
func CreateChannel(c *fiber.Ctx) error {
// 检查权限
authContext, err := auth.Protect(c, []s.PayloadType{s.PayloadUser}, []string{})
authContext, err := auth.Protect(c, []auth.PayloadType{auth.PayloadUser}, []string{})
if err != nil {
return err
}
@@ -172,9 +172,9 @@ type RemoveChannelsReq struct {
func RemoveChannels(c *fiber.Ctx) error {
// 检查权限
authCtx, err := auth.Protect(c, []s.PayloadType{
s.PayloadUser,
s.PayloadClientConfidential,
authCtx, err := auth.Protect(c, []auth.PayloadType{
auth.PayloadUser,
auth.PayloadClientConfidential,
}, []string{})
if err != nil {
return err