allmodel.go 715 B

123456789101112131415161718192021222324
  1. package mongo_model
  2. import (
  3. apps "wechat-api/mongo_model/apps"
  4. team_members "wechat-api/mongo_model/team_members"
  5. teams "wechat-api/mongo_model/teams"
  6. users "wechat-api/mongo_model/users"
  7. )
  8. type AllMongoModel struct {
  9. UsersModel users.UsersModel
  10. TeamsModel teams.TeamsModel
  11. TeamMembersModel team_members.TeamMembersModel
  12. AppsModel apps.AppsModel
  13. }
  14. func SetupMongoModel(url, db string) *AllMongoModel {
  15. return &AllMongoModel{
  16. UsersModel: users.NewUsersModel(url, db, "users"),
  17. TeamsModel: teams.NewTeamsModel(url, db, "teams"),
  18. TeamMembersModel: team_members.NewTeamMembersModel(url, db, "team_members"),
  19. AppsModel: apps.NewAppsModel(url, db, "apps"),
  20. }
  21. }