rest_company_service.go
665 字节
package domain_service
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/service_gateway/adaptor"
)
type CompanyService struct {
}
func (service *CompanyService) CompanyFrom(companyId int64) (*domain.Company, error) {
if companyAdaptor, err := adaptor.NewCompanyAdaptor(); err != nil {
return nil, err
} else {
if company, err := companyAdaptor.ToCompany(companyId); err != nil {
return nil, err
} else {
return company, nil
}
}
}
func NewCompanyService() (*CompanyService, error) {
return &CompanyService{}, nil
}