serviceContext.go 374 B

1234567891011121314151617181920212223
  1. package svc
  2. import (
  3. "GtDataStore/app/cmd/organization/internal/config"
  4. "github.com/zeromicro/go-zero/core/stores/redis"
  5. )
  6. type ServiceContext struct {
  7. Config config.Config
  8. Cache *redis.Redis
  9. modelList
  10. }
  11. func NewServiceContext(c config.Config) *ServiceContext {
  12. svc := &ServiceContext{
  13. Config: c,
  14. Cache: c.Redis.NewRedis(),
  15. }
  16. initModel(svc)
  17. return svc
  18. }