// NewAppGroupRepository create an application group repository based on the database
NewAppGroupRepository create an application group repository based on the database
// NewAppGroupRepository create an application group repository based on the database
func NewAppGroupRepository(user userModels.User) AppGroupRepository {
	if database.SD_TYPE == "mongo" {
		session, db := database.GetSessionAndDB(database.MONGO_DB)
		collection := db.C(constants.SERVICE_APPS_GROUP_COLLECTION)
		return &AppGroupMongoRepository{
			Session:    session,
			Db:         db,
			Collection: collection,
		}
	}
	if database.SD_TYPE == "oracle" {
		db, err := database.ConnectToOracle(database.ORACLE_CONNECTION_STRING)
		if err != nil {
			return nil
		}
		return &AppGroupOracleRepository{
			Db:      db,
			DbError: err,
		}
	}
	return nil
}
func NewAppGroupRepository ( user userModels . User ) AppGroupRepository { if database . SD_TYPE == " " { session , db := database . GetSessionAndDB ( database . MONGO_DB ) collection := db . C ( constants . SERVICE_APPS_GROUP_COLLECTION ) return & AppGroupMongoRepository { Session : session , Db : db , Collection : collection , } } if database . SD_TYPE == " " { db , err := database . ConnectToOracle ( database . ORACLE_CONNECTION_STRING ) if err != nil { return nil } return & AppGroupOracleRepository { Db : db , DbError : err , } } return nil }
NewAppGroupRepository create an application group repository based on the database
NewAppGroupRepository create an application group repository based on the database