MSP-5186 Add /application/get_all endpoint

This commit is contained in:
Синельник Тимур Романович committed 2025-04-02 10:15:12 +03:00
1 parent f8fa58a09c
commit fa2f88c869
7 files changed
+182

No files matched your search

+14
View File
@@ -18,6 +18,7 @@ type ApplicationService interface {
CreateUpdate(ctx context.Context, req domain.ApplicationCreateUpdateRequest) (*domain.ApplicationWithTokens, error)
Delete(ctx context.Context, idList []int) (int, error)
NextId(ctx context.Context) (int, error)
GetAll(ctx context.Context) ([]domain.Application, error)
}
type Application struct {
@@ -162,3 +163,16 @@ func (c Application) Delete(ctx context.Context, req []int) (*domain.DeleteRespo
func (c Application) NextId(ctx context.Context) (int, error) {
return c.service.NextId(ctx)
}
// GetAll godoc
// @Tags application
// @Summary Получить список приложений
// @Description Возвращает список приложений
// @Accept json
// @Produce json
// @Success 200 {array} domain.Application
// @Failure 500 {object} domain.GrpcError
// @Router /application/get_all [POST]
func (c Application) GetAll(ctx context.Context) ([]domain.Application, error) {
return c.service.GetAll(ctx)
}