2025-05-26 17:31:46: merge [master:4b0510d2764306aa9a1a7375512e74d7d7876cef];
This commit is contained in:
1 parent
c5b82152e0
commit
c0687a264e
20 files changed
+474
-38
No files matched your search
@@ -15,6 +15,7 @@ type AccessListService interface {
|
||||
GetById(ctx context.Context, appId int) ([]domain.MethodInfo, error)
|
||||
SetOne(ctx context.Context, request domain.AccessListSetOneRequest) (*domain.AccessListSetOneResponse, error)
|
||||
SetList(ctx context.Context, req domain.AccessListSetListRequest) ([]domain.MethodInfo, error)
|
||||
DeleteList(ctx context.Context, req domain.AccessListDeleteListRequest) error
|
||||
}
|
||||
|
||||
type AccessList struct {
|
||||
@@ -113,3 +114,30 @@ func (c AccessList) SetList(ctx context.Context, req domain.AccessListSetListReq
|
||||
return result, nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeleteList godoc
|
||||
//
|
||||
// @Tags accessList
|
||||
// @Summary Удалить список доступных методов для приложения
|
||||
// @Description Удаляет заданный список методов для приложения
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.AccessListDeleteListRequest false "тело запроса"
|
||||
// @Success 200 {object} any
|
||||
// @Failure 404 {object} apierrors.Error
|
||||
// @Failure 500 {object} apierrors.Error
|
||||
// @Router /access_list/delete_list [POST]
|
||||
func (c AccessList) DeleteList(ctx context.Context, req domain.AccessListDeleteListRequest) error {
|
||||
err := c.service.DeleteList(ctx, req)
|
||||
switch {
|
||||
case errors.Is(err, domain.ErrApplicationNotFound):
|
||||
return apierrors.New(
|
||||
codes.NotFound,
|
||||
domain.ErrCodeApplicationNotFound,
|
||||
fmt.Sprintf("application with id %d not found", req.AppId),
|
||||
err,
|
||||
)
|
||||
default:
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,9 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"isp-system-service/domain"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type SecureService interface {
|
||||
|
||||
Reference in new issue
Block a user