Created
February 13, 2018 03:11
-
-
Save sbose78/4bb7d589014ee896958956981c84f1a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type OrganizationService interface{ | |
CreateOrganization(...) | |
ListOrganization(...) | |
} | |
type OrganizationServiceImpl struct{ | |
organizationModelService OrganizationModelService | |
} | |
func NewOrganizationServiceImpl( m organizationModelService ) OrganizationServiceImpl{ | |
return OrganizationServiceImpl{ | |
organizationModelService: m, | |
} | |
} | |
func (o *OrganizationServiceImpl) CreateOrganization(...) error { | |
o.CreateOrganization(..) // model service call. | |
return nil | |
} | |
----------------------------------------------------------------------------------------------- | |
type OrganizationModelService interface{ | |
CreateOrganization(..) | |
ListOrganization(..) | |
} | |
type OrganizationModelServiceImpl struct{ | |
app.DB | |
} | |
func NewOrganizationModelServiceImpl( db ) OrganizationServiceImpl{ | |
............. | |
} | |
func (o *OrganizationModelServiceImpl) CreateOrganization(...) error { | |
// call 10 different database tables/DAOs/repositories | |
return nil | |
} | |
--------------- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment