You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
545 B
Go

package svc
import (
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/config"
"git.noahlan.cn/noahlan/ntool-biz/core/i18n"
"git.noahlan.cn/noahlan/ntool-biz/zero/logz"
"git.noahlan.cn/noahlan/ntool/nlog"
"github.com/zeromicro/go-zero/core/logx"
)
type ServiceContext struct {
Config config.Config
}
func NewServiceContext(c config.Config) *ServiceContext {
nlog.MustSetup(logz.WrapConf(c.Log))
logx.SetWriter(logz.NewWriter())
// 配置多语言
i18n.InitWithConfig(c.I18nConf)
return &ServiceContext{
Config: c,
}
}