feat: rbac迁移完成,并已部署至dev服务器

This commit is contained in:
Blizzard
2026-05-01 01:19:50 +08:00
parent f80a3dc064
commit 8b11068fef
250 changed files with 6314 additions and 13072 deletions
@@ -0,0 +1,32 @@
package svc
import (
"sundynix-micro-go/app/auth/api/internal/config"
"sundynix-micro-go/app/system/rpc/systemservice"
"sundynix-micro-go/common/utils/captcha"
"github.com/redis/go-redis/v9"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/zrpc"
)
type ServiceContext struct {
Config config.Config
SystemRpc systemservice.SystemService
}
func NewServiceContext(c config.Config) *ServiceContext {
// 初始化 Redis 并注入验证码存储
rdb := redis.NewClient(&redis.Options{
Addr: c.Redis.Host,
Password: c.Redis.Pass,
DB: c.Redis.DB,
})
captcha.InitWithRedis(rdb)
logx.Infof("验证码存储已切换至 Redis (DB%d)", c.Redis.DB)
return &ServiceContext{
Config: c,
SystemRpc: systemservice.NewSystemService(zrpc.MustNewClient(c.SystemRpc)),
}
}