代码拉取完成,页面将自动刷新
package svc
import (
"gitee.com/unitedrhino/core/service/apisvr/exportMiddleware"
"gitee.com/unitedrhino/core/service/datasvr/internal/config"
"gitee.com/unitedrhino/core/service/datasvr/internal/repo/relationDB"
"gitee.com/unitedrhino/core/service/syssvr/client/common"
"gitee.com/unitedrhino/core/service/syssvr/client/log"
role "gitee.com/unitedrhino/core/service/syssvr/client/rolemanage"
tenant "gitee.com/unitedrhino/core/service/syssvr/client/tenantmanage"
user "gitee.com/unitedrhino/core/service/syssvr/client/usermanage"
"gitee.com/unitedrhino/core/service/syssvr/sysExport"
"gitee.com/unitedrhino/share/ctxs"
"gitee.com/unitedrhino/share/stores"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/rest"
"github.com/zeromicro/go-zero/zrpc"
)
type ServiceContext struct {
Config config.Config
CheckTokenWare rest.Middleware
Slot sysExport.SlotCacheT
InitCtxsWare rest.Middleware
}
func NewServiceContext(c config.Config) *ServiceContext {
stores.InitConn(c.Database)
logx.Must(relationDB.Migrate(c.Database))
var ur user.UserManage
var ro role.RoleManage
ur = user.NewUserManage(zrpc.MustNewClient(c.SysRpc.Conf))
ro = role.NewRoleManage(zrpc.MustNewClient(c.SysRpc.Conf))
tm := tenant.NewTenantManage(zrpc.MustNewClient(c.SysRpc.Conf))
lo := log.NewLog(zrpc.MustNewClient(c.SysRpc.Conf))
Slot, err := sysExport.NewSlotCache(common.NewCommon(zrpc.MustNewClient(c.SysRpc.Conf)))
logx.Must(err)
return &ServiceContext{
Config: c,
CheckTokenWare: exportMiddleware.NewCheckTokenWareMiddleware(ur, ro, tm, lo).Handle,
InitCtxsWare: ctxs.InitMiddleware,
Slot: Slot,
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。