MSP-5186 Rename Service to AppGroup (without update controller and service names and endpoints)
This commit is contained in:
1 parent
d012a022d8
commit
42b0dbd0dc
22 files changed
+230
-177
No files matched your search
@@ -3,10 +3,11 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
|
||||
"isp-system-service/domain"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"isp-system-service/domain"
|
||||
)
|
||||
|
||||
type ApplicationService interface {
|
||||
@@ -109,7 +110,7 @@ func (c Application) GetSystemTree(ctx context.Context) ([]*domain.DomainWithSer
|
||||
func (c Application) CreateUpdate(ctx context.Context, req domain.ApplicationCreateUpdateRequest) (*domain.ApplicationWithTokens, error) {
|
||||
result, err := c.service.CreateUpdate(ctx, req)
|
||||
switch {
|
||||
case errors.Is(err, domain.ErrServiceNotFound):
|
||||
case errors.Is(err, domain.ErrAppGroupNotFound):
|
||||
return nil, status.Errorf(codes.InvalidArgument, "service with id %d not found", req.ServiceId)
|
||||
case errors.Is(err, domain.ErrApplicationDuplicateName):
|
||||
return nil, status.Errorf(codes.AlreadyExists, "application with name %s already exists", req.Name)
|
||||
|
||||
@@ -3,10 +3,11 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
|
||||
"isp-system-service/domain"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"isp-system-service/domain"
|
||||
)
|
||||
|
||||
type ServiceService interface {
|
||||
@@ -41,7 +42,7 @@ func NewService(service ServiceService) Service {
|
||||
func (c Service) GetById(ctx context.Context, req domain.Identity) (*domain.Service, error) {
|
||||
result, err := c.service.GetById(ctx, req.Id)
|
||||
switch {
|
||||
case errors.Is(err, domain.ErrServiceNotFound):
|
||||
case errors.Is(err, domain.ErrAppGroupNotFound):
|
||||
return nil, status.Errorf(codes.NotFound, "service with id %d not found", req.Id)
|
||||
case err != nil:
|
||||
return nil, err
|
||||
@@ -96,9 +97,9 @@ func (c Service) CreateUpdate(ctx context.Context, req domain.ServiceCreateUpdat
|
||||
switch {
|
||||
case errors.Is(err, domain.ErrDomainNotFound):
|
||||
return nil, status.Errorf(codes.InvalidArgument, "domain with id %d not found", req.DomainId)
|
||||
case errors.Is(err, domain.ErrServiceNotFound):
|
||||
case errors.Is(err, domain.ErrAppGroupNotFound):
|
||||
return nil, status.Errorf(codes.NotFound, "service with id %d not found", req.Id)
|
||||
case errors.Is(err, domain.ErrServiceDuplicateName):
|
||||
case errors.Is(err, domain.ErrAppGroupDuplicateName):
|
||||
return nil, status.Errorf(codes.AlreadyExists, "service with name %s already exists", req.Name)
|
||||
case err != nil:
|
||||
return nil, err
|
||||
|
||||
+3
-2
@@ -3,10 +3,11 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
|
||||
"isp-system-service/domain"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"isp-system-service/domain"
|
||||
)
|
||||
|
||||
type TokenService interface {
|
||||
@@ -55,7 +56,7 @@ func (c Token) Create(ctx context.Context, req domain.TokenCreateRequest) (*doma
|
||||
switch {
|
||||
case errors.Is(err, domain.ErrApplicationNotFound):
|
||||
return nil, status.Errorf(codes.NotFound, "application with id %d not found", req.AppId)
|
||||
case errors.Is(err, domain.ErrServiceNotFound):
|
||||
case errors.Is(err, domain.ErrAppGroupNotFound):
|
||||
return nil, status.Errorf(codes.NotFound, "service for app_id id %d not found", req.AppId)
|
||||
case errors.Is(err, domain.ErrDomainNotFound):
|
||||
return nil, status.Errorf(codes.NotFound, "domain for app_id %d not found", req.AppId)
|
||||
|
||||
Reference in new issue
Block a user