// NewServiceGroupRepository create an application group repository based on the database
NewServiceGroupRepository create an application group repository based on the database
// NewServiceGroupRepository create an application group repository based on the database
func NewServiceGroupRepository(user userModels.User) ServiceGroupRepository {
	if database.SD_TYPE == "mongo" {
		session, db := database.GetSessionAndDB(database.MONGO_DB)
		collection := db.C(SERVICE_GROUP_COLLECTION)
		return &ServiceGroupMongoRepository{
			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 &ServiceGroupOracleRepository{
			Db:      db,
			DbError: err,
		}
	}
	return nil
}
func NewServiceGroupRepository ( user userModels . User ) ServiceGroupRepository { if database . SD_TYPE == " " { session , db := database . GetSessionAndDB ( database . MONGO_DB ) collection := db . C ( SERVICE_GROUP_COLLECTION ) return & ServiceGroupMongoRepository { Session : session , Db : db , Collection : collection , } } if database . SD_TYPE == " " { db , err := database . ConnectToOracle ( database . ORACLE_CONNECTION_STRING ) if err != nil { return nil } return & ServiceGroupOracleRepository { Db : db , DbError : err , } } return nil }
NewServiceGroupRepository create an application group repository based on the database
NewServiceGroupRepository create an application group repository based on the database