add: anowflake email kafka, refa: redis connectg

This commit is contained in:
wwweww
2026-02-25 01:16:13 +08:00
parent fdbcde13b2
commit 300058ad01
67 changed files with 3596 additions and 139 deletions
@@ -0,0 +1,25 @@
package svc
import (
"juwan-backend/app/snowflake/rpc/internal/config"
generator "juwan-backend/app/snowflake/rpc/internal/pkg"
)
type ServiceContext struct {
Config config.Config
Generator *generator.Snowflake
}
func NewServiceContext(c config.Config) *ServiceContext {
gen, err := generator.NewSnowflake(
c.Snowflake.DatacenterId,
c.Snowflake.WorkerId,
)
if err != nil {
panic(err)
}
return &ServiceContext{
Config: c,
Generator: gen,
}
}