-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: offload heavy logic from handler to manager
- Loading branch information
Showing
16 changed files
with
905 additions
and
1,019 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
package organization | ||
|
||
import ( | ||
"errors" | ||
|
||
"kusionstack.io/kusion/pkg/domain/repository" | ||
) | ||
|
||
var ( | ||
ErrGettingNonExistingOrganization = errors.New("the organization does not exist") | ||
ErrUpdatingNonExistingOrganization = errors.New("the organization to update does not exist") | ||
ErrInvalidOrganizationID = errors.New("the organization ID should be a uuid") | ||
organizationmanager "kusionstack.io/kusion/pkg/server/manager/organization" | ||
) | ||
|
||
func NewHandler( | ||
organizationRepo repository.OrganizationRepository, | ||
organizationManager *organizationmanager.OrganizationManager, | ||
) (*Handler, error) { | ||
return &Handler{ | ||
organizationRepo: organizationRepo, | ||
organizationManager: organizationManager, | ||
}, nil | ||
} | ||
|
||
type Handler struct { | ||
organizationRepo repository.OrganizationRepository | ||
organizationManager *organizationmanager.OrganizationManager | ||
} | ||
|
||
type OrganizationRequestParams struct { | ||
OrganizationID uint | ||
} |
Oops, something went wrong.