package service import ( "xps/datasource" "xps/repositories" "xps/viewmodel" ) type RepoDBService interface { GetDataOfList(objectCode string) ([]map[string]interface{}, error) GetDataOfPage(objectCode string) (*viewmodel.PageResult, error) } type repoDBService struct { repoDB *repositories.RepoDB } func NewRepoDBService() RepoDBService { return &repoDBService{ repoDB: repositories.NewRepoDB(datasource.InstanceSlave()), } } func (s *repoDBService) GetDataOfList(objectCode string) ([]map[string]interface{}, error) { return s.repoDB.GetDataOfList(objectCode) } func (s *repoDBService) GetDataOfPage(objectCode string) (*viewmodel.PageResult, error) { return s.repoDB.GetDataOfPage(objectCode) }