rest_department_service.go
738 字节
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 DepartmentService struct {
}
func (service *DepartmentService) DepartmentFrom(companyId int64, departmentId int64) (*domain.Department, error) {
if departmentAdaptor, err := adaptor.NewDepartmentAdaptor(); err != nil {
return nil, err
} else {
if department, err := departmentAdaptor.ToDepartment(companyId, departmentId); err != nil {
return nil, err
} else {
return department, nil
}
}
}
func NewDepartmentService() (*DepartmentService, error) {
return &DepartmentService{}, nil
}