commfunc.go 770 B

1234567891011121314151617181920212223
  1. package jytuil
  2. import (
  3. "app.yhyue.com/moapp/jypkg/compatible"
  4. "app.yhyue.com/moapp/jypkg/middleground"
  5. "app.yhyue.com/moapp/jypkg/public"
  6. "context"
  7. "github.com/gogf/gf/v2/frame/g"
  8. )
  9. var (
  10. Middleground *middleground.Middleground
  11. Compatible = compatible.NewCompatible(MG.DB(), public.BaseMysql, public.Mysql, Middleground)
  12. )
  13. func init() {
  14. var ctx = context.Background()
  15. Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).
  16. RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).
  17. RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).
  18. RegEntManageApplication(g.Cfg().MustGet(ctx, "entManageApplication").String()).
  19. RegPublicservice(g.Cfg().MustGet(ctx, "publicserviceKey").String())
  20. }