rest_organization_service.go 732 字节
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 OrganizationService struct {
}

func (service *OrganizationService) OrgFrom(companyId int64, orgId int64) (*domain.Org, error) {
	if organizationAdaptor, err := adaptor.NewOrganizationAdaptor(); err != nil {
		return nil, err
	} else {
		if organization, err := organizationAdaptor.ToOrganization(companyId, orgId); err != nil {
			return nil, err
		} else {
			return organization, nil
		}
	}
}

func NewOrganizationService() (*OrganizationService, error) {
	return &OrganizationService{}, nil
}