Implement api
This commit is contained in:
1 parent
80a99c425b
commit
b2e34c00a4
30 files changed
+708
-69
No files matched your search
@@ -0,0 +1,52 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"isp-config-service/domain"
|
||||
)
|
||||
|
||||
type ConfigHistoryService interface {
|
||||
GetAllVersion(ctx context.Context, configId string) ([]domain.ConfigVersion, error)
|
||||
DeleteConfigVersion(ctx context.Context, id string) error
|
||||
}
|
||||
|
||||
type ConfigHistory struct {
|
||||
service ConfigHistoryService
|
||||
}
|
||||
|
||||
func NewConfigHistory(service ConfigHistoryService) ConfigHistory {
|
||||
return ConfigHistory{
|
||||
service: service,
|
||||
}
|
||||
}
|
||||
|
||||
// GetAllVersion
|
||||
// @Summary Метод получение старых версий конфигурации
|
||||
// @Description Возвращает предыдущие версии конфигураций
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.ConfigIdRequest true "id конфигурации"
|
||||
// @Success 200 {array} domain.ConfigVersion
|
||||
// @Failure 400 {object} apierrors.Error "если не указан массив идентификаторов"
|
||||
// @Failure 500 {object} apierrors.Error
|
||||
// @Router /config/get_all_version [POST]
|
||||
func (c ConfigHistory) GetAllVersion(ctx context.Context, req domain.ConfigIdRequest) ([]domain.ConfigVersion, error) {
|
||||
|
||||
}
|
||||
|
||||
// DeleteConfigVersion
|
||||
// @Summary Метод удаления версии конфигурации
|
||||
// @Description Возвращает количество удаленных версий
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.ConfigIdRequest true "id версии конфигурации"
|
||||
// @Success 200 {object} domain.DeleteResponse
|
||||
// @Failure 400 {object} apierrors.Error "если не указан массив идентификаторов"
|
||||
// @Failure 500 {object} apierrors.Error
|
||||
// @Router /config/delete_version [POST]
|
||||
func (c ConfigHistory) DeleteConfigVersion(ctx context.Context, req domain.ConfigIdRequest) (*domain.DeleteResponse, error) {
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user