query.go 602 B

123456789101112131415161718192021222324252627282930313233
  1. // Code generated by gorm.io/gen. DO NOT EDIT.
  2. // Code generated by gorm.io/gen. DO NOT EDIT.
  3. // Code generated by gorm.io/gen. DO NOT EDIT.
  4. package query
  5. import (
  6. "gorm.io/gorm"
  7. "github.com/go-redis/redis/v7"
  8. "gorm.io/gen"
  9. "github.com/go-admin-team/go-admin-core/sdk"
  10. "github.com/go-admin-team/go-admin-core/sdk/config"
  11. )
  12. func Use(db *gorm.DB, opts ...gen.DOOption) *Query {
  13. return &Query{
  14. db: db,
  15. // App: newApp(db, opts...),
  16. }
  17. }
  18. type Query struct {
  19. db *gorm.DB
  20. rdb *redis.Client
  21. }
  22. func (q *Query) Init() {
  23. q.db = sdk.Runtime.GetDbByKey("*")
  24. q.rdb = config.GetRedisClient()
  25. }