MSP-5186 Implement application next id endpoint

This commit is contained in:
Синельник Тимур Романович committed 2025-04-02 09:54:25 +03:00
1 parent 141650417a
commit 89f4eea280
4 files changed
+46

No files matched your search

+14
View File
@@ -17,6 +17,7 @@ type ApplicationService interface {
SystemTree(ctx context.Context, systemId int) ([]*domain.DomainWithService, error)
CreateUpdate(ctx context.Context, req domain.ApplicationCreateUpdateRequest) (*domain.ApplicationWithTokens, error)
Delete(ctx context.Context, idList []int) (int, error)
NextId(ctx context.Context) (int, error)
}
type Application struct {
@@ -148,3 +149,16 @@ func (c Application) Delete(ctx context.Context, req []int) (*domain.DeleteRespo
Deleted: result,
}, nil
}
// NextId godoc
// @Tags application
// @Summary Получить следующий идентификатор приложения
// @Description Возвращает следующий идентификатор приложения
// @Accept json
// @Produce json
// @Success 200 {object} integer
// @Failure 500 {object} domain.GrpcError
// @Router /application/next_id [POST]
func (c Application) NextId(ctx context.Context) (int, error) {
return c.service.NextId(ctx)
}